diff options
author | Martin Storsjo <martin@martin.st> | 2018-10-01 20:53:25 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-10-01 20:53:25 +0000 |
commit | f32a0fc80d3aad1f542866fdaa88cabb76802bab (patch) | |
tree | 2e8a037b1bae306f80c64b06b8e07281d31b65f1 /clang/lib/Driver/ToolChain.cpp | |
parent | c87e99f4a4d5d10c54b0277ea089ef06608328fd (diff) | |
download | llvm-f32a0fc80d3aad1f542866fdaa88cabb76802bab.zip llvm-f32a0fc80d3aad1f542866fdaa88cabb76802bab.tar.gz llvm-f32a0fc80d3aad1f542866fdaa88cabb76802bab.tar.bz2 |
[MinGW] Allow using ASan
Linking to ASan for MinGW is similar to MSVC, but MinGW always links
the MSVCRT dynamically, so there is only one of the MSVC cases to
consider.
When linking to a shared compiler runtime library on MinGW, the suffix
of the import library is .dll.a.
The existing case of .dll as suffix for windows in general doesn't
seem correct (since this is used for linking). As long as callers never
actually set the Shared flag, the default static suffix of .lib also
worked fine for import libraries as well.
Differential Revision: https://reviews.llvm.org/D52538
llvm-svn: 343537
Diffstat (limited to 'clang/lib/Driver/ToolChain.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChain.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 8933e90..f05c8a39 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -367,8 +367,10 @@ std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component, TT.isWindowsMSVCEnvironment() || TT.isWindowsItaniumEnvironment(); const char *Prefix = IsITANMSVCWindows ? "" : "lib"; - const char *Suffix = Shared ? (Triple.isOSWindows() ? ".dll" : ".so") + const char *Suffix = Shared ? (Triple.isOSWindows() ? ".lib" : ".so") : (IsITANMSVCWindows ? ".lib" : ".a"); + if (Shared && Triple.isWindowsGNUEnvironment()) + Suffix = ".dll.a"; for (const auto &LibPath : getLibraryPaths()) { SmallString<128> P(LibPath); |