File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,20 @@ pub fn opts() -> TargetOptions {
1616 linker : "cc" . to_string ( ) ,
1717 dynamic_linking : true ,
1818 executables : true ,
19+ linker_is_gnu : true ,
1920 has_rpath : true ,
20- pre_link_args : vec ! [
21+ pre_link_args : vec ! (
22+ // GNU-style linkers will use this to omit linking to libraries
23+ // which don't actually fulfill any relocations, but only for
24+ // libraries which follow this flag. Thus, use it before
25+ // specifying libraries to link to.
26+ "-Wl,--as-needed" . to_string( ) ,
27+
2128 // Always enable NX protection when it is available
2229 "-Wl,-z,noexecstack" . to_string( ) ,
23- ] ,
30+ ) ,
31+ position_independent_executables : true ,
2432 exe_allocation_crate : super :: maybe_jemalloc ( ) ,
25-
2633 .. Default :: default ( )
2734 }
2835}
You can’t perform that action at this time.
0 commit comments