aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
diff options
context:
space:
mode:
authorHervé Poussineau <hpoussin@reactos.org>2025-01-05 08:18:05 +0100
committerGitHub <noreply@github.com>2025-01-05 15:18:05 +0800
commitc983ae8f26334279cfe7846bdc9b395abe415e65 (patch)
tree1a84c3b6e891a24fdfed9ad07a8a13ead0b33eaa /llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
parent6f69f8c9fe57a44939fd111f52b6d8e267a46602 (diff)
downloadllvm-c983ae8f26334279cfe7846bdc9b395abe415e65.zip
llvm-c983ae8f26334279cfe7846bdc9b395abe415e65.tar.gz
llvm-c983ae8f26334279cfe7846bdc9b395abe415e65.tar.bz2
[llvm-lib] Handle MIPS architecture (#121254)
- add a test to check values for /machine argument - add a test to check if machine is correctly inferred from inputs
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp')
-rw-r--r--llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
index 138d9fc..6ce06b4 100644
--- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
@@ -171,6 +171,7 @@ static Expected<COFF::MachineTypes> getCOFFFileMachine(MemoryBufferRef MB) {
uint16_t Machine = (*Obj)->getMachine();
if (Machine != COFF::IMAGE_FILE_MACHINE_I386 &&
Machine != COFF::IMAGE_FILE_MACHINE_AMD64 &&
+ Machine != COFF::IMAGE_FILE_MACHINE_R4000 &&
Machine != COFF::IMAGE_FILE_MACHINE_ARMNT && !COFF::isAnyArm64(Machine)) {
return createStringError(inconvertibleErrorCode(),
"unknown machine: " + std::to_string(Machine));
@@ -195,6 +196,8 @@ static Expected<COFF::MachineTypes> getBitcodeFileMachine(MemoryBufferRef MB) {
case Triple::aarch64:
return T.isWindowsArm64EC() ? COFF::IMAGE_FILE_MACHINE_ARM64EC
: COFF::IMAGE_FILE_MACHINE_ARM64;
+ case Triple::mipsel:
+ return COFF::IMAGE_FILE_MACHINE_R4000;
default:
return createStringError(inconvertibleErrorCode(),
"unknown arch in target triple: " + *TripleStr);