Skip to content

Commit 6115f2e

Browse files
author
Ali Clark
committed
bring freebsd linker config up-to-date (same as dragonfly)
1 parent f4046de commit 6115f2e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/librustc_back/target/freebsd_base.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)