[clang] 16f735d - [Driver] Make --execute-only the default for aarch64-fuchsia
Alex Brachet via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 20 11:26:11 PDT 2022
Author: Alex Brachet
Date: 2022-09-20T18:25:16Z
New Revision: 16f735d2fbe8660659f1dde10eea79b0f0f7c11d
URL: https://github.com/llvm/llvm-project/commit/16f735d2fbe8660659f1dde10eea79b0f0f7c11d
DIFF: https://github.com/llvm/llvm-project/commit/16f735d2fbe8660659f1dde10eea79b0f0f7c11d.diff
LOG: [Driver] Make --execute-only the default for aarch64-fuchsia
Clang already generates code that doesn't use writeable data in executable
sections so the linker flag is all that is necessary.
-Wl,--no-execute-only can be used to turn this default off.
Differential Revision: https://reviews.llvm.org/D134289
Added:
Modified:
clang/lib/Driver/ToolChains/Fuchsia.cpp
clang/test/Driver/fuchsia.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Fuchsia.cpp b/clang/lib/Driver/ToolChains/Fuchsia.cpp
index d63c69c63b1f..6f4fa2ce7c40 100644
--- a/clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ b/clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -87,6 +87,8 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
if (ToolChain.getArch() == llvm::Triple::aarch64) {
+ CmdArgs.push_back("--execute-only");
+
std::string CPU = getCPUName(D, Args, Triple);
if (CPU.empty() || CPU == "generic" || CPU == "cortex-a53")
CmdArgs.push_back("--fix-cortex-a53-843419");
diff --git a/clang/test/Driver/fuchsia.c b/clang/test/Driver/fuchsia.c
index ce356a4faca1..099a88c2e4e3 100644
--- a/clang/test/Driver/fuchsia.c
+++ b/clang/test/Driver/fuchsia.c
@@ -41,7 +41,7 @@
// CHECK: "-pie"
// CHECK: "--build-id"
// CHECK: "--hash-style=gnu"
-// CHECK-AARCH64: "--fix-cortex-a53-843419"
+// CHECK-AARCH64: "--execute-only" "--fix-cortex-a53-843419"
// CHECK: "-dynamic-linker" "ld.so.1"
// CHECK-RISCV64: "-X"
// CHECK: Scrt1.o
More information about the cfe-commits
mailing list