-
Notifications
You must be signed in to change notification settings - Fork 95
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
-Wl,--no-as-needed support for Foreign #49
Comments
Ah, that's a shame. It'd be nice to have some equivalent of Common Lisp's &allow-other-keys in command-line tools. Embedding the directive with |
It turns out that embedding
then the flags embedded in
In the case of |
Is this link order defined in the OCaml manual, or is it simply the result of an unfortunately missing List.rev somewhere in the linker code? Reversing the flags deliberately seems like an odd decision...but changing the behaviour now by default will probably break existing code. -anil On 10 Sep 2013, at 13:15, yallop notifications@github.com wrote:
|
I don't see anything explicit in the manual about the order in which things are passed to the platform linker. Still, it's probably essential that both objects and linker options are passed in the reverse order to that specified on the ocamlopt command-line. With ocamlopt dependencies are leaf-last, and with gcc/ld they're leaf first, and order is significant for both objects and various options ( |
Ahh yes, I'd missed the inversion of dependency order between the two tools. That makes sense. |
Another possibility is to build an executable that can be run during configuration/compilation of a library that uses ctypes to determine the link flags. WxWidgets (for example) comes with such a program:
It's not as neat as embedding the flags in |
Some investigation reveals that there is no one combination that works out-of-the-box, since:
--no-as-needed
is required on Ubuntu >=11.10--no-as-needed
is no longer recognized in MacOS X since >= Lion.So a configure-time flag is mandatory. I'm wondering if embedding this directive in foreign.cma (via -cclib at configure-time) makes sense? The assumption is that every consumer of foreign.cma will need to force linking, so including the correct compiler option in Ctypes.Foreign makes sense.
I can cook up a patch if you think this sounds right...
(PS: also noticed that twitter/hadoop-lzo#34 has the same bug for their software)
The text was updated successfully, but these errors were encountered: