Skip to content

Commit 74a6e5c

Browse files
[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>
1 parent 61004b7 commit 74a6e5c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-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";
48+
s == "arm64ecpe" || s == "arm64xpe";
4949
}
5050

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

lld/MinGW/Driver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
448448
add("-machine:arm64");
449449
else if (s == "arm64ecpe")
450450
add("-machine:arm64ec");
451+
else if (s == "arm64xpe")
452+
add("-machine:arm64x");
451453
else
452454
error("unknown parameter: -m" + s);
453455
}

lld/test/MinGW/driver.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ ARM64EC-SAME: -machine:arm64ec
3131
ARM64EC-SAME: -alternatename:__image_base__=__ImageBase
3232
ARM64EC-SAME: foo.o
3333

34+
RUN: ld.lld -### foo.o -m arm64xpe 2>&1 | FileCheck -check-prefix=ARM64X %s
35+
ARM64X: -out:a.exe
36+
ARM64X-SAME: -machine:arm64x
37+
ARM64X-SAME: -alternatename:__image_base__=__ImageBase
38+
ARM64X-SAME: foo.o
39+
3440
RUN: ld.lld -### foo.o -m i386pep -shared 2>&1 | FileCheck -check-prefix=SHARED %s
3541
RUN: ld.lld -### foo.o -m i386pep --shared 2>&1 | FileCheck -check-prefix=SHARED %s
3642
RUN: ld.lld -### foo.o -m i386pep --dll 2>&1 | FileCheck -check-prefix=SHARED %s

0 commit comments

Comments
 (0)