|Anonymous | Login | Signup for a new account||2017-09-25 19:04 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006409||OCaml||compiler driver||public||2014-05-10 15:21||2017-03-01 15:27|
|Target Version||Fixed in Version|
|Summary||0006409: `ocamlc -linkall -c test.ml` should activate force-linking in `test.cmo`|
|Description||When producing an archive (cma, cmxa), adding -linkall marks compilation unit of the archive as force-linked. It would be consistent and helpful if -linkall did also work when producing .cmo/.cmx. As far as I can tell, it is currently ignored.|
$ mkdir test
$ echo "let x = 1" > test.ml
$ ocamlc -linkall -c test.ml
$ ocamlobjinfo test.cmo | grep link
Force link: no
While .cmo/.cmx are always linked anyway when passed to a linking step, the interest of marking a .cmo with force-linking is that it would remain force-linked in any archive including it.
I stepped on this non-behavior of -linkall when playing with force-linking side-effecting modules of the compiler (eg. typing/typeclass.cmo) during the discussion of https://github.com/ocaml/ocaml/pull/53. [^] In any situation where typeclass.cmo and typecore.cmo are available and typecore.cmo is used, it is unsafe not to link typeclass.cmo as well; it would make sense to simply compile typeclass.cmo with -linkall.
|Tags||No tags attached.|
I'm not sure your example is a good one.
What you are saying is that whenever typecore.cmo is linked, typeclass.cmo should be linked too.
I.e., that there is a two-way dependency between these modules.
But the proposed solution would include typeclass.cmo always, even when typecore.cmo is not included.
Isn't it rather a good reason to keep -pack around: interdependent files should be packed inside the same object. If needed, one can avoid the induced nesting using module aliases.
Implemented by GPR#1009 ( https://github.com/ocaml/ocaml/pull/1009 [^] )
|2014-05-10 15:21||gasche||New Issue|
|2014-05-16 17:49||doligez||Severity||tweak => feature|
|2014-05-16 17:49||doligez||Status||new => acknowledged|
|2014-05-17 03:30||garrigue||Note Added: 0011508|
|2017-02-23 16:36||doligez||Category||OCaml general => -OCaml general|
|2017-03-01 15:27||doligez||Note Added: 0017512|
|2017-03-01 15:27||doligez||Status||acknowledged => resolved|
|2017-03-01 15:27||doligez||Resolution||open => fixed|
|2017-03-01 15:27||doligez||Category||-OCaml general => compiler driver|
|Copyright © 2000 - 2011 MantisBT Group|