mirror of
https://codeberg.org/kiss-community/repo
synced 2024-08-20 05:06:58 +00:00
111 lines
5.4 KiB
Diff
111 lines
5.4 KiB
Diff
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
|
|
index e5e1b1d..7ee093f 100644
|
|
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
|
|
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
|
|
@@ -2538,8 +2538,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|
"powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
|
|
static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
|
|
static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
|
|
- "powerpcle-unknown-linux-gnu",
|
|
- "powerpcle-linux-musl"};
|
|
+ "powerpcle-unknown-linux-gnu"};
|
|
|
|
static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
|
|
static const char *const PPC64Triples[] = {
|
|
@@ -2616,6 +2615,95 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|
return;
|
|
}
|
|
|
|
+ if (TargetTriple.isMusl()) {
|
|
+ static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
|
|
+ static const char *const ARMHFMuslTriples[] = {
|
|
+ "arm-linux-musleabihf", "armv7l-linux-musleabihf"
|
|
+ };
|
|
+ static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
|
|
+ static const char *const X86_64MuslTriples[] = {
|
|
+ "x86_64-linux-musl",
|
|
+ "x86_64-pc-linux-musl", "x86_64-unknown-linux-musl"
|
|
+ };
|
|
+ static const char *const X86MuslTriples[] = {"i686-linux-musl"};
|
|
+ static const char *const MIPSMuslTriples[] = {
|
|
+ "mips-linux-musl", "mipsel-linux-musl",
|
|
+ "mipsel-linux-muslhf", "mips-linux-muslhf"
|
|
+ };
|
|
+ static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
|
|
+ static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
|
|
+ static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
|
|
+ static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
|
|
+ static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
|
|
+
|
|
+ switch (TargetTriple.getArch()) {
|
|
+ case llvm::Triple::aarch64:
|
|
+ LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
|
|
+ TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
|
|
+ BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
|
|
+ BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
|
|
+ break;
|
|
+ case llvm::Triple::arm:
|
|
+ LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
|
|
+ if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
|
|
+ TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
|
|
+ } else {
|
|
+ TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
|
|
+ }
|
|
+ break;
|
|
+ case llvm::Triple::x86_64:
|
|
+ LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
|
|
+ TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
|
|
+ BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
|
|
+ BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
|
|
+ break;
|
|
+ case llvm::Triple::x86:
|
|
+ LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
|
|
+ TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
|
|
+ BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
|
|
+ BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
|
|
+ break;
|
|
+ case llvm::Triple::mips:
|
|
+ LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
|
|
+ TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
|
|
+ break;
|
|
+ case llvm::Triple::ppc:
|
|
+ LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
|
|
+ TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
|
|
+ BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
|
|
+ BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
|
|
+ break;
|
|
+ case llvm::Triple::ppcle:
|
|
+ LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
|
|
+ TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
|
|
+ BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
|
|
+ BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
|
|
+ break;
|
|
+ case llvm::Triple::ppc64:
|
|
+ LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
|
|
+ TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
|
|
+ BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
|
|
+ BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
|
|
+ break;
|
|
+ case llvm::Triple::ppc64le:
|
|
+ LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
|
|
+ TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
|
|
+ BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
|
|
+ BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
|
|
+ break;
|
|
+ case llvm::Triple::riscv64:
|
|
+ LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
|
|
+ TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
|
|
+ break;
|
|
+ default:
|
|
+ break;
|
|
+ }
|
|
+ TripleAliases.push_back(TargetTriple.str());
|
|
+ if (TargetTriple.str() != BiarchTriple.str())
|
|
+ BiarchTripleAliases.push_back(BiarchTriple.str());
|
|
+ return;
|
|
+ }
|
|
+
|
|
// Android targets should not use GNU/Linux tools or libraries.
|
|
if (TargetTriple.isAndroid()) {
|
|
static const char *const AArch64AndroidTriples[] = {
|