forked from OSchip/llvm-project
[Clang] Avoid using unwind library in the MSVC environment
We're seeing the following warnings with --rtlib=compiler-rt: lld-link: warning: ignoring unknown argument '--as-needed' lld-link: warning: ignoring unknown argument '-lunwind' lld-link: warning: ignoring unknown argument '--no-as-needed' MSVC doesn't use the unwind library, so just omit it. Differential Revision: https://reviews.llvm.org/D132440
This commit is contained in:
parent
df4e637ca7
commit
eca29d4a37
|
@ -1529,7 +1529,7 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D,
|
|||
// Targets that don't use unwind libraries.
|
||||
if ((TC.getTriple().isAndroid() && UNW == ToolChain::UNW_Libgcc) ||
|
||||
TC.getTriple().isOSIAMCU() || TC.getTriple().isOSBinFormatWasm() ||
|
||||
UNW == ToolChain::UNW_None)
|
||||
TC.getTriple().isWindowsMSVCEnvironment() || UNW == ToolChain::UNW_None)
|
||||
return;
|
||||
|
||||
LibGccType LGT = getLibGccType(TC, D, Args);
|
||||
|
|
|
@ -88,6 +88,12 @@
|
|||
// RTLIB-GCC-UNWINDLIB-COMPILER_RT: "{{[.|\\\n]*}}--rtlib=libgcc requires --unwindlib=libgcc"
|
||||
//
|
||||
// RUN: %clang -### %s 2>&1 \
|
||||
// RUN: --target=x86_64-pc-windows-msvc -rtlib=compiler-rt --unwindlib=libunwind \
|
||||
// RUN: | FileCheck --check-prefix=MSVC-RTLIB-COMPILER-RT-UNWINDLIB-COMPILER-RT %s
|
||||
// MSVC-RTLIB-COMPILER-RT-UNWINDLIB-COMPILER-RT: "{{.*}}clang_rt.builtins-x86_64.lib"
|
||||
// MSVC-RTLIB-COMPILER-RT-UNWINDLIB-COMPILER-RT-NOT: "{{.*}}unwind.lib"
|
||||
//
|
||||
// RUN: %clang -### %s 2>&1 \
|
||||
// RUN: --target=x86_64-w64-mingw32 -rtlib=compiler-rt --unwindlib=libunwind \
|
||||
// RUN: -shared-libgcc \
|
||||
// RUN: --gcc-toolchain="" \
|
||||
|
|
Loading…
Reference in New Issue