Do not generate dummy code to force module linking#602
Conversation
asmcomp/asmpackager.ml
Outdated
| ~module_initializer:lam | ||
| in | ||
| let required_globals = | ||
| failwith "TODO: fill required_globals" |
There was a problem hiding this comment.
I'm guessing you're missing something here.
There was a problem hiding this comment.
Oups...
Who cares about pack anywhay ? ;-)
There was a problem hiding this comment.
In fact there is nothing to do in case of a pack
785c615 to
39b95b9
Compare
|
Good idea. This generated code was a hack anyway, I just could not find a simple way to do it. |
|
The change is not so large, it's mainly interface propagation. And 8 files changes are test files. |
|
And here it is for bytecode and closure. The changes required for the bytecode version are a bit more invasive than the native one since there was already a field in cmx to record the information, but none for bytecode. |
|
I forgot to bootstrap, hence the build failure. @gasche In this case if we keep the blob out of the real change commit, there is no way to get a working intermediate state, hence breaking bisection. Would you prefer a squashed version of the patch containing both the change and the bootstrap here ? |
251f6f4 to
4b90065
Compare
|
I think squashing would be fine if there is a well-defined commit in which to squash. Sometimes we do changes iteratively in ways that actually require doing several bootstraps in the intermediate states, and then it can be a bit cumbersome to completely preserve bisectability. |
|
@chambart Could you indicate why you need to bootstrap in this particular case? Is it because the |
|
@bobot The cmo format changed. This should probably not require bootstraping. The build without bootstrap is failing when building otherlibs which use the newly built compiler instead of the |
d779c0e to
b471012
Compare
|
Rebased to clean the history and make bisectable. |
b471012 to
88c2c8c
Compare
88c2c8c to
4dc2490
Compare
|
Rebased, there was some changes needed to merge with the recent location changes. @garrigue, @xavierleroy, any objection ? |
|
This looks ok to me. |
This also share the result type of transl_implementation_flambda and transl_store_implementation
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
|
I tried some complex cases and built some subset of opam. In fact opam testing does not convince me that much, I don't think that exercise this a lot. |
a8aa562 to
a1c4cba
Compare
|
Rebased |
Do not generate dummy code to force module linking
ce76e02 flambda-backend: Bugfix for type_application (ocaml#746) 44f3afb flambda-backend: PR580 for main branch (ocaml#743) b851eaa flambda-backend: Backport first part of ocaml/ocaml PR10498 (ocaml#737) fafb4bd flambda-backend: Fix return mode for eta-expanded function in type_argument (ocaml#735) c31f6c3 flambda-backend: Fix treatment of functions called [@nontail] (ocaml#725) 847781e flambda-backend: Fix build_upstream post-PR703 (ocaml#712) bfcbbf8 flambda-backend: Extend Pblock value kind to handle variants (ocaml#703) b2cab95 flambda-backend: Merge ocaml-jst a6d6e0e flambda-backend: Merge ocaml-jst 88a4f63 flambda-backend: Use Pmakearray for immutable arrays (ocaml#699) eeaa44b flambda-backend: Install an ocamldoc binary (ocaml#695) 48d322b flambda-backend: Ensure that GC is not invoked from bounds check failures (ocaml#681) 4370fa1 flambda-backend: Review changes of term directory (ocaml#602) 65a4566 flambda-backend: Add code coverage using bisect_ppx (ocaml#352) 63ab65f flambda-backend: Bugfix for primitive inclusion (ocaml#662) 7e3e0c8 flambda-backend: Fix inclusion checks for primitives (ocaml#661) 96c68f9 flambda-backend: Speed up linking by changing cmxa format (ocaml#607) 1829150 flambda-backend: Bugfix for Translmod.all_idents (ocaml#659) git-subtree-dir: ocaml git-subtree-split: ce76e02
To ensure that a module is linked if only C externals are used from its interface, there is some dummy code generated referencing its top-level module.
This avoids it by propagating separately the required modules and registering it when needed.
This generated code is problematic for some other ongoing development.