Skip to content

Commit 0fb2f52

Browse files
authored
[LLD] Recognize 'mipspe' as a PE target name (#157305)
When compiling for target `mipsel-windows-gnu` triple, clang is calling linker with `mipspe` machine. Handle this case.
1 parent db746c6 commit 0fb2f52

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lld/Common/DriverDispatcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static cl::TokenizerCallback getDefaultQuotingStyle() {
4545

4646
static bool isPETargetName(StringRef s) {
4747
return s == "i386pe" || s == "i386pep" || s == "thumb2pe" || s == "arm64pe" ||
48-
s == "arm64ecpe" || s == "arm64xpe";
48+
s == "arm64ecpe" || s == "arm64xpe" || s == "mipspe";
4949
}
5050

5151
static std::optional<bool> isPETarget(llvm::ArrayRef<const char *> args) {

lld/test/MinGW/driver.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ RUN: not ld.lld -m i386pep --foo 2>&1 | FileCheck -check-prefix UNKNOWN_ARG %s
296296
UNKNOWN_ARG: error: unknown argument: --foo
297297

298298
RUN: not ld.lld -m i386pep 2>&1 | FileCheck -check-prefix NO_INPUT_FILES %s
299+
RUN: not ld.lld -m mipspe 2>&1 | FileCheck -check-prefix NO_INPUT_FILES %s
299300
NO_INPUT_FILES: error: no input files
300301

301302
RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix ENABLE_AUTO_IMPORT %s

0 commit comments

Comments
 (0)