Skip to content

Commit 9bc0314

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 0e3775f commit 9bc0314

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
@@ -339,7 +339,7 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
339339
case GNU: return "gnu";
340340
case GNUT64: return "gnut64";
341341
case GNUABI64: return "gnuabi64";
342-
case GNUABIN32: return "gnuabin32";
342+
case GNUABIN32: return "gnun32";
343343
case GNUEABI: return "gnueabi";
344344
case GNUEABIT64: return "gnueabit64";
345345
case GNUEABIHF: return "gnueabihf";
@@ -725,6 +725,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
725725
.StartsWith("eabihf", Triple::EABIHF)
726726
.StartsWith("eabi", Triple::EABI)
727727
.StartsWith("gnuabin32", Triple::GNUABIN32)
728+
.StartsWith("gnun32", Triple::GNUABIN32)
728729
.StartsWith("gnuabi64", Triple::GNUABI64)
729730
.StartsWith("gnueabihft64", Triple::GNUEABIHFT64)
730731
.StartsWith("gnueabihf", Triple::GNUEABIHF)
@@ -1039,6 +1040,7 @@ Triple::Triple(std::string &&Str) : Data(std::move(Str)) {
10391040
Environment =
10401041
StringSwitch<Triple::EnvironmentType>(Components[0])
10411042
.StartsWith("mipsn32", Triple::GNUABIN32)
1043+
.StartsWith("mips64-n32", Triple::GNUABIN32)
10421044
.StartsWith("mips64", Triple::GNUABI64)
10431045
.StartsWith("mipsisa64", Triple::GNUABI64)
10441046
.StartsWith("mipsisa32", Triple::GNU)

0 commit comments

Comments
 (0)