[clang] [MinGW] MinGW dynamicbase (PR #74979)
εΎζζ Xu Chiheng via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 12 10:59:13 PST 2023
https://github.com/xu-chiheng updated https://github.com/llvm/llvm-project/pull/74979
>From e08d12df9f987ad4cf025d4bf1896acf2deea859 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BE=90=E6=8C=81=E6=81=92=20Xu=20Chiheng?=
<chiheng.xu at gmail.com>
Date: Sun, 10 Dec 2023 15:03:28 +0800
Subject: [PATCH 1/2] 1
---
clang/lib/Driver/ToolChains/MinGW.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp b/clang/lib/Driver/ToolChains/MinGW.cpp
index 5d7f8675daf8d2..50181837d39399 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -165,6 +165,7 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("DllMainCRTStartup");
CmdArgs.push_back("--enable-auto-image-base");
}
+ CmdArgs.push_back("--dynamicbase");
if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle))
CmdArgs.push_back("--no-demangle");
>From b7383e3b85acae68c69c7db2091356cb27067ce1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BE=90=E6=8C=81=E6=81=92=20Xu=20Chiheng?=
<chiheng.xu at gmail.com>
Date: Wed, 13 Dec 2023 02:58:47 +0800
Subject: [PATCH 2/2] 1
---
clang/lib/Driver/ToolChains/MinGW.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp b/clang/lib/Driver/ToolChains/MinGW.cpp
index 50181837d39399..0e51a427a66af0 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -165,7 +165,13 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("DllMainCRTStartup");
CmdArgs.push_back("--enable-auto-image-base");
}
- CmdArgs.push_back("--dynamicbase");
+ switch (TC.getArch()) {
+ case llvm::Triple::x86_64:
+ CmdArgs.push_back("--dynamicbase");
+ break;
+ case llvm::Triple::aarch64:
+ break;
+ }
if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle))
CmdArgs.push_back("--no-demangle");
More information about the cfe-commits
mailing list