This is an archive of the discontinued LLVM Phabricator instance.

[CodeGenCXX] do not default to dllimport storage for mingw-w64
ClosedPublic

Authored by martell on May 26 2017, 9:31 PM.

Details

Summary

GNU frontends don't have options like /MT, /MD etc so it makes little sense.
This fixes a few link error regressions with libc++ and libc++abi

Diff Detail

Repository
rL LLVM

Event Timeline

martell created this revision.May 26 2017, 9:31 PM
rnk edited edge metadata.Jun 20 2017, 2:58 PM

Saleem, didn't something change here two months ago? Why do we want to bother with all of this dllimport stuff in the frontend? It seems to break mingw and add complexity for very little gain (avoiding linker provided thunks).

Does this break things for current users of clang as a drop-in replacement for gcc in mingw setups, while using e.g. a gcc provided libstdc++-6.dll? OTOH, removing dllimport usually isn't too much of an issue - the calls go via thunks which is non-ideal and theoretically slower but not much of an issue in practice.

After trying to build a bit more code with clang and a static libcxx, I agree with this change, so +1 from me. @compnerd ?

compnerd accepted this revision.Nov 3 2017, 11:26 AM
This revision is now accepted and ready to land.Nov 3 2017, 11:26 AM
This revision was automatically updated to reflect the committed changes.