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 {
16
16
linker : "cc" . to_string ( ) ,
17
17
dynamic_linking : true ,
18
18
executables : true ,
19
+ linker_is_gnu : true ,
19
20
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
+
21
28
// Always enable NX protection when it is available
22
29
"-Wl,-z,noexecstack" . to_string( ) ,
23
- ] ,
30
+ ) ,
31
+ position_independent_executables : true ,
24
32
exe_allocation_crate : super :: maybe_jemalloc ( ) ,
25
-
26
33
.. Default :: default ( )
27
34
}
28
35
}
You can’t perform that action at this time.
0 commit comments