From cfd2a5cfa148b1c927571cc2e9f06e242831b696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Marie?= Date: Mon, 23 Feb 2015 20:03:15 +0100 Subject: [PATCH] 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. --- src/librustc_back/target/openbsd_base.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/librustc_back/target/openbsd_base.rs b/src/librustc_back/target/openbsd_base.rs index 42220a87bd4..759147b939c 100644 --- a/src/librustc_back/target/openbsd_base.rs +++ b/src/librustc_back/target/openbsd_base.rs @@ -20,6 +20,11 @@ pub fn opts() -> TargetOptions { linker_is_gnu: true, has_rpath: true, pre_link_args: vec!( + // GNU-style linkers will use this to omit linking to libraries + // which don't actually fulfill any relocations, but only for + // libraries which follow this flag. Thus, use it before + // specifying libraries to link to. + "-Wl,--as-needed".to_string(), ), position_independent_executables: true, .. Default::default()