Skip to content

Commit 8bac3e2

Browse files
committed
[Driver] Restore arch suffix for PS and Windows
Commit b876596 corrected default compiler-rt library names for many targets, this patch restores the arch suffix for PlayStation and Windows which both distribute these libraries with the arch suffix.
1 parent d11afe1 commit 8bac3e2

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,9 @@ std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
684684
if (Path.empty())
685685
Path = P;
686686
}
687-
if (getTriple().isOSAIX())
687+
// Some targets default to the old layout.
688+
if (getTriple().isOSAIX() || getTriple().isPS() ||
689+
getTriple().isWindowsMSVCEnvironment())
688690
Path.clear();
689691

690692
// Check the filename for the old layout if the new one does not exist.

clang/test/Driver/cl-link.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313
// ASAN: link.exe
1414
// ASAN: "-debug"
1515
// ASAN: "-incremental:no"
16-
// ASAN: "{{[^"]*}}clang_rt.asan.lib"
17-
// ASAN: "-wholearchive:{{.*}}clang_rt.asan.lib"
18-
// ASAN: "{{[^"]*}}clang_rt.asan_cxx.lib"
19-
// ASAN: "-wholearchive:{{.*}}clang_rt.asan_cxx.lib"
16+
// ASAN: "{{[^"]*}}clang_rt.asan-i386.lib"
17+
// ASAN: "-wholearchive:{{.*}}clang_rt.asan-i386.lib"
18+
// ASAN: "{{[^"]*}}clang_rt.asan_cxx-i386.lib"
19+
// ASAN: "-wholearchive:{{.*}}clang_rt.asan_cxx-i386.lib"
2020
// ASAN: "{{.*}}cl-link{{.*}}.obj"
2121

2222
// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-win32 /MD /Tc%s -fuse-ld=link -### -fsanitize=address 2>&1 | FileCheck --check-prefix=ASAN-MD %s
2323
// ASAN-MD: link.exe
2424
// ASAN-MD: "-debug"
2525
// ASAN-MD: "-incremental:no"
26-
// ASAN-MD: "{{.*}}clang_rt.asan_dynamic.lib"
27-
// ASAN-MD: "{{[^"]*}}clang_rt.asan_dynamic_runtime_thunk.lib"
26+
// ASAN-MD: "{{.*}}clang_rt.asan_dynamic-i386.lib"
27+
// ASAN-MD: "{{[^"]*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib"
2828
// ASAN-MD: "-include:___asan_seh_interceptor"
29-
// ASAN-MD: "-wholearchive:{{.*}}clang_rt.asan_dynamic_runtime_thunk.lib"
29+
// ASAN-MD: "-wholearchive:{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib"
3030
// ASAN-MD: "{{.*}}cl-link{{.*}}.obj"
3131

3232
// RUN: %clang_cl /LD -fuse-ld=link -### /Tc%s 2>&1 | FileCheck --check-prefix=DLL %s
@@ -40,7 +40,7 @@
4040
// ASAN-DLL: "-dll"
4141
// ASAN-DLL: "-debug"
4242
// ASAN-DLL: "-incremental:no"
43-
// ASAN-DLL: "{{.*}}clang_rt.asan_dll_thunk.lib"
43+
// ASAN-DLL: "{{.*}}clang_rt.asan_dll_thunk-i386.lib"
4444
// ASAN-DLL: "{{.*}}cl-link{{.*}}.obj"
4545

4646
// RUN: %clang_cl /Zi /Tc%s -fuse-ld=link -### 2>&1 | FileCheck --check-prefix=DEBUG %s

0 commit comments

Comments
 (0)