aboutsummaryrefslogtreecommitdiffstats
path: root/community/rust/static-pie.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/rust/static-pie.patch')
-rw-r--r--community/rust/static-pie.patch12
1 files changed, 5 insertions, 7 deletions
diff --git a/community/rust/static-pie.patch b/community/rust/static-pie.patch
index 4f861466c1..4d0021aba5 100644
--- a/community/rust/static-pie.patch
+++ b/community/rust/static-pie.patch
@@ -72,9 +72,9 @@ library, just like static binaries, but more secure.
pre_link_objects_exe: Vec::new(),
pre_link_objects_dll: Vec::new(),
post_link_objects: Vec::new(),
---- a/src/librustc_codegen_llvm/back/link.rs
-+++ b/src/librustc_codegen_llvm/back/link.rs
-@@ -994,13 +994,9 @@
+--- a/src/librustc_codegen_ssa/back/link.rs
++++ b/src/librustc_codegen_ssa/back/link.rs
+@@ -1058,12 +1058,7 @@
let mut position_independent_executable = false;
if t.options.position_independent_executables {
@@ -83,10 +83,8 @@ library, just like static binaries, but more secure.
- let more_args = &sess.opts.cg.link_arg;
- let mut args = args.iter().chain(more_args.iter()).chain(used_link_args.iter());
-
-+ let static_pie = t.options.static_position_independent_executables;
- if get_reloc_model(sess) == llvm::RelocMode::PIC
-- && !sess.crt_static() && !args.any(|x| *x == "-static") {
-+ && (!sess.crt_static() || static_pie) {
+- if is_pic(sess) && !sess.crt_static() && !args.any(|x| *x == "-static") {
++ if is_pic(sess) && (!sess.crt_static() || t.options.static_position_independent_executables) {
position_independent_executable = true;
}
}