Skip to content

Commit 3ceda16

Browse files
committed
Add /System/iOSSupport to the library search path on Mac Catalyst
1 parent d7bd9cd commit 3ceda16

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,6 +2946,16 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
29462946
}
29472947
_ => unreachable!(),
29482948
}
2949+
2950+
if llvm_target.contains("macabi") {
2951+
// Mac Catalyst uses the macOS SDK, but to link to iOS-specific
2952+
// frameworks, we must have the support library stubs in the library
2953+
// search path.
2954+
2955+
// The flags are called `-L` and `-F` both in Clang, ld64 and ldd.
2956+
cmd.arg(format!("-L{sdk_root}/System/iOSSupport/usr/lib"));
2957+
cmd.arg(format!("-F{sdk_root}/System/iOSSupport/System/Library/Frameworks"));
2958+
}
29492959
}
29502960

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

0 commit comments

Comments
 (0)