Closed houseofsuns closed 1 year ago
Hi maybe you need to recompile without LTO all the toolchain (findlib, dune, maybe other)
Hi maybe you need to recompile without LTO all the toolchain (findlib, dune, maybe other)
gen_c_primitives
does some configuration tests via compiling sample code and inspecting the resulting binary for introspecting the used toolchain. LTO caused the introspection to fail as it optimized away the markers injected via the sample code.
I don't see what recompiling the toolchain will change about that.
Well, the context of my comment was "the compilation flags that are applied are probably coming from dune or findlib"
Well, the context of my comment was "the compilation flags that are applied are probably coming from dune or findlib"
Ah, that makes sense. However I would call this behavior a bug in those tools.
Looking at /usr/lib64/ocaml/Makefile.config it seems that all setting are stored in ocaml
Hm, I can no longer reproduce the problem. So closing I'm closing this issue for now.
On my Gentoo machine I saw the build fail to generate the file
src/ctypes/ctypes_primitives.ml
with the log at the bottom of this post.The fundamental issue was that LTO removed the information searched for by
gen_c_primitives
. I tried to disable LTO in the build environment (I confirmed this), but the build system must have some auto-magic lookup of the global system configuration which sneaked LTO back in.The following patch fixed the issue for me (it is sadly not portable I think).