Skip to content

Commit cfd2a5c

Browse files
committed
openbsd: restore linker option
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.
1 parent f0f7ca2 commit cfd2a5c

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)