[lld] [LLD] Recognize 'mipspe' as a PE target name (PR #157305)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 6 12:53:03 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld

Author: Hervé Poussineau (hpoussin)

<details>
<summary>Changes</summary>

When compiling for target `mipsel-windows-gnu` triple, clang is calling linker with `mipspe` machine.
Handle this case.

---
Full diff: https://github.com/llvm/llvm-project/pull/157305.diff


2 Files Affected:

- (modified) lld/Common/DriverDispatcher.cpp (+1-1) 
- (modified) lld/test/MinGW/driver.test (+1) 


``````````diff
diff --git a/lld/Common/DriverDispatcher.cpp b/lld/Common/DriverDispatcher.cpp
index 34f0ed24b3df0..7c5f1cd3692ef 100644
--- a/lld/Common/DriverDispatcher.cpp
+++ b/lld/Common/DriverDispatcher.cpp
@@ -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) {
diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test
index 618b888504320..47809d8a87495 100644
--- a/lld/test/MinGW/driver.test
+++ b/lld/test/MinGW/driver.test
@@ -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

``````````

</details>


https://github.com/llvm/llvm-project/pull/157305


More information about the llvm-commits mailing list