about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-11-24 05:56:28 -0800
committerbors <bors@rust-lang.org>2013-11-24 05:56:28 -0800
commitae91b81a6f7cba76d94ce00ef8155b9550344929 (patch)
tree37c2a4143f8fba59c3c9fa395c2ba108ebfa699e
parentce45bb7f4448fc810b35961c23bc23a27d685754 (diff)
parenta8a6188a1a37493fdf92b1caf87d61f3bd561efc (diff)
downloadrust-ae91b81a6f7cba76d94ce00ef8155b9550344929.tar.gz
rust-ae91b81a6f7cba76d94ce00ef8155b9550344929.zip
auto merge of #10633 : cmr/rust/linker_opts, r=thestinger
r? @Luqmana
-rw-r--r--src/librustc/back/link.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index 3939e3851fa..24af0fab43e 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -1099,9 +1099,10 @@ pub fn link_args(sess: Session,
     // and binutils 2.22+ won't add them automatically
     if sess.targ_cfg.os == abi::OsLinux {
         // GNU-style linkers supports optimization with -O. --gc-sections removes metadata and
-        // potentially other useful things, so don't include it.
+        // potentially other useful things, so don't include it. GNU ld doesn't need a numeric
+        // argument, but other linkers do.
         if sess.opts.optimize == session::Default || sess.opts.optimize == session::Aggressive {
-            args.push(~"-Wl,-O");
+            args.push(~"-Wl,-O1");
         }
 
         args.push_all([~"-lrt", ~"-ldl"]);