[PATCH] D37710: [LLD] [MinGW] Pass the undecorated entry point name to the COFF linker

Martell Malone via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 05:57:33 PDT 2017


martell added a comment.

In https://reviews.llvm.org/D37710#867622, @mstorsjo wrote:

> In https://reviews.llvm.org/D37710#867043, @ruiu wrote:
>
> > Can't you link your program without line 131-133?
>
>
> And to answer this part of the question... Normally the clang frontend doesn't pass the `--entry` option at all, so for a normal executable, things work as they are. However, when linking DLLs, the clang frontend passes this option, and things currently fail (for i386 DLLs).
>
> To add to the confusion, the DLL entry point in MSVC is by default named `_DllMainCRTStartup` (which after i386 mangling ends up as `__DllMainCRTStartup at 12`. In MinGW (and as in the defaults in the clang MinGW frontend), the DLL entry point is named `DllMainCRTStartup` which on i386 ends up as `_DllMainCRTStartup at 12`.


Does gcc also pass the entry? If not then we should remove that from clang for consistency.
(Though that is unrelated to your point that --entry should work as it does on ld)


https://reviews.llvm.org/D37710





More information about the llvm-commits mailing list