]> git.lizzy.rs Git - rust.git/commitdiff
Use -O1 for non-GNU linkers
authorCorey Richardson <corey@octayn.net>
Sun, 24 Nov 2013 13:50:16 +0000 (08:50 -0500)
committerCorey Richardson <corey@octayn.net>
Sun, 24 Nov 2013 13:50:16 +0000 (08:50 -0500)
src/librustc/back/link.rs

index 3939e3851fa234d898a5af40584a648f50f4bcd4..24af0fab43e2cc683727f25b11ff979d68b90d0e 100644 (file)
@@ -1099,9 +1099,10 @@ fn unlib(config: @session::config, stem: ~str) -> ~str {
     // 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"]);