r308390 - [Driver] Always use -z rodynamic for Fuchsia
Petr Hosek via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 18 16:23:16 PDT 2017
Author: phosek
Date: Tue Jul 18 16:23:16 2017
New Revision: 308390
URL: http://llvm.org/viewvc/llvm-project?rev=308390&view=rev
Log:
[Driver] Always use -z rodynamic for Fuchsia
Fuchsia uses read-only .dynamic section.
Differential Revision: https://reviews.llvm.org/D35582
Modified:
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/test/Driver/fuchsia.c
cfe/trunk/test/Driver/fuchsia.cpp
Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=308390&r1=308389&r2=308390&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Tue Jul 18 16:23:16 2017
@@ -46,6 +46,9 @@ void fuchsia::Linker::ConstructJob(Compi
if (llvm::sys::path::stem(Exec).equals_lower("lld")) {
CmdArgs.push_back("-flavor");
CmdArgs.push_back("gnu");
+
+ CmdArgs.push_back("-z");
+ CmdArgs.push_back("rodynamic");
}
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=308390&r1=308389&r2=308390&view=diff
==============================================================================
--- cfe/trunk/test/Driver/fuchsia.c (original)
+++ cfe/trunk/test/Driver/fuchsia.c Tue Jul 18 16:23:16 2017
@@ -5,6 +5,7 @@
// CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
// CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include"
// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
+// CHECK: "-z" "rodynamic"
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"
Modified: cfe/trunk/test/Driver/fuchsia.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.cpp?rev=308390&r1=308389&r2=308390&view=diff
==============================================================================
--- cfe/trunk/test/Driver/fuchsia.cpp (original)
+++ cfe/trunk/test/Driver/fuchsia.cpp Tue Jul 18 16:23:16 2017
@@ -7,6 +7,7 @@
// CHECK: "-internal-isystem" "{{.*[/\\]}}x86_64-fuchsia{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
// CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include"
// CHECK: {{.*}}lld{{.*}}" "-flavor" "gnu"
+// CHECK: "-z" "rodynamic"
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"
More information about the cfe-commits
mailing list