On Saturday 17 December 2022 15:22:11 Pali Rohár wrote: > Currently when linking target application with LTO builds of mingw-w64 > libraries, it is needed to manually specify entry point of mingw-w64 crt > startup function via linker flag -Wl,-e,_mainCRTStartup (for console > executables) or -Wl,-e,_WinMainCRTStartup (for GUI executables) or > -Wl,-e,_DllMainCRTStartup@12 (for DLL libraries). Otherwise LTO compiler > drops startup function generates output binary totally broken and > non-working (executable crashes during during startup). > > This looks like a bug in LTO compiler or GNU linker that it drops default > entry point because GNU linker has already hardcoded symbol names of > default entry points.
Bug reported to gcc bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109368 > GNU linker tries to reference also _pei386_runtime_relocator() function > when it generates pseudo-reloc data and complains if LTO compiler drops it. And this one also reported: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109369 _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
