[clang] [clang] [MinGW] Handle linking ARM64EC code (PR #78912)
Billy Laws via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 30 16:38:38 PST 2024
https://github.com/bylaws updated https://github.com/llvm/llvm-project/pull/78912
>From 2593e41ef9a4f0d40908e6e25c1d9d7aeddc4f43 Mon Sep 17 00:00:00 2001
From: Billy Laws <blaws05 at gmail.com>
Date: Wed, 18 Oct 2023 21:23:38 +0100
Subject: [PATCH] [clang] [MinGW] Handle linking ARM64EC code
---
clang/lib/Driver/ToolChains/MinGW.cpp | 5 ++++-
clang/test/Driver/mingw.cpp | 4 ++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp b/clang/lib/Driver/ToolChains/MinGW.cpp
index 18fc9d4b6807e..fded966484dfe 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -132,7 +132,10 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("thumb2pe");
break;
case llvm::Triple::aarch64:
- CmdArgs.push_back("arm64pe");
+ if (TC.getEffectiveTriple().isWindowsArm64EC())
+ CmdArgs.push_back("arm64ecpe");
+ else
+ CmdArgs.push_back("arm64pe");
break;
default:
D.Diag(diag::err_target_unknown_triple) << TC.getEffectiveTriple().str();
diff --git a/clang/test/Driver/mingw.cpp b/clang/test/Driver/mingw.cpp
index bb22a0652b486..e42ff4554e452 100644
--- a/clang/test/Driver/mingw.cpp
+++ b/clang/test/Driver/mingw.cpp
@@ -80,3 +80,7 @@
// RUN: %clang -target i686-windows-gnu -### %s 2>&1 | FileCheck -check-prefix=CHECK_NO_INIT_ARRAY %s
// CHECK_NO_INIT_ARRAY: "-fno-use-init-array"
+
+// RUN: %clang -target arm64ec-windows-gnu -### -o /dev/null %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix CHECK_MINGW_EC_LINK
+// CHECK_MINGW_EC_LINK: "-m" "arm64ecpe"
More information about the cfe-commits
mailing list