On Fri, 4 Aug 2017, Ruben Van Boxem wrote:

Op 3 aug. 2017 9:26 p.m. schreef "Martell Malone" <martellmal...@gmail.com>:

I for one would like to be able to use one crt with both Clang and GCC. No
use in duplicating 99% of the code for that one little bit of startup code
that needs to be different. Perhaps ldd or Clang needs to be taught to link
a different startup object, but that should be trivial to accomplish!

Being able to use the same build of mingw with either compiler (or more practically, linker) would be ideal yeah. In addition to the constructor handling, there's also the issue that lld fails to link to import libraries created by GNU dlltool.


Initial brain dump of what I've discovered on the matter so far:

MSVC link.exe also used to fail linking to such import libraries (with slightly different symptoms), prior to MSVC 2012 where it started working. (Not sure if this was an intentional fix from their side or not.)

With link.exe, the output binary does link to the DLL, but doesn't actually import the functions. With lld, the output binary doesn't actually end up linking to the DLL at all, iirc.

In lld, in LinkerDriver::addArchiveBuffer, the "proper" import libraries (from the windows SDK, and the ones produced by llvm-dlltool) get identified as coff_import_library and get treated differently, while the GNU dlltool ones just are treated as any normal static library-.


// Martin

------------------------------------------------------------------------------
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

Reply via email to