[lld] a9ffdc1 - [lld] [MinGW] Support targeting ARM64EC (#78911)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 06:53:17 PST 2024
Author: Billy Laws
Date: 2024-01-30T16:53:12+02:00
New Revision: a9ffdc171aea346754fd63e9b5986853f2d819e7
URL: https://github.com/llvm/llvm-project/commit/a9ffdc171aea346754fd63e9b5986853f2d819e7
DIFF: https://github.com/llvm/llvm-project/commit/a9ffdc171aea346754fd63e9b5986853f2d819e7.diff
LOG: [lld] [MinGW] Support targeting ARM64EC (#78911)
'arm64ecpe' was chosen arbitrarily as gcc MinGW doesn't provide EC
support.
Added:
Modified:
lld/Common/DriverDispatcher.cpp
lld/MinGW/Driver.cpp
lld/test/MinGW/driver.test
Removed:
################################################################################
diff --git a/lld/Common/DriverDispatcher.cpp b/lld/Common/DriverDispatcher.cpp
index 435acfd277654..f5c8bcdef4e0f 100644
--- a/lld/Common/DriverDispatcher.cpp
+++ b/lld/Common/DriverDispatcher.cpp
@@ -44,7 +44,8 @@ static cl::TokenizerCallback getDefaultQuotingStyle() {
}
static bool isPETargetName(StringRef s) {
- return s == "i386pe" || s == "i386pep" || s == "thumb2pe" || s == "arm64pe";
+ return s == "i386pe" || s == "i386pep" || s == "thumb2pe" || s == "arm64pe" ||
+ s == "arm64ecpe";
}
static std::optional<bool> isPETarget(llvm::ArrayRef<const char *> args) {
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index 4752d92e3b1d7..290eecaacda7d 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -346,6 +346,7 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
if (args.getLastArgValue(OPT_m) != "thumb2pe" &&
args.getLastArgValue(OPT_m) != "arm64pe" &&
+ args.getLastArgValue(OPT_m) != "arm64ecpe" &&
args.hasFlag(OPT_disable_dynamicbase, OPT_dynamicbase, false))
add("-dynamicbase:no");
if (args.hasFlag(OPT_disable_high_entropy_va, OPT_high_entropy_va, false))
@@ -409,6 +410,8 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
add("-machine:arm");
else if (s == "arm64pe")
add("-machine:arm64");
+ else if (s == "arm64ecpe")
+ add("-machine:arm64ec");
else
error("unknown parameter: -m" + s);
}
diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test
index 559a32bfa242f..46b3b6d7a862a 100644
--- a/lld/test/MinGW/driver.test
+++ b/lld/test/MinGW/driver.test
@@ -25,6 +25,12 @@ ARM64-SAME: -machine:arm64
ARM64-SAME: -alternatename:__image_base__=__ImageBase
ARM64-SAME: foo.o
+RUN: ld.lld -### foo.o -m arm64ecpe 2>&1 | FileCheck -check-prefix=ARM64EC %s
+ARM64EC: -out:a.exe
+ARM64EC-SAME: -machine:arm64ec
+ARM64EC-SAME: -alternatename:__image_base__=__ImageBase
+ARM64EC-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
More information about the llvm-commits
mailing list