Skip to content

Commit 39c0aa3

Browse files
committed
Rollup merge of rust-lang#22726 - semarie:openbsd-Wl-as-needed, r=alexcrichton
The `-Wl,--as-needed` option was removed during first stages of bootstrapping between Linux and OpenBSD. Restore it, as it seems to be ok now.
2 parents 9ed6c33 + cfd2a5c commit 39c0aa3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustc_back/target/openbsd_base.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ pub fn opts() -> TargetOptions {
2020
linker_is_gnu: true,
2121
has_rpath: true,
2222
pre_link_args: vec!(
23+
// GNU-style linkers will use this to omit linking to libraries
24+
// which don't actually fulfill any relocations, but only for
25+
// libraries which follow this flag. Thus, use it before
26+
// specifying libraries to link to.
27+
"-Wl,--as-needed".to_string(),
2328
),
2429
position_independent_executables: true,
2530
.. Default::default()

0 commit comments

Comments
 (0)