Skip to content

Commit 9605929

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 95037b4 commit 9605929

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
@@ -2493,6 +2493,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
24932493

24942494
static const char *const MIPSN32LibDirs[] = {"/lib32"};
24952495
static const char *const MIPSN32Triples[] = {"mips64-linux-gnuabin32",
2496+
"mips64-linux-gnun32",
24962497
"mipsisa64r6-linux-gnuabin32"};
24972498
static const char *const MIPSN32ELLibDirs[] = {"/lib32"};
24982499
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
@@ -139,7 +139,7 @@ std::string Linux::getMultiarchTriple(const Driver &D,
139139
return IsMipsR6 ? "mipsisa32r6el-linux-gnu" : "mipsel-linux-gnu";
140140
case llvm::Triple::mips64: {
141141
std::string MT = std::string(IsMipsR6 ? "mipsisa64r6" : "mips64") +
142-
"-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64");
142+
"-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu");
143143
if (D.getVFS().exists(concat(SysRoot, "/lib", MT)))
144144
return MT;
145145
if (D.getVFS().exists(concat(SysRoot, "/lib/mips64-linux-gnu")))
@@ -148,7 +148,7 @@ std::string Linux::getMultiarchTriple(const Driver &D,
148148
}
149149
case llvm::Triple::mips64el: {
150150
std::string MT = std::string(IsMipsR6 ? "mipsisa64r6el" : "mips64el") +
151-
"-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64");
151+
"-linux-" + (IsMipsN32Abi ? "gnun32" : "gnu");
152152
if (D.getVFS().exists(concat(SysRoot, "/lib", MT)))
153153
return MT;
154154
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
@@ -338,7 +338,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
338338
case GNU: return "gnu";
339339
case GNUT64: return "gnut64";
340340
case GNUABI64: return "gnuabi64";
341-
case GNUABIN32: return "gnuabin32";
341+
case GNUABIN32: return "gnun32";
342342
case GNUEABI: return "gnueabi";
343343
case GNUEABIT64: return "gnueabit64";
344344
case GNUEABIHF: return "gnueabihf";
@@ -724,6 +724,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
724724
.StartsWith("eabihf", Triple::EABIHF)
725725
.StartsWith("eabi", Triple::EABI)
726726
.StartsWith("gnuabin32", Triple::GNUABIN32)
727+
.StartsWith("gnun32", Triple::GNUABIN32)
727728
.StartsWith("gnuabi64", Triple::GNUABI64)
728729
.StartsWith("gnueabihft64", Triple::GNUEABIHFT64)
729730
.StartsWith("gnueabihf", Triple::GNUEABIHF)
@@ -1041,6 +1042,7 @@ Triple::Triple(const Twine &Str)
10411042
Environment =
10421043
StringSwitch<Triple::EnvironmentType>(Components[0])
10431044
.StartsWith("mipsn32", Triple::GNUABIN32)
1045+
.StartsWith("mips64-n32", Triple::GNUABIN32)
10441046
.StartsWith("mips64", Triple::GNUABI64)
10451047
.StartsWith("mipsisa64", Triple::GNUABI64)
10461048
.StartsWith("mipsisa32", Triple::GNU)

0 commit comments

Comments
 (0)