Add target_env = "macabi" and target_env = "sim" by madsmtm · Pull Request #139451 · rust-lang/rust (original) (raw)

RFC 2992 (tracking issue) introduced cfg(target_abi = ...) with the original motivation being Mac Catalyst and Apple Simulator targets. These do not actually have a changed calling convention in the same sense that e.g. cfg(target_abi = "eabihf") or pointer authentication (arm64e) does, see #133331.

Specifically, for Apple Simulator targets, the binary runs under the following conditions:

And for Mac Catalyst:

As can be seen, these seem better suited as target_envs, since it really is the environment that the binary is running under that's changed (regardless of the Mac Catalyst "macabi" having "abi" in the name). So this PR adds target_env = "sim" and target_env = "macabi", with the idea of possibly deprecating target_abi = "sim" and target_abi = "macabi" in the far future.

This is affects iOS Tier 2 targets (aarch64-apple-ios-sim, x86_64-apple-ios, aarch64-apple-ios-macabi and x86_64-apple-ios-macabi), and probably needs a compiler FCP.

Fixes #133331.
Reference PR: rust-lang/reference#1781.
Cargo doc PR: rust-lang/cargo#15404.

r? compiler
CC @workingjubilee
CC target maintainers @deg4uss3r @thomcc @badboy @BlackHoleFox @madsmtm @agg23