[llvm-bugs] [Bug 38972] New: lld-link should have a better diag on missing main / WinMain, probably by defaulting to the subsystem-specific entry point even if main isn't there

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 16 12:29:21 PDT 2018


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

            Bug ID: 38972
           Summary: lld-link should have a better diag on missing main /
                    WinMain, probably by defaulting to the
                    subsystem-specific entry point even if main isn't
                    there
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org

If main is missing in link.exe, it prints:

FAILED: test_process.exe test_process.exe.pdb 
cmd /c C:/b/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe
../../build/toolchain/win/tool_wrapper.py delete-file ./test_process.exe.pdb &&
C:/b/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe
../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x86 False
link.exe /nologo /OUT:./test_process.exe /PDB:./test_process.exe.pdb
@./test_process.exe.rsp
libcmt.lib(exe_main.obj) : error LNK2019: unresolved external symbol _main
referenced in function "int __cdecl __scrt_common_main_seh(void)"
(?__scrt_common_main_seh@@YAHXZ)


lld-link prints:

FAILED: test_process.exe test_process.exe.pdb 
ninja -t msvc -e environment.x86 --
../../third_party/llvm-build/Release+Asserts/bin/lld-link.exe /nologo
/OUT:./test_process.exe /PDB:./test_process.exe.pdb @./test_process.exe.rsp
lld-link: error: entry point must be defined


"entry point" is less understandable than "missing _main" for most developers;
lld-link should have a better diag.

-- 
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/20180916/68165cb0/attachment.html>


More information about the llvm-bugs mailing list