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, |
ocamlmklibsupports some but not all linker flags. we have someLDFLAGSthat are not supported byocamlmklib, so they need to be passed via-ldopt. this PR prepends-ldoptto each word inLIBS(which is set toLDFLAGSin ./configure).