[LLD][MinGW] Support machine:arm64x when invoked in MinGW mode. (#145343)

Mingw mode already supports building machine:arm64ec arm64x binaries,
support machine:arm64x ones too.

Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
This commit is contained in:
WhatAmISupposedToPutHere 2025-07-10 22:47:37 +02:00 committed by GitHub
parent 61004b7eb5
commit 74a6e5cf91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 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 == "arm64ecpe" || s == "arm64xpe";
}
static std::optional<bool> isPETarget(llvm::ArrayRef<const char *> args) {

View File

@ -448,6 +448,8 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
add("-machine:arm64");
else if (s == "arm64ecpe")
add("-machine:arm64ec");
else if (s == "arm64xpe")
add("-machine:arm64x");
else
error("unknown parameter: -m" + s);
}

View File

@ -31,6 +31,12 @@ ARM64EC-SAME: -machine:arm64ec
ARM64EC-SAME: -alternatename:__image_base__=__ImageBase
ARM64EC-SAME: foo.o
RUN: ld.lld -### foo.o -m arm64xpe 2>&1 | FileCheck -check-prefix=ARM64X %s
ARM64X: -out:a.exe
ARM64X-SAME: -machine:arm64x
ARM64X-SAME: -alternatename:__image_base__=__ImageBase
ARM64X-SAME: foo.o
RUN: ld.lld -### foo.o -m i386pep -shared 2>&1 | FileCheck -check-prefix=SHARED %s
RUN: ld.lld -### foo.o -m i386pep --shared 2>&1 | FileCheck -check-prefix=SHARED %s
RUN: ld.lld -### foo.o -m i386pep --dll 2>&1 | FileCheck -check-prefix=SHARED %s