Commit Graph

10854 Commits (b40c186bfc3bb3f3099ea146618a6b674d50a47c)

Author SHA1 Message Date
Xavier Leroy 61a49e9a01 Reset debugging information at the beginning of every module.
Fix a tab.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16376 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 13:52:59 +00:00
Xavier Leroy 4ee74721a6 Update wrt trunk (r16374).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16375 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 13:40:40 +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 a01ff57130 Added .dylib and .so as extensions for ocamlmklib
(Edgar Aroutiounian, Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16373 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 21:54:14 +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 1fcc11e8cd backtrace: Require caml_val_raw_backtrace_slot to return an immediate value
From: Frédéric Bour <frederic.bour@lakaban.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16370 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 06:04:27 +00:00
Gabriel Scherer fe9b432f8c Add asmrun/backtrace.c to .gitignore
From: Frédéric Bour <frederic.bour@lakaban.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16369 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 06:04:26 +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
Mark Shinwell c4e3173807 Fix GPR#233: Make CamlinternalMod.init_mod robust to optimization
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16364 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-21 14:37:11 +00:00
Xavier Leroy e64461246f Typo in comment explaining the TOC galore. (Courtesy M. Shinwell.)
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16363 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-21 12:36:45 +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
Damien Doligez 08d7a9d403 ci-build: allow special characters in conf options
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16361 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-18 15:16:16 +00:00
Damien Doligez 2b809f3d7d fix universal CI build script for Unix
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16360 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-18 13:27:38 +00:00
Gabriel Scherer 6437506bfe Regression test for PR#3612
(Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16359 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-16 21:23:51 +00:00
Gabriel Scherer d020ae12af Handle custom block with finalizers in deserialization. Fix PR#3612
(Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16358 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-16 21:23:49 +00:00
Gabriel Scherer 8851e6b7d5 Allow allocating custom blocks with finalizers in the minor heap.
(Pierre Chambart)

When allocating this kind of blocks to the minor heap, they are
added to 'caml_finalize_table' which is traversed on
'caml_empty_table' to check if any of such block is dead.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16357 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-16 21:23:47 +00:00
Gabriel Scherer ceb5e0baa8 Move bytecode debug info from the OCaml heap to static allocations
There is currently a GC bug in the bytecode debug-info handling, due
to the fact that
  void read_main_debug_info(struct debug_info *di)
is passed a internal pointer in the middle of a custom block inside
the OCaml heap. I could only observe the bug when such custom blocks
are allocated on the minor heap -- which does not happen with the
current implementation, but becomes possible after GPR#92 for example
(which let custom blocks with finalizer be allocated in the
minor heap).

This commit fixes this issue by moving debug_info chunks from the
OCaml heap to the C land, stored in a dynamic table. They are
allocated when caml_add_debug_info is called, and removed when
caml_remove_debug_info is called.

(Another approach would be to keep the debug_info inside the OCaml
heap, but make sure that there are no dangling internal pointers. See
GPR#228 for an attack of this by Mark Shinwell.)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16356 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-16 20:56:12 +00:00
Gabriel Scherer 5ede9b7ebf minor testsuite fix
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16355 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-16 20:56:10 +00:00
Gabriel Scherer 5b68fbb887 so the dynlink -jN race wasn't quite fixed
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16354 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-16 20:56:07 +00:00
Gabriel Scherer 0cbd5893bd bootstrap -- for the shiny colors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16353 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 16:11:19 +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
Gabriel Scherer 02abd6c244 ocamldep: make printing of cyclic dependencies deterministic
Hashtbl.iter used to be deterministic, but it's now an observable
source of randomness.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16351 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:57 +00:00
Gabriel Scherer 459061e182 update changelog for PR#207 (coloring messages)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16350 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:55 +00:00
Gabriel Scherer c508c47101 colorize error and warning messages, refactor Location
(Simon Cruanes)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16349 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:53 +00:00
Gabriel Scherer cb3bb152ab add option handling for colors in compiler, OCAMLPARAM and ocamlbuild
(Simon Cruanes and Gabriel Scherer)

Use one of
  -color auto
  -color always
  -color never

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16348 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:51 +00:00
Gabriel Scherer 5893536b14 add Color module Misc
(Simon Cruanes)

We use bold magenta for warnings, because it works on terminals with
white background.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16347 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:49 +00:00
Gabriel Scherer a69e3e3099 add primitive caml_sys_isatty; fix bootstrap
(Simon Cruanes)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16346 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:47 +00:00
Gabriel Scherer 3211f63a31 dynlink/Makefile: make dynlink.cmi depend on dynlinkaux.cmi to avoid -jN races
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16345 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:45 +00:00
Gabriel Scherer 365cd572d7 ocamlbuild: add examples to the documentation of rule definitions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16344 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 10:26:32 +00:00
Gabriel Scherer ca7b3c1980 add release dates to Changelog
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16343 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-09 11:41:12 +00:00
Xavier Leroy bcb02e89d4 Select 32-bit TOC model if compiling with -for-pack
ocamlopt -pack can create large .o files that can easily overflow the 16-bit TOC model.


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-07 15:17:36 +00:00
Xavier Leroy 7426611bae Force word-alignment of static OCaml data.
On a Power7/RHEL6.4 machine, misalignment of the .data section was observed.


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16341 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-06 14:39:35 +00:00
Xavier Leroy 28eb4583bd Update wrt trunk r16339.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16340 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-06 13:11:57 +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 bdf3fe80d3 Be prudent, select -O2 optimization instead of -O3.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16338 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-06 09:34:12 +00:00
Xavier Leroy 59853fa694 Remove -Werror from the C compiler flags used by ocamlc/ocamlopt when compiling a C source file.
The risk of breakage of 3rd-party libraries is too high.
There might be cleaner ways to achieve this effect, e.g. split BYTECCCOMPOPTS into BYTECCCOMPOPTS and BYTECCEXTRAWARNINGS.


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16337 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-06 08:17:31 +00:00
Gabriel Scherer 162cbc8d1e minor: explicit a precondition on rootlist->level to please Clang analyzer
globroots.c:98:21: warning: Dereference of undefined pointer value
    e->forward[i] = update[i]->forward[i];
                    ^~~~~~~~~~~~~~~~~~~~~

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16336 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-05 07:50:23 +00:00
Gabriel Scherer 7a87170dfc fix the backtrace.c fix
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16335 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-05 07:50:21 +00:00
Gabriel Scherer 64eed3f20f fix an issue spotted by the Clang analyzer (assigned value never read)
yacc/reader.c:922:9: warning: Value stored to 'value' is never read
        value = UNDEFINED;
        ^       ~~~~~~~~~

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16334 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 20:32:12 +00:00
Gabriel Scherer 1714cfa5ec fix an issue spotted by the Clang analyzer (leak in yacc/reader.c)
yacc/reader.c:1328:7: warning: Potential leak of memory pointed to by 'a_line'
      fprintf(f, ")\n# 0\n              ");
      ^~~~~~~

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16333 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 20:32:11 +00:00
Gabriel Scherer 32511c53af fix an issue spotted by the Clang analyzer (potential malloc(0) call)
byterun/backtrace.c:142:12: warning: Call to 'malloc' has an allocation size of 0 bytes
  events = malloc(*num_events * sizeof(struct ev_info));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16332 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 20:32:09 +00:00
Xavier Leroy 3b9aaeafaa Remove autoconf tests that are no longer used.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16331 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 14:12:09 +00:00
Xavier Leroy 423bfe29ba Modernize the C style of those autoconf tests.
The intent is to produce fewer warnings when configuring with -verbose.
Note that the warning on "implicit declaration of function" remains,
for relatively good reasons.


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16330 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 12:14:06 +00:00
Xavier Leroy d9ab3bd2c9 When compiling with gcc or clang, use optimization level -O3 with some optimizations prudently turned off.
Auxiliary changes:
- Put GCC in gnu99 mode (= C99 + GNU extensions).
- Check C99 conformance, warn if not.
- Reject if gcc is too old ( < 3.0 )
- Stop C compilation on warnings if this is a development version of OCaml.
  (I'm tired of C warnings being ignored.)


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16329 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 12:12:47 +00:00
Xavier Leroy 2cb6ed2165 Experiment: configure gcc and clang with higher optimization levels.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16328 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 12:08:40 +00:00
Xavier Leroy 0178ea4e8e unix_gethostbyname: using a variable outside of its scope.
In the case HAS_GETHOSTBYNAME_R == 6, hp may point into h or into buffer,
so don't end the scope of h and buffer before hp is used.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16327 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 11:41:55 +00:00