diff options
| author | bors <bors@rust-lang.org> | 2024-04-12 18:16:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-12 18:16:47 +0000 |
| commit | 22a2425c106c06a87f4b087e86153629b1da0d1c (patch) | |
| tree | e639329e941be33a581c8b6c3d59997bf387c004 | |
| parent | 322e92bdaee73946b8b78d1fb6d9c808ce1436e9 (diff) | |
| parent | f1548ec94dcc32634a607389765f76f51cd94eee (diff) | |
| download | rust-22a2425c106c06a87f4b087e86153629b1da0d1c.tar.gz rust-22a2425c106c06a87f4b087e86153629b1da0d1c.zip | |
Auto merge of #121426 - madsmtm:remove-cc-syslibroot, r=pnkfelix
Remove redundant `-Wl,-syslibroot` Since `-isysroot` is set, [Clang already passes this when invoking the linker](https://github.com/llvm/llvm-project/blob/llvmorg-17.0.6/clang/lib/Driver/ToolChains/Darwin.cpp#L439-L442). See https://github.com/rust-lang/rust/pull/56833 for when the `-isysroot` was originally added, but didn't remove the unnecessary linker flag. CC `@BlackHoleFox` r? shepmaster
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index f4374392b9b..894afc25ef2 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2987,7 +2987,13 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) { match flavor { LinkerFlavor::Darwin(Cc::Yes, _) => { - cmd.args(&["-isysroot", &sdk_root, "-Wl,-syslibroot", &sdk_root]); + // Use `-isysroot` instead of `--sysroot`, as only the former + // makes Clang treat it as a platform SDK. + // + // This is admittedly a bit strange, as on most targets + // `-isysroot` only applies to include header files, but on Apple + // targets this also applies to libraries and frameworks. + cmd.args(&["-isysroot", &sdk_root]); } LinkerFlavor::Darwin(Cc::No, _) => { cmd.args(&["-syslibroot", &sdk_root]); |
