[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.
This commit is contained in:
Hervé Poussineau 2025-09-08 22:28:54 +02:00 committed by GitHub
parent db746c65b1
commit 0fb2f524f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -45,7 +45,7 @@ static cl::TokenizerCallback getDefaultQuotingStyle() {
static bool isPETargetName(StringRef s) {
return s == "i386pe" || s == "i386pep" || s == "thumb2pe" || s == "arm64pe" ||
s == "arm64ecpe" || s == "arm64xpe";
s == "arm64ecpe" || s == "arm64xpe" || s == "mipspe";
}
static std::optional<bool> isPETarget(llvm::ArrayRef<const char *> args) {

View File

@ -296,6 +296,7 @@ RUN: not ld.lld -m i386pep --foo 2>&1 | FileCheck -check-prefix UNKNOWN_ARG %s
UNKNOWN_ARG: error: unknown argument: --foo
RUN: not ld.lld -m i386pep 2>&1 | FileCheck -check-prefix NO_INPUT_FILES %s
RUN: not ld.lld -m mipspe 2>&1 | FileCheck -check-prefix NO_INPUT_FILES %s
NO_INPUT_FILES: error: no input files
RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix ENABLE_AUTO_IMPORT %s