Skip to content

Commit 8267bea

Browse files
authored
[Clang][MIPS] Send correct architecture for MinGW toolchains (#121042)
'mipspe' name was chosen by binutils, when the project was able to create executables for Windows CE/MIPS.
1 parent c983ae8 commit 8267bea

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/lib/Driver/ToolChains/MinGW.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
138138
else
139139
CmdArgs.push_back("arm64pe");
140140
break;
141+
case llvm::Triple::mipsel:
142+
CmdArgs.push_back("mipspe");
143+
break;
141144
default:
142145
D.Diag(diag::err_target_unknown_triple) << TC.getEffectiveTriple().str();
143146
}

clang/test/Driver/mingw.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
// RUN: | FileCheck %s --check-prefix CHECK_MINGW_EC_LINK
8686
// CHECK_MINGW_EC_LINK: "-m" "arm64ecpe"
8787

88+
// RUN: %clang --target=mipsel-windows-gnu -### -o /dev/null %s 2>&1 \
89+
// RUN: | FileCheck %s --check-prefix CHECK_MINGW_MIPSPE
90+
// CHECK_MINGW_MIPSPE: "-m" "mipspe"
91+
8892
// RUN: %clang --target=i686-windows-gnu -fms-hotpatch -### -- %s 2>&1 \
8993
// RUN: | FileCheck %s --check-prefix=FUNCTIONPADMIN
9094
// FUNCTIONPADMIN: "--functionpadmin"

0 commit comments

Comments
 (0)