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
Fix MSVC support for stub DLLs #119
Comments
Would it worked if jbuilder wrapped all options in |
Technically, I'm not sure whether |
I looked a bit more into this, wrapping all options with @dra27 can you check that it does fixes the issue? |
JBuilder issue: it just needs the ###### filled in
On mingw, and other Unix-like compiler toolchains, shared libraries are linked with
-lfoo
searching for libfoo.a. For the Microsoft toolchain, this convention doesn't apply. So for mingw I have:and for MSVC I translate this to:
However, jbuilder passes those libraries in the wrong way to various subcommands resulting in this output:
The warning is innocuous, but irritating. I think the correct way is to pass this option to ocamlmklib using -ldopt (I think it's OK that it's then only used to create the .dll and not also embedded in the .cma/.cmxa because I think that flexlink already deals with that further down the line). However, -ldopt can't be used in
c_library_flags
because it will also be passed to ocamlopt which will interpret it as requiring libdopt!I think that ocamlmklib should handle this difference itself (see ocaml/ocaml#1189), but even if ocamlmklib is changed in 4.06, jbuilder will need to handle older versions so I think some kind of support is needed here. My preference would be for jbuilder to recognise -lfoo and automatically translate it when passing it to tools on an msvc port (possibly except if libfoo.lib actually exists, but I think this will be quite rare). See also ocaml/flexdll#32
The text was updated successfully, but these errors were encountered: