-
Notifications
You must be signed in to change notification settings - Fork 31
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
Option -custom-crt should not add MSVC linker option /nodefaultlib:LIBCMT #51
Comments
Can I ask what your use-case is here? (welcome to GitHub, by the way!) @alainfrisch - why was As it happens, I think the fix should possibly go further and not specify either |
Hello We would like to use LIBCMT and not MSVCRT in an OCaml application. It is fine if FlexDLL option '-custom-crt' just avoids adding 'msvcrt.lib' and does nothing more. Thanks |
Yes, my memory is at least as bad as yours. I think -custom-crt was an experiment to allow linking with libcmt, but I never really managed to make it work full scale. @ccuchet After the suggested fix (or the "going further" variant), are you indeed able to link your OCaml application with libcmt? You probably need to recompile at least the OCaml runtime system, no? |
Yes we compile the OCaml runtime with option /MT |
@ccuchet - thanks for the info! That's pretty that that still works. Did you completely disable native code dynamic linking in your build of OCaml, or are you just not using it? Would you be willing to create a pull request with the change (if not, Alain or I can do so)? |
We just do not use dynamic linking. Can you please do the pull request for me, because I am new with Github and do not want to make mistakes :-) Thanks |
When one wants to use LIBCMT.lib in place of default CRT library MSVCRT.lib, it is not possible with FlexDLL v0.35, because option -custom-crt prevents both to use MSVCRT.lib and LIBCMT.lib.
It should only disable usage of MSVCRT.lib.
See reloc.ml lines 1005-1006:
if !custom_crt then "/nodefaultlib:LIBCMT /nodefaultlib:MSVCRT " ^ extra_args
else "msvcrt.lib " ^ extra_args
should be:
if !custom_crt then "/nodefaultlib:MSVCRT " ^ extra_args
else "msvcrt.lib " ^ extra_args
Thanks
The text was updated successfully, but these errors were encountered: