[Issue 23110] New: src/dmd/link.d tries to use MSVC linker on Windows when MinGW is used

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 15 07:50:01 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23110

          Issue ID: 23110
           Summary: src/dmd/link.d tries to use MSVC linker on Windows
                    when MinGW is used
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: brecht at sanders.org

In `src/dmd/link.d` the section `version (Windows)` assumes MSVC is used,
causing the `link` to be used when building MinGW-w64. When doing this in MSYS2
shell it will call the `link` command, which makes file links (part of GNU
coreutils).

The `version (Posix)` won't work for MinGW-w64 since it uses pipes and forks to
run the linker, which won't work on Windows.

So I think a `version (MinGW)` is needed (before `version (Windows)` since that
will match too) that uses GCC linking, called in a Windows way (`executecmd()`)
and with the right flags for MinGW (which is probably (mostly) the same as
Posix.

--


More information about the Digitalmars-d-bugs mailing list