about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSébastien Marie <semarie@users.noreply.github.com>2015-02-23 20:03:15 +0100
committerSébastien Marie <semarie@users.noreply.github.com>2015-02-23 20:03:15 +0100
commitcfd2a5cfa148b1c927571cc2e9f06e242831b696 (patch)
treec41e1d58f30848636773eb0eac50ec0487610a37
parentf0f7ca27de6b4e03f30012656dad270cda55a363 (diff)
downloadrust-cfd2a5cfa148b1c927571cc2e9f06e242831b696.tar.gz
rust-cfd2a5cfa148b1c927571cc2e9f06e242831b696.zip
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.
-rw-r--r--src/librustc_back/target/openbsd_base.rs5
1 files changed, 5 insertions, 0 deletions
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()