From 33ced14ac67b64bde28826f184bf2677d131e2fd Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Mon, 5 Aug 2019 01:15:33 +0000 Subject: [PATCH] [Driver] Always use -z separate-code with lld on Fuchsia Previously -z separate-code was the default lld behavior, but now it has to be explicitly requested by specifying the flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367796 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains/Fuchsia.cpp | 2 ++ test/Driver/fuchsia.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Driver/ToolChains/Fuchsia.cpp b/lib/Driver/ToolChains/Fuchsia.cpp index 1f5ec9ebb1..84e5027ddf 100644 --- a/lib/Driver/ToolChains/Fuchsia.cpp +++ b/lib/Driver/ToolChains/Fuchsia.cpp @@ -51,6 +51,8 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA, llvm::sys::path::stem(Exec).equals_lower("ld.lld")) { CmdArgs.push_back("-z"); CmdArgs.push_back("rodynamic"); + CmdArgs.push_back("-z"); + CmdArgs.push_back("separate-code"); } if (!D.SysRoot.empty()) diff --git a/test/Driver/fuchsia.c b/test/Driver/fuchsia.c index c31e3739b5..ec664fb3b5 100644 --- a/test/Driver/fuchsia.c +++ b/test/Driver/fuchsia.c @@ -16,7 +16,7 @@ // CHECK: "-fsanitize=safe-stack" // CHECK: "-stack-protector" "2" // CHECK: "-fno-common" -// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic" +// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic" "-z" "separate-code" // CHECK: "--sysroot=[[SYSROOT]]" // CHECK: "-pie" // CHECK: "--build-id" -- 2.50.1