r367796 - [Driver] Always use -z separate-code with lld on Fuchsia
Petr Hosek via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 4 18:15:33 PDT 2019
Author: phosek
Date: Sun Aug 4 18:15:33 2019
New Revision: 367796
URL: http://llvm.org/viewvc/llvm-project?rev=367796&view=rev
Log:
[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.
Modified:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/test/Driver/fuchsia.c
Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=367796&r1=367795&r2=367796&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Sun Aug 4 18:15:33 2019
@@ -51,6 +51,8 @@ void fuchsia::Linker::ConstructJob(Compi
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())
Modified: cfe/trunk/test/Driver/fuchsia.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.c?rev=367796&r1=367795&r2=367796&view=diff
==============================================================================
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Sun Aug 4 18:15:33 2019
@@ -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"
More information about the cfe-commits
mailing list