[lld] [LLD] [MinGW] Interpret an empty -entry option as no entry point (PR #96055)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 04:42:11 PDT 2024


mstorsjo wrote:

> > Also treat a missing -entry argument as no entry point; this also is what GNU ld does in this case.
> 
> Not sure if this is necessary or correct. Wouldn't this break the default entry points (e.g. `WinMainCRTStartup`/`mainCRTStartup`)?

There's indeed no strict need for this part of the change, I just chose to include it for completeness (as I remember noticing this behaviour in GNU ld before). And yes, you're right that it would change the behaviour of default entry points.

However the default entry point behaviour never really comes into play in mingw configurations; as long as you drive the linking via GCC/Clang, it always passes one `-e` option or another, so it practically never will hit that case anyway. (And that choice depends on whether you're passing `-municode` when linking.) So practically, the case only matters if you're invoking `ld.lld` directly.

If you feel it's nice to keep the lld style autodetection here, we could of course do that, but practically it makes not much difference either way.

https://github.com/llvm/llvm-project/pull/96055


More information about the llvm-commits mailing list