Skip to content

Commit 2f4a101

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 56dcf56 commit 2f4a101

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
@@ -336,7 +336,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
336336
case GNU: return "gnu";
337337
case GNUT64: return "gnut64";
338338
case GNUABI64: return "gnuabi64";
339-
case GNUABIN32: return "gnuabin32";
339+
case GNUABIN32: return "gnun32";
340340
case GNUEABI: return "gnueabi";
341341
case GNUEABIT64: return "gnueabit64";
342342
case GNUEABIHF: return "gnueabihf";
@@ -719,6 +719,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
719719
.StartsWith("eabihf", Triple::EABIHF)
720720
.StartsWith("eabi", Triple::EABI)
721721
.StartsWith("gnuabin32", Triple::GNUABIN32)
722+
.StartsWith("gnun32", Triple::GNUABIN32)
722723
.StartsWith("gnuabi64", Triple::GNUABI64)
723724
.StartsWith("gnueabihft64", Triple::GNUEABIHFT64)
724725
.StartsWith("gnueabihf", Triple::GNUEABIHF)
@@ -1035,6 +1036,7 @@ Triple::Triple(const Twine &Str)
10351036
Environment =
10361037
StringSwitch<Triple::EnvironmentType>(Components[0])
10371038
.StartsWith("mipsn32", Triple::GNUABIN32)
1039+
.StartsWith("mips64-n32", Triple::GNUABIN32)
10381040
.StartsWith("mips64", Triple::GNUABI64)
10391041
.StartsWith("mipsisa64", Triple::GNUABI64)
10401042
.StartsWith("mipsisa32", Triple::GNU)

0 commit comments

Comments
 (0)