ocaml / ocaml/flexdll

Option -custom-crt should not add MSVC linker option /nodefaultlib:LIBCMT

Open
#51 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
OCaml
Stars
115
Forks
34
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open reloc.ml at lines 1005-1006 and inspect how -custom-crt constructs the MSVC linker arguments. Confirm that the change removes only the LIBCMT exclusion while retaining the MSVCRT exclusion, then verify the resulting linker command for both custom and default CRT modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system, tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.