Skip to content

Commit b749e9b

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 <raj.khem@gmail.com>
1 parent 9962b1e commit b749e9b

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

24142414
static const char *const MIPSN32LibDirs[] = {"/lib32"};
24152415
static const char *const MIPSN32Triples[] = {"mips64-linux-gnuabin32",
2416+
"mips64-linux-gnun32",
24162417
"mipsisa64r6-linux-gnuabin32"};
24172418
static const char *const MIPSN32ELLibDirs[] = {"/lib32"};
24182419
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
@@ -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)
@@ -1038,6 +1039,7 @@ Triple::Triple(std::string &&Str) : Data(std::move(Str)) {
10381039
Environment =
10391040
StringSwitch<Triple::EnvironmentType>(Components[0])
10401041
.StartsWith("mipsn32", Triple::GNUABIN32)
1042+
.StartsWith("mips64-n32", Triple::GNUABIN32)
10411043
.StartsWith("mips64", Triple::GNUABI64)
10421044
.StartsWith("mipsisa64", Triple::GNUABI64)
10431045
.StartsWith("mipsisa32", Triple::GNU)

0 commit comments

Comments
 (0)