mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 22:30:13 +00:00
Revert "[Driver][Windows] Support per-target runtimes dir layout for profile instr generate"
This reverts commit 7f9d5d6e44
.
Breaks check-clang everywhere, see https://reviews.llvm.org/D96638#2583608
This commit is contained in:
parent
3c4cdd0b6a
commit
ab5b00ada9
@ -434,7 +434,8 @@ public:
|
||||
|
||||
virtual std::string
|
||||
getCompilerRTBasename(const llvm::opt::ArgList &Args, StringRef Component,
|
||||
FileType Type = ToolChain::FT_Static) const;
|
||||
FileType Type = ToolChain::FT_Static,
|
||||
bool AddArch = true) const;
|
||||
|
||||
// Returns target specific runtime path if it exists.
|
||||
virtual Optional<std::string> getRuntimePath() const;
|
||||
|
@ -413,12 +413,10 @@ std::string ToolChain::getCompilerRTPath() const {
|
||||
return std::string(Path.str());
|
||||
}
|
||||
|
||||
static std::string buildCompilerRTBasename(const ToolChain &toolchain,
|
||||
const ArgList &Args,
|
||||
StringRef Component,
|
||||
ToolChain::FileType Type,
|
||||
bool AddArch) {
|
||||
const llvm::Triple &TT = toolchain.getTriple();
|
||||
std::string ToolChain::getCompilerRTBasename(const ArgList &Args,
|
||||
StringRef Component, FileType Type,
|
||||
bool AddArch) const {
|
||||
const llvm::Triple &TT = getTriple();
|
||||
bool IsITANMSVCWindows =
|
||||
TT.isWindowsMSVCEnvironment() || TT.isWindowsItaniumEnvironment();
|
||||
|
||||
@ -433,33 +431,26 @@ static std::string buildCompilerRTBasename(const ToolChain &toolchain,
|
||||
Suffix = IsITANMSVCWindows ? ".lib" : ".a";
|
||||
break;
|
||||
case ToolChain::FT_Shared:
|
||||
Suffix = TT.isOSWindows()
|
||||
? (TT.isWindowsGNUEnvironment() ? ".dll.a" : ".lib")
|
||||
Suffix = Triple.isOSWindows()
|
||||
? (Triple.isWindowsGNUEnvironment() ? ".dll.a" : ".lib")
|
||||
: ".so";
|
||||
break;
|
||||
}
|
||||
|
||||
std::string ArchAndEnv;
|
||||
if (AddArch) {
|
||||
StringRef Arch = getArchNameForCompilerRTLib(toolchain, Args);
|
||||
StringRef Arch = getArchNameForCompilerRTLib(*this, Args);
|
||||
const char *Env = TT.isAndroid() ? "-android" : "";
|
||||
ArchAndEnv = ("-" + Arch + Env).str();
|
||||
}
|
||||
return (Prefix + Twine("clang_rt.") + Component + ArchAndEnv + Suffix).str();
|
||||
}
|
||||
|
||||
std::string ToolChain::getCompilerRTBasename(const ArgList &Args,
|
||||
StringRef Component,
|
||||
FileType Type) const {
|
||||
std::string absolutePath = getCompilerRT(Args, Component, Type);
|
||||
return llvm::sys::path::filename(absolutePath).str();
|
||||
}
|
||||
|
||||
std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
|
||||
FileType Type) const {
|
||||
// Check for runtime files in the new layout without the architecture first.
|
||||
std::string CRTBasename =
|
||||
buildCompilerRTBasename(*this, Args, Component, Type, /*AddArch=*/false);
|
||||
getCompilerRTBasename(Args, Component, Type, /*AddArch=*/false);
|
||||
for (const auto &LibPath : getLibraryPaths()) {
|
||||
SmallString<128> P(LibPath);
|
||||
llvm::sys::path::append(P, CRTBasename);
|
||||
@ -469,8 +460,7 @@ std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
|
||||
|
||||
// Fall back to the old expected compiler-rt name if the new one does not
|
||||
// exist.
|
||||
CRTBasename =
|
||||
buildCompilerRTBasename(*this, Args, Component, Type, /*AddArch=*/true);
|
||||
CRTBasename = getCompilerRTBasename(Args, Component, Type, /*AddArch=*/true);
|
||||
SmallString<128> Path(getCompilerRTPath());
|
||||
llvm::sys::path::append(Path, CRTBasename);
|
||||
return std::string(Path.str());
|
||||
|
@ -161,7 +161,7 @@ Tool *BareMetal::buildLinker() const {
|
||||
std::string BareMetal::getCompilerRTPath() const { return getRuntimesDir(); }
|
||||
|
||||
std::string BareMetal::getCompilerRTBasename(const llvm::opt::ArgList &,
|
||||
StringRef, FileType) const {
|
||||
StringRef, FileType, bool) const {
|
||||
return ("libclang_rt.builtins-" + getTriple().getArchName() + ".a").str();
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,8 @@ public:
|
||||
std::string getCompilerRTPath() const override;
|
||||
std::string getCompilerRTBasename(const llvm::opt::ArgList &Args,
|
||||
StringRef Component,
|
||||
FileType Type = ToolChain::FT_Static) const override;
|
||||
FileType Type = ToolChain::FT_Static,
|
||||
bool AddArch = true) const override;
|
||||
|
||||
RuntimeLibType GetDefaultRuntimeLibType() const override {
|
||||
return ToolChain::RLT_CompilerRT;
|
||||
|
@ -58,11 +58,11 @@
|
||||
|
||||
// RUN: %clang_cl -### /FA -fprofile-instr-generate -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-INSTR-GENERATE %s
|
||||
// RUN: %clang_cl -### /FA -fprofile-instr-generate=/tmp/somefile.profraw -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-INSTR-GENERATE-FILE %s
|
||||
// CHECK-PROFILE-INSTR-GENERATE: "-fprofile-instrument=clang" "--dependent-lib=clang_rt.profile{{[^"]*}}.lib"
|
||||
// CHECK-PROFILE-INSTR-GENERATE: "-fprofile-instrument=clang" "--dependent-lib=clang_rt.profile-{{[^"]*}}.lib"
|
||||
// CHECK-PROFILE-INSTR-GENERATE-FILE: "-fprofile-instrument-path=/tmp/somefile.profraw"
|
||||
|
||||
// RUN: %clang_cl -### /FA -fprofile-generate -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s
|
||||
// CHECK-PROFILE-GENERATE: "-fprofile-instrument=llvm" "--dependent-lib=clang_rt.profile{{[^"]*}}.lib"
|
||||
// CHECK-PROFILE-GENERATE: "-fprofile-instrument=llvm" "--dependent-lib=clang_rt.profile-{{[^"]*}}.lib"
|
||||
|
||||
// RUN: %clang_cl -### /FA -fprofile-instr-generate -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
|
||||
// RUN: %clang_cl -### /FA -fprofile-instr-generate -fprofile-instr-use=file -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
|
||||
|
@ -20,17 +20,17 @@
|
||||
// RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-UNDEFINED-WIN64,CHECK-UNDEFINED-MSVC
|
||||
// RUN: %clang -target x86_64-w64-mingw32 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN64-MINGW
|
||||
// RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined -x c++ %s -### 2>&1 | FileCheck %s --check-prefixes=CHECK-UNDEFINED-WIN64,CHECK-UNDEFINED-WIN-CXX,CHECK-UNDEFINED-MSVC
|
||||
// CHECK-UNDEFINED-WIN32: "--dependent-lib={{[^"]*}}ubsan_standalone{{(-i386)?}}.lib"
|
||||
// CHECK-UNDEFINED-WIN64: "--dependent-lib={{[^"]*}}ubsan_standalone{{(-x86_64)?}}.lib"
|
||||
// CHECK-UNDEFINED-WIN64-MINGW: "--dependent-lib={{[^"]*}}libclang_rt.ubsan_standalone{{(-x86_64)?}}.a"
|
||||
// CHECK-UNDEFINED-WIN32: "--dependent-lib={{[^"]*}}ubsan_standalone-i386.lib"
|
||||
// CHECK-UNDEFINED-WIN64: "--dependent-lib={{[^"]*}}ubsan_standalone-x86_64.lib"
|
||||
// CHECK-UNDEFINED-WIN64-MINGW: "--dependent-lib={{[^"]*}}libclang_rt.ubsan_standalone-x86_64.a"
|
||||
// CHECK-UNDEFINED-WIN-CXX: "--dependent-lib={{[^"]*}}ubsan_standalone_cxx{{[^"]*}}.lib"
|
||||
// CHECK-UNDEFINED-MSVC-SAME: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute),?){17}"}}
|
||||
// CHECK-UNDEFINED-WIN64-MINGW-SAME: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute|vptr),?){18}"}}
|
||||
|
||||
// RUN: %clang -target i386-pc-win32 -fsanitize-coverage=bb %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-COVERAGE-WIN32
|
||||
// CHECK-COVERAGE-WIN32: "--dependent-lib={{[^"]*}}ubsan_standalone{{(-i386)?}}.lib"
|
||||
// CHECK-COVERAGE-WIN32: "--dependent-lib={{[^"]*}}ubsan_standalone-i386.lib"
|
||||
// RUN: %clang -target x86_64-pc-win32 -fsanitize-coverage=bb %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-COVERAGE-WIN64
|
||||
// CHECK-COVERAGE-WIN64: "--dependent-lib={{[^"]*}}ubsan_standalone{{(-x86_64)?}}.lib"
|
||||
// CHECK-COVERAGE-WIN64: "--dependent-lib={{[^"]*}}ubsan_standalone-x86_64.lib"
|
||||
|
||||
// RUN: %clang -target %itanium_abi_triple -fsanitize=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER -implicit-check-not="-fsanitize-address-use-after-scope"
|
||||
// CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent|implicit-unsigned-integer-truncation|implicit-signed-integer-truncation|implicit-integer-sign-change|unsigned-shift-base),?){9}"}}
|
||||
|
@ -112,7 +112,7 @@
|
||||
// RUN: | FileCheck --check-prefix=CHECK-WINDOWS-I386 %s
|
||||
//
|
||||
// CHECK-WINDOWS-I386: "{{.*}}link{{(.exe)?}}"
|
||||
// CHECK-WINDOWS-I386: "{{.*}}clang_rt.profile{{(-i386)?}}.lib"
|
||||
// CHECK-WINDOWS-I386: "{{.*}}clang_rt.profile-i386.lib"
|
||||
//
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
|
||||
// RUN: -target x86_64-pc-win32 -fprofile-instr-generate \
|
||||
@ -120,7 +120,7 @@
|
||||
// RUN: | FileCheck --check-prefix=CHECK-WINDOWS-X86-64 %s
|
||||
//
|
||||
// CHECK-WINDOWS-X86-64: "{{.*}}link{{(.exe)?}}"
|
||||
// CHECK-WINDOWS-X86-64: "{{.*}}clang_rt.profile{{(-x86_64)?}}.lib"
|
||||
// CHECK-WINDOWS-X86-64: "{{.*}}clang_rt.profile-x86_64.lib"
|
||||
//
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
|
||||
// RUN: -target x86_64-mingw32 -fprofile-instr-generate -fuse-ld=ld \
|
||||
@ -136,7 +136,7 @@
|
||||
// RUN: -fprofile-instr-generate 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-WINDOWS-X86-64-DEPENDENT-LIB %s
|
||||
//
|
||||
// CHECK-WINDOWS-X86-64-DEPENDENT-LIB: "--dependent-lib={{[^"]*}}clang_rt.profile{{[^"]*}}.lib"
|
||||
// CHECK-WINDOWS-X86-64-DEPENDENT-LIB: "--dependent-lib={{[^"]*}}clang_rt.profile-{{[^"]*}}.lib"
|
||||
//
|
||||
// RUN: %clang %s -### -o %t.o -target x86_64-mingw32 \
|
||||
// RUN: -fprofile-instr-generate 2>&1 \
|
||||
|
@ -666,16 +666,16 @@
|
||||
// RUN: -target x86_64-pc-windows \
|
||||
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-CFI-STATS-WIN64 %s
|
||||
// CHECK-CFI-STATS-WIN64: "--dependent-lib=clang_rt.stats_client{{(-x86_64)?}}.lib"
|
||||
// CHECK-CFI-STATS-WIN64: "--dependent-lib=clang_rt.stats{{(-x86_64)?}}.lib"
|
||||
// CHECK-CFI-STATS-WIN64: "--dependent-lib=clang_rt.stats_client-x86_64.lib"
|
||||
// CHECK-CFI-STATS-WIN64: "--dependent-lib=clang_rt.stats-x86_64.lib"
|
||||
// CHECK-CFI-STATS-WIN64: "--linker-option=/include:__sanitizer_stats_register"
|
||||
|
||||
// RUN: %clang -fsanitize=cfi -fsanitize-stats %s -### -o %t.o 2>&1 \
|
||||
// RUN: -target i686-pc-windows \
|
||||
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-CFI-STATS-WIN32 %s
|
||||
// CHECK-CFI-STATS-WIN32: "--dependent-lib=clang_rt.stats_client{{(-i386)?}}.lib"
|
||||
// CHECK-CFI-STATS-WIN32: "--dependent-lib=clang_rt.stats{{(-i386)?}}.lib"
|
||||
// CHECK-CFI-STATS-WIN32: "--dependent-lib=clang_rt.stats_client-i386.lib"
|
||||
// CHECK-CFI-STATS-WIN32: "--dependent-lib=clang_rt.stats-i386.lib"
|
||||
// CHECK-CFI-STATS-WIN32: "--linker-option=/include:___sanitizer_stats_register"
|
||||
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
|
||||
|
Loading…
Reference in New Issue
Block a user