Skip to content

Commit e27290e

Browse files
committed
Add /System/iOSSupport to the library search path on Mac Catalyst
1 parent b14d8b2 commit e27290e

File tree

1 file changed

+10
-0
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+10
-0
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+10
Original file line numberDiff line numberDiff line change
@@ -2997,6 +2997,16 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
29972997
}
29982998
_ => unreachable!(),
29992999
}
3000+
3001+
if llvm_target.contains("macabi") {
3002+
// Mac Catalyst uses the macOS SDK, but to link to iOS-specific
3003+
// frameworks, we must have the support library stubs in the library
3004+
// search path.
3005+
3006+
// The flags are called `-L` and `-F` both in Clang, ld64 and ldd.
3007+
cmd.arg(format!("-L{sdk_root}/System/iOSSupport/usr/lib"));
3008+
cmd.arg(format!("-F{sdk_root}/System/iOSSupport/System/Library/Frameworks"));
3009+
}
30003010
}
30013011

30023012
fn get_apple_sdk_root(sdk_name: &str) -> Result<String, errors::AppleSdkRootError<'_>> {

0 commit comments

Comments
 (0)