Commit Graph

602 Commits (c4e8117c2bf2b17e60c5d141456a3628d150513c)

Author SHA1 Message Date
David Allsopp ef2cdbe1e7 Correctly detect _set_invalid_parameter_handler
There is still at least one Microsoft-supported version of the CRT which
does not include the secure versions of various functions, and
consequently does not include `_set_invalid_parameter_handler`.

Tests for the definition and inclusion of
caml_install_invalid_parameter_handler refined to detect
`__STDC_SECURE_LIB__` defined in `crtdefs.h`. This is a badly documented,
but standardised, define. Although `__STDC_SECURE_LIB__` is compatible
with MinGW, I have retained the test for `_MSC_VER` and so kept this as an
MSVC-only patch.
2016-03-10 10:55:01 +01:00
Damien Doligez 5057fd0932 fix wrong comment syntax for header in asmrun/i386nt.asm 2016-02-19 18:13:32 +01:00
Damien Doligez b7d1ccce4b fix wrong comment syntax for header in asmrun/amd64nt.asm 2016-02-19 17:48:49 +01:00
Damien Doligez d5f61a4e54 tweak tools/check-typo and break more overlong lines 2016-02-19 12:28:36 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00
Damien Doligez 59a4fd6615 Merge pull request #408 from btj/trunk
Fixes bugs in stack unwinding metadata (PR#7118,7120)
2016-02-12 11:20:02 +01:00
Christophe Troestler 7f6a8ae2f0 Protect install paths against spaces (on Windows) 2016-02-10 14:46:39 +01:00
Pierre Chambart 050c454765 Add middle_end to Makefiles 2016-01-22 01:24:02 +01:00
Damien Doligez efa7d04f11 fix problem reported in GPR#435: assertion failure 2016-01-21 17:38:09 +01:00
Bart Jacobs 237daf3457 Add missing unwind info for 'caml_start_program'
This enables correct stack unwinding, and helps prevent random crashes on OS X
due to Cocoa or other Objective-C (or C++) external functions walking
our stack.
2016-01-18 09:11:13 +01:00
Bart Jacobs 75ae60ccca Enabled full stack trace in platform debuggers
Platform debuggers such as `gdb` and `lldb` can now show a full stack trace for
call stacks that include ocamlopt-generated code. Specifically, this commit adds
base pointer information to the stack unwinding metadata of runtime function
`caml_start_program`.
2016-01-09 03:32:22 -08:00
Bart Jacobs edb83d153f Fixed some bugs in stack unwinding metadata of runtime routines
It's easy to forget that the assembler ignores the program's
control flow when computing the resulting CFA offset of the
various CFI_ADJUST directives. Note that unbalanced
CFI_ADJUST directives in one assembly routine cause all offsets
in all subsequent routines to be shifted by the corresponding
amount.
2016-01-09 02:41:34 -08:00
Mark Shinwell b085ec553c New files for flambda 2016-01-04 13:42:56 +00:00
alainfrisch f55d23deac Delete symlink which was wrongly added in commit 0225ca01e3 and broke build on Windows. 2015-12-23 11:04:15 +01:00
Xavier Leroy b1f2289de1 GPR#333: mark stack as nonexecutable. 2015-12-22 16:20:26 +01:00
Damien Doligez ebe0f9e347 simplify incremental root scanning 2015-12-21 14:27:47 +01:00
Damien Doligez 5b8296c933 Revert the change to the GC calling protocol: the allocation pointer
does not need to point to a valid header when the GC is called. On the
other hand, the major GC can only start a cycle when the minor heap
(allocation arena) is empty.
2015-12-21 14:27:46 +01:00
Damien Doligez 99e265459f fix bug in incremental marking of roots 2015-12-21 14:27:46 +01:00
Damien Doligez 0225ca01e3 GC latency improvements 2015-12-21 14:27:46 +01:00
alainfrisch e888e099e2 Revert commits related to #330.
1. Revert "Switch to -custom for bytecode tests."
This reverts commit 6b7f81caf5.

2. Revert "Fix Changelog."
This reverts commit d94488d7b5.

3.Revert "Fix testsuite: use binary channels."
This reverts commit 840f7ca506.

4. Revert "Fix testsuite: do not require a globally installed ocamlrun."
This reverts commit 0388ef46d9.

5. Revert "Merge branch 'trunk' of https://github.com/bvaugon/ocaml into bvaugon-trunk"
This reverts commit 1ff6db10bf, reversing
changes made to 89d116c514.
2015-12-08 14:44:29 +01:00
Rich Neswold 2914b95cbb Add support for NetBSD/arm. 2015-12-05 10:16:48 -06:00
Benoit Vaugon 5e3964da86 Fix "weak hash of serialised closures" from mantis #0005942. 2015-12-04 00:51:44 +01:00
Xavier Leroy 51104fc231 Update zsystem branch wrt upstream trunk.
Resolved conflicts: testsuite/tests/asmcomp/mainarith.c
2015-11-19 13:55:54 +01:00
Damien Doligez 7cb9a80744 simplify .gitignore; remove .ignore files and tools/setignore; adjust tools/check-typo 2015-11-06 16:25:05 +01:00
alainfrisch 10b4f8d213 Attempt to fix a probable bug introduced by GPR#156. 2015-11-03 23:09:33 +01:00
Xavier Leroy 8e8835101a z port: simplify caml_start_program (cosmetic) 2015-11-01 05:01:03 -05:00
Xavier Leroy 9ff553d9ed z port: update caml_ml_bound_error
To reflect the changes to caml_c_call from commit cc9c12dff3
2015-10-30 12:16:58 -04:00
Xavier Leroy cc9c12dff3 z port: fix issue with PIC code and dynamic loading
In PIC mode, Itailcall_imm should jumpt to the PLT of the called function.

Also: use %r7 rather than %r1 to pass the function pointer argument to caml_c_call.  It can be that caml_c_call is in a different shared object than the caller.  In this case, %r0 and %r1 can be destroyed by PLT stub code, according to the ELF ABI.
2015-10-30 11:30:39 -04:00
Xavier Leroy 88fd26f63c z port: streamline the heap allocation code
Move the cold path (the one that calls the GC when alloc_ptr < alloc_limit)
as much as possible to the end of the function.

Use la and lay to produce shorter code.
2015-10-30 09:26:11 -04:00
Xavier Leroy 1e4aedd404 zSystem port: use %r12 as normal register + extcall conventions
Following the previous commit, %r12 becomes usable as a normal register.
However it must be saved in caml_call_gc.

Independently: change Proc.loc_external_arguments to account for the
160 reserved bytes at bottom of stack.  Then, caml_c_call and
emission of code for Iextcall(false) no longer need to account for
those reserved bytes.
2015-10-30 06:57:10 -04:00
Xavier Leroy f6a0392f57 zSystem port: do not mark return addresses
Using the low bit of return addresses to mark already-scanned stack frames improves GC time on architectures that ignore this bit in 'return' instructions, like Power.  Otherwise, as is the case for zSystem, clearing up this bit before every 'return' instruction costs too much in running time.

asmrun/stack.h: turn off the marking of return addresses for z
asmcomp/s390x/emit.mlp: suppress clearing of low bit of return addresses
2015-10-29 05:44:01 -04:00
Xavier Leroy 58db11e051 IBM zSystem port of OCaml
Import of Bill O'Farrell's port, rebased from 4.02.1 to trunk.
2015-10-29 09:55:19 +01:00
Mark Shinwell ca39ac766e GPR#262: Multiple GC roots per compilation unit
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16538 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-23 15:16:22 +00:00
Damien Doligez 8463f6667f ignore generated files
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16491 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-12 09:44:51 +00:00
Gabriel Scherer bedb4e3ac1 Build system: fix a few hardcoded ar commands.
(Daniel Bünzli)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16485 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:57 +00:00
Damien Doligez b860d63145 whitespace cleanup, cut long lines, add some missing headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-11 11:58:31 +00:00
Xavier Leroy ee9d50e899 asmrun/Makefile: Remove hard-wired '-O' options
configure: uninitialized variable $nativeccprofopts


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16377 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 14:15:54 +00:00
Xavier Leroy 6e9cd068c7 Support for PowerPC 64 bits big- and little-endian. Revised PowerPC 32 bits support.
Merge of branch 'ppc64'.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16374 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 09:28:33 +00:00
Gabriel Scherer 92be080ced second attempt to fix asmrun/backtrace.c windows build failure
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16372 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 15:54:09 +00:00
Gabriel Scherer 537c17af25 attempt to fix asmrun/backtrace.c windows build failure
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16371 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 14:22:28 +00:00
Gabriel Scherer 8da9ae04bb Adjust documentation
From: Frédéric Bour <frederic.bour@lakaban.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16368 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 06:04:24 +00:00
Gabriel Scherer c94118d61f Only register caml_backtrace_last_exn as root once.
This simplify the code, would have prevented GPR#205 and prepare ground
for upcoming improved backtrace generation.

From: Frédéric Bour <frederic.bour@lakaban.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16367 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 06:04:22 +00:00
Gabriel Scherer 91d1e34e2d Document backtrace infrastructure, make types more explicit
From: Frédéric Bour <frederic.bour@lakaban.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16366 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 06:04:20 +00:00
Gabriel Scherer 23d10e0875 Move backend specific backtrace code to backtrace_prim.c
And share backtrace.c between asmrun and byterun.

From: Frédéric Bour <frederic.bour@lakaban.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16365 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 06:04:18 +00:00
Xavier Leroy 84ebf792e6 Update wrt trunk, revision 16361.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16362 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-20 16:53:53 +00:00
Gabriel Scherer 9a533a50cd make alldepend
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16352 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:59 +00:00
Xavier Leroy 7dacc03db0 PPC64 ABI v1: not enough space was reserved for the parameter save area before calls to C functions.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16339 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-06 12:32:30 +00:00
Xavier Leroy e0b40f2167 Update wrt trunk r16321.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16322 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-03 11:57:46 +00:00
Gabriel Scherer 465e34a590 GPR#221: add forgotten CAMLnoreturn_end
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16321 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-03 10:06:58 +00:00