-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pass LDFLAGS to ocamlmklib via -ldopt #124
Conversation
`ocamlmklib` supports some but not all linker flags. we have some `LDFLAGS` that are not supported by `ocamlmklib`, so they need to be passed via `-ldopt`. this PR prepends `-ldopt` to each word in `LIBS` (which is set to `LDFLAGS` in ./configure).
specifically, our LDFLAGS cause errors like this:
|
Thanks for the tentative fix. Two remarks:
|
indeed, that works. thanks! |
I noticed a regression after merging : Also #73 might render these changes moot anyway, if we switch to dune. If you have time, could you tell me whether you can build zarith using dune with #73 ? |
It is prudent to not use |
Well, currently we have:
Would that be adequate, or do we need something different /more sophisticated? |
I think it's good. At least, nothing wrong can happen when |
I was too optimistic. It looks like |
Here is the problem. ocamlmklib passes -ldopt xxx options to the linker when building dllzarith.so, the shared object that is used by bytecode executables. However, for native code, a static archive libzarith.a is built, which is then statically linked by ocamlopt every time the ZArith library is used. This can be viewed as a bug in ocamlmklib. But while it is there, |
ocamlmklib
supports some but not all linker flags. we have someLDFLAGS
that are not supported byocamlmklib
, so they need to be passed via-ldopt
. this PR prepends-ldopt
to each word inLIBS
(which is set toLDFLAGS
in ./configure).