在 2018/8/27 20:21, Martin Storsjö 写道: > Yes, unless we come up with something better, soon. Feel free to revert, > but please amend the commit message to clarify that there are two > different implementations of the __main function; the one we have worked > fine but the libgcc one didn't handle our special situation. >
Confirmed reverting this commit fixed the crash on GCC 8.2.1. Pushed. > I had an idea to try to move the defintion of these symbols from > crtexe.c/crtdll.c into gccmain.c, but that makes them turn up too late > in the link, after constructors from some object files, so that doesn't > really work. > > If we revert this, my next alternative towards unifying this handling > across binutils and lld, would be to first make mingw-w64 check for > these symbols during the build so we can make the previous ifdefs a bit > more flexible (not having to check for #ifdef __clang__, which the > compiler doesn't say what linker one was going to use) - I have a pretty > much ready patch for this already. Then secondly, we could make lld > provide the symbols, to make things with gcc+binutils behave the same as > with clang+lld, making the CRT object files compatible across both > linkers at the same time. > The current (before the original commit and after the revert commit) approach results in distinct, incompatible object files for GCC and Clang, because some symbols are defined in ones for GCC but not in ones for Clang and vice versa. Making them compatible seems an optimal solution to me. > // Martin > > > -- Best regards, LH_Mouse ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public