Skip to content

Commit 6c404d2

Browse files
committed
clang/llvm: Add OE specific ABI triple for N32 ABI
Its gnun32 when using OE Upstream-Status: Inappropriate [OE-Specific] Signed-off-by: Khem Raj <[email protected]>
1 parent f1fa30b commit 6c404d2

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,6 +2403,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
24032403

24042404
static const char *const MIPSN32LibDirs[] = {"/lib32"};
24052405
static const char *const MIPSN32Triples[] = {"mips64-linux-gnuabin32",
2406+
"mips64-linux-gnun32",
24062407
"mipsisa64r6-linux-gnuabin32"};
24072408
static const char *const MIPSN32ELLibDirs[] = {"/lib32"};
24082409
static const char *const MIPSN32ELTriples[] = {

clang/lib/Driver/ToolChains/Linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ std::string Linux::getMultiarchTriple(const Driver &D,
138138
return IsMipsR6 ? "mipsisa32r6el-linux-gnu" : "mipsel-linux-gnu";
139139
case llvm::Triple::mips64: {
140140
std::string MT = std::string(IsMipsR6 ? "mipsisa64r6" : "mips64") +
141-
"-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64");
141+
"-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu");
142142
if (D.getVFS().exists(concat(SysRoot, "/lib", MT)))
143143
return MT;
144144
if (D.getVFS().exists(concat(SysRoot, "/lib/mips64-linux-gnu")))
@@ -147,7 +147,7 @@ std::string Linux::getMultiarchTriple(const Driver &D,
147147
}
148148
case llvm::Triple::mips64el: {
149149
std::string MT = std::string(IsMipsR6 ? "mipsisa64r6el" : "mips64el") +
150-
"-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64");
150+
"-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu");
151151
if (D.getVFS().exists(concat(SysRoot, "/lib", MT)))
152152
return MT;
153153
if (D.getVFS().exists(concat(SysRoot, "/lib/mips64el-linux-gnu")))

llvm/lib/TargetParser/Triple.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
350350
case GNU: return "gnu";
351351
case GNUT64: return "gnut64";
352352
case GNUABI64: return "gnuabi64";
353-
case GNUABIN32: return "gnuabin32";
353+
case GNUABIN32: return "gnun32";
354354
case GNUEABI: return "gnueabi";
355355
case GNUEABIT64: return "gnueabit64";
356356
case GNUEABIHF: return "gnueabihf";
@@ -750,6 +750,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
750750
.StartsWith("eabihf", Triple::EABIHF)
751751
.StartsWith("eabi", Triple::EABI)
752752
.StartsWith("gnuabin32", Triple::GNUABIN32)
753+
.StartsWith("gnun32", Triple::GNUABIN32)
753754
.StartsWith("gnuabi64", Triple::GNUABI64)
754755
.StartsWith("gnueabihft64", Triple::GNUEABIHFT64)
755756
.StartsWith("gnueabihf", Triple::GNUEABIHF)
@@ -1072,6 +1073,7 @@ Triple::Triple(std::string &&Str) : Data(std::move(Str)) {
10721073
Environment =
10731074
StringSwitch<Triple::EnvironmentType>(Components[0])
10741075
.StartsWith("mipsn32", Triple::GNUABIN32)
1076+
.StartsWith("mips64-n32", Triple::GNUABIN32)
10751077
.StartsWith("mips64", Triple::GNUABI64)
10761078
.StartsWith("mipsisa64", Triple::GNUABI64)
10771079
.StartsWith("mipsisa32", Triple::GNU)

0 commit comments

Comments
 (0)