Commit Graph

175 Commits (001c2d12836f9c5d3b688af1f83412d39a9be195)

Author SHA1 Message Date
David Allsopp 001c2d1283 Restore Cygwin64 support 2020-09-21 13:36:03 +01:00
David Allsopp 14300d3b1a Fix -fdebug-prefix-map when using flexlink
Prepend the -fdebug-prefix-map= option with -link if the "linker" is in
fact flexlink.
2020-09-21 10:11:39 +01:00
Nicolás Ojeda Bär 9f9cc29fd8 Rename Multiple_definition => Module_linked_twice 2020-07-20 08:31:18 +02:00
Nicolás Ojeda Bär a151e9187b
When bytecode linking fails due to a missing module, show which module requires it (#9583) 2020-05-21 05:37:09 +02:00
Nicolás Ojeda Bär 1e98c52e93
Link std_exit.cmo into binaries compiled with -output-complete-exe (#9495) 2020-04-25 13:01:03 +02:00
Anukriti12 7266b79d60 code review changes 2020-04-02 16:38:54 +05:30
Anukriti12 8f235efdf5 call_linker now returns exit_code for better error response on linking_error, fixes #7141 2020-03-23 06:12:05 +05:30
Jérémie Dimino c7de942730
Fix #9344 (#9368)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2020-03-17 11:38:45 +00:00
Gabriel Scherer c76edb9677 [refactoring] use named fields for Consistbl.Inconsistency exception 2019-11-07 15:07:46 +01:00
Nicolás Ojeda Bär 3aff5141fd Add a new -output-complete-exe option (#8872)
This option allows to build self-contained bytecode executable and is aimed to replace `-custom`. The main difference between the two is that executables produced by `-output-compete-exe` can be stripped.
2019-09-25 08:07:31 +01:00
Gabriel Scherer 010d94cae2
Merge pull request #2309 from TheLortex/runtime-variant-path
Add -noruntime option
2019-06-19 16:12:28 +02:00
Lucas Pluvinage 198d650245 without-runtime: cosmetic tweaks 2019-06-11 10:06:56 +02:00
Damien Doligez 53d0cf6d3d Add error handling when finding and copying the camlheader file. 2019-06-10 11:17:54 +01:00
Lucas Pluvinage e61263c0ac Introduce the -without-runtime option. 2019-05-06 14:35:57 +02:00
David Allsopp 8838dc7527 Don't generate #! headers over 127 characters
A #! line should not exceed 128 characters (including the \0
terminator). This adds a test - both to the generation of the camlheader
files and also to the -use-runtime flag which falls back to #!/bin/sh
and uses exec to invoke the the interpreter.
2019-05-02 20:29:49 +02:00
Stephen Dolan 838e44a245
Update issue numbers in comments after Mantis -> Github migration. (#8505) 2019-03-18 09:42:23 +00:00
Mark Shinwell d47ba6ec18
Functorize Consistbl (with some background info on Compilation_unit.t) (#2286) 2019-03-07 16:19:51 +00:00
David Allsopp 611fa6e8f8 Fix -compat-32 error message in -custom mode
In -custom mode, then bytecode executable is first made in /tmp and this
filename leaked if the executable fails the -compat-32 test.
2019-02-01 16:18:53 +01:00
Gabriel Scherer 05434e9692 refactoring: use Misc type aliases in bytecomp/bytelink 2019-01-30 22:37:13 +01:00
Jeremie Dimino 7e0862a212 Refactor load path management and initial environment
- Add a Load_path module which caches files lookup

- Instead of falling back to the external environment, allow to
  declare in the environment that a module comes from the external
  world. This allows persistent structures to shadows non-persistent
  ones
2019-01-30 16:36:38 +00:00
Leo White 11d759c584
Fix new dynlink's initialisation checks (#2176) 2018-12-08 10:15:19 -05:00
Thomas Refis fc210f08e4 ident: hide stamp related functions from the interface
The only remaining user was [Predef], which was bumping the counter by
999 to allow cmis to remain compatible if new predefs were defined.
This commit removes that use by making sure that every ident defined in
predef.ml is marked as predef and use a different stamp counter as user
defined idents. That way idents in cmi always start at 1, no matter how
many predefs there are.

Stamps on predef aren't strictly necessary: predefs names are unique.
However, predef idents comparison is just faster with stamps.
2018-09-21 11:47:44 -04:00
Nicolás Ojeda Bär 40bab2d768 Implement reviewer suggestions 2018-07-25 17:58:32 +02:00
François Bobot da3f9f34f5 Use reraise_raw_backtrace in Misc.try_finally
And add labels ~always for previous cleanup function and
    ~exceptionally for new cleanup function in exceptional case
2018-07-25 17:58:32 +02:00
Valentin Gatien-Baron 0444eac687 Print warnings on the warnings formatter in the couple of places that don't
Except the OCAMLPARAM stuff, as that runs before the command line
warning settings are even parsed, so while they are reported using the
normal warnings code, they don't look like normal warnings.
2018-07-15 15:00:47 -04:00
Xavier Clerc 9c182f7e24 Add -dcamlprimc + pass -fdebug-prefix-map when available (#1845)
- Introduce `-dcamlprimc`, to keep the generated C file containing the primitive list
- Use `-fdebug-prefix-map` for compiling temporary C files when this option is supported
2018-06-27 14:56:29 +01:00
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00
Stephen Dolan aa1dc8063a Remove Meta.static_{alloc, free}.
The bytecode runtime now represents code to be loaded as LongString.t,
rather than as a naked pointer to a bytecode block.

(This commit breaks Dynlink of bytecode, due to an issue about digests)
2018-04-13 16:29:33 +01:00
Gabriel Scherer 6c558779da honor the BUILD_PATH_PREFIX_MAP variable if it exists:
<https://reproducible-builds.org/specs/build-path-prefix-map/>
2018-03-01 17:54:16 +01:00
Pierre Chambart 6bfa23c08b Replace uses of Lambda.IdentSet by Ident.Set 2018-01-30 19:12:29 +01:00
Nicolas Ojeda Bar 799f36d3e6 Rename: use _os suffix 2017-09-27 11:55:53 +02:00
Nicolas Ojeda Bar ecaebcad4a Fix -output-obj C file argv signature 2017-09-27 10:49:30 +01:00
François Bobot 1343658f5d [OCamlc] use OUTPUTOBJ and move CAML_INTERNAL
in the generated file instead of in the command line
2017-09-15 21:28:59 +02:00
François Bobot 8afe629b5f [OCamlc] fixes output_complete_object
ocamlc complained that the temporary files it just created existed.
   since ed60dece81575305b5f1f7394cdda652b65b037a and
   19d3bccf48fee6e5e91e65e9f8a5d07c49d2afd4
2017-09-13 17:28:56 +02:00
hhugo b14e6fee9b Compiler: -compat-32 flag when building cmo/cma. (#896)
* Complier: -compat-32 flag when building cmo/cma.

Compiler: refactor -compat-32 support

Update Changes

Complier: more -compat-32 checks in emitcode.

* add tests for the -compat-32 flag
2017-05-05 07:18:40 +01:00
Max Mouratov 9ef45bbd13 runtime: caml_startup_pooled function added 2017-03-17 20:50:16 +05:00
Mark Shinwell 766d970e78 Add caml_startup_exn 2017-02-21 11:49:12 +01:00
Pierre Chambart 8703a360d5 Fix lack of link error when missing modules providing externals (#837, PR#7371)
* Check that all the required modules are provided
   Also remove provided cmo from the required globals
* Remove required globals from packs when provided
* Remove provided globals after adding required ones
   Pack modules can require globals they provide.
* Dumpobj tool can print relocation information
2016-12-14 13:14:21 +00:00
Pierre Chambart 25d24e38c2 Also remove linking hack for bytecode
Adds the required_globals information to bytecode compilation units.

This patch also bootstrap ocamlc. The cmo format is changed by this
commit, there is no way around bootstraping here. Note that ocamldep and
ocamllex does not rely on the cmo format, so they are not present in
this commit.

Changes in tests:

* Update test/transprim/comparison_table.ml.reference:
    The (opaque (global List!)) expression is not present anymore

* Update tests/no-alias-deps/aliases.cmo.reference
    The output of objinfo changed
2016-07-08 16:02:26 +02:00
Sébastien Hinderer 766ca57138 Fix the -use-runtime option.
This option was broken, as can be seen by using it to compile the
following helloworld.ml program:

let _ = Printf.printf "Hello, world!\n%!"

Then from OCaml's toplevel source directory, compile as follows:

./ocamlc.opt -use-runtime ${HOME}/src/ocaml/byterun/ocamlrun \
  -nostdlib -I stdlib -o helloworld.byte helloworld.ml

And do:

head -1 helloworld.byte

See the double #! at the beginning of the line.

The first one comes from the "header" file which is included and is
correct (it would be a different header on Windows).

The second one is hard-coded and should be removed, this is what
this patch does.
2016-06-08 22:40:37 +02:00
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +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 1c28b231ef Revert "PR#6475: accept -o in ocamlc when compiling C files"
This reverts commit 1d8e590c54.

Conflicts:
	Changes
	bytecomp/bytelink.ml
	driver/optcompile.ml
	ocamlbuild/ocaml_specific.ml
	ocamlbuild/testsuite/internal.ml
	utils/ccomp.ml
2016-02-10 10:34:02 +01:00
Jacques Garrigue eb0de16ee0 Fix PR#4166, PR#6959: force linking when calling external C primitives 2015-11-13 13:59:14 +09: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
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Gabriel Scherer 41e0ecf2ef PR#6642: replace $CAMLORIGIN in -ccopt with the path to cma or cmxa
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15828 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-08 11:18:29 +00:00
Gabriel Scherer f256b3733d minor: cut too-long lines
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15735 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 12:18:10 +00:00
Gabriel Scherer 1d8e590c54 PR#6475: accept -o in ocamlc when compiling C files
(Vincent Laporte, Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15734 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 12:18:07 +00:00
Gabriel Scherer fe758fb897 PR#6616: allow meaningful use of -use-runtime without -custom.
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15720 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 10:45:11 +00:00