Skip to content

Commit e9c4efb

Browse files
committed
Only pass -fno-use-linker-plugin on Windows
Only pass -fno-use-linker-plugin on Windows where it avoids pulling in dependencies. Passing it to clang on OS X and Linux would make it fail though.
1 parent 793a366 commit e9c4efb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc/back/link.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,12 @@ fn link_args(cmd: &mut Command,
931931
}
932932

933933
// Rust does its' own LTO
934-
cmd.arg("-fno-lto").arg("-fno-use-linker-plugin");
934+
cmd.arg("-fno-lto");
935+
936+
// clang fails hard if -fno-use-linker-plugin is passed
937+
if sess.targ_cfg.os == abi::OsWindows {
938+
cmd.arg("-fno-use-linker-plugin");
939+
}
935940

936941
// If we're building a dylib, we don't use --gc-sections because LLVM has
937942
// already done the best it can do, and we also don't want to eliminate the

0 commit comments

Comments
 (0)