[llvm-bugs] [Bug 36523] New: /SUBSYSTEM not taken into account for automatic /ENTRY detection

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 26 12:02:32 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36523

            Bug ID: 36523
           Summary: /SUBSYSTEM not taken into account for automatic /ENTRY
                    detection
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: alexandre.ganea at ubisoft.com
                CC: llvm-bugs at lists.llvm.org

We have a case where both "main" and "WinMain" are defined in different .libs
being linked in. We also provide /SUBSYSTEM:WINDOWS on the command-line.

As per spec
(https://docs.microsoft.com/en-us/cpp/build/reference/subsystem-specify-subsystem)
specifying /SUBSYSTEM:CONSOLE shall select "main" or "wmain"; and specifying
/SUBSYSTEM:WINDOWS shall select "WinMain" or "wWinMain", whichever is present.

Given the list in lld\COFF\Driver.cpp, LinkerDriver::findDefaultEntry(),
Config->Subsystem is not taken account, which leads to "main" being selected.
For this exact same case, link.exe selects "WinMain", which follows the
/SUBSYSTEM selector.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180226/9155c47b/attachment.html>


More information about the llvm-bugs mailing list