-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IPHONEOS_DEPLOYMENT_TARGET
on Mac Catalyst
#121296
Fix IPHONEOS_DEPLOYMENT_TARGET
on Mac Catalyst
#121296
Conversation
Mac Catalyst uses IPHONEOS_DEPLOYMENT_TARGET to specify the deployment target, so it makes no sense to remove that variable.
Failed to set assignee to
|
These commits modify compiler targets. |
r? shepmaster (Since you're in @rust-lang/macos as stated here) |
pub fn ios_llvm_target(arch: Arch) -> String { | ||
// Modern iOS tooling extracts information about deployment target | ||
// from LC_BUILD_VERSION. This load command will only be emitted when | ||
// we build with a version specific `llvm_target`, with the version | ||
// set high enough. Luckily one LC_BUILD_VERSION is enough, for Xcode | ||
// to pick it up (since std and core are still built with the fallback | ||
// of version 7.0 and hence emit the old LC_IPHONE_MIN_VERSION). | ||
let (major, minor) = ios_deployment_target(arch); | ||
let (major, minor) = ios_deployment_target(arch, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels a bit odd to use an empty string when we have Option
available to us. Is this string defined at a higher level and changing it would be as pain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly just tried to follow the existing conventions for the abi
value, but agree that this should change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have opened #124762 to fix part of this now
add_link_args_iter( | ||
&mut args, | ||
LinkerFlavor::Darwin(Cc::Yes, Lld::No), | ||
["-target".into(), mac_catalyst_llvm_target(arch).into()].into_iter(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's not your code, but I wish this function took impl IntoIterator
. Maybe a future cleanup.
Thank you for the well-prepared commit sequence! @bors r+ rollup=iffy |
This got reverted fwiw because it turns out rust's default versions don't align well with Apple's SDKs and other third-party C libraries. It shouldn't matter through because That should be corrected eventually but at least this doesn't make that harder. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (7d61394): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 639.836s -> 638.5s (-0.21%) |
Some of the target code invalidly assumed that the deployment target variable on Mac Catalyst is
MACOSX_DEPLOYMENT_TARGET
, which is wrong, Mac Catalyst uses the same environment variable as iOS.Additionally, the deployment target was hardcoded to
14.0
, I've lowered this to13.1
(same default as Clang), and made it properly load from the environment.This shouldn't require any changes to the
cc
crate, as that usesrustc --print=deployment-target
to get this information automatically.CC @BlackHoleFox
r? @rust-lang/macos