Skip to content

Commit 8aeab8f

Browse files
[Driver][MinGW] Allow using clang driver to link ARM64X PEs. (#148064)
Similar to how clang-cl driver does it, make it possible to build arm64x binaries with a mingw-style invocation. Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
1 parent c363a3f commit 8aeab8f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

clang/lib/Driver/ToolChains/MinGW.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
132132
CmdArgs.push_back("thumb2pe");
133133
break;
134134
case llvm::Triple::aarch64:
135-
if (TC.getEffectiveTriple().isWindowsArm64EC())
135+
if (Args.hasArg(options::OPT_marm64x))
136+
CmdArgs.push_back("arm64xpe");
137+
else if (TC.getEffectiveTriple().isWindowsArm64EC())
136138
CmdArgs.push_back("arm64ecpe");
137139
else
138140
CmdArgs.push_back("arm64pe");

clang/test/Driver/mingw.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
// RUN: | FileCheck %s --check-prefix CHECK_MINGW_EC_LINK
8686
// CHECK_MINGW_EC_LINK: "-m" "arm64ecpe"
8787

88+
// RUN: %clang --target=aarch64-windows-gnu -marm64x -### -o /dev/null %s 2>&1 \
89+
// RUN: | FileCheck %s --check-prefix CHECK_MINGW_A64X_LINK
90+
// CHECK_MINGW_A64X_LINK: "-m" "arm64xpe"
91+
8892
// RUN: %clang --target=mipsel-windows-gnu -### -o /dev/null %s 2>&1 \
8993
// RUN: | FileCheck %s --check-prefix CHECK_MINGW_MIPSPE
9094
// CHECK_MINGW_MIPSPE: "-m" "mipspe"

0 commit comments

Comments
 (0)