Skip to content
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

Always specify architecture for x86_64 / aarch64 Darwin #527

Merged
merged 1 commit into from Jul 8, 2020

Conversation

shepmaster
Copy link
Member

@shepmaster shepmaster commented Jul 8, 2020

This has a few benefits. The first is that it's not required to
specify CFLAGS_aarch64_apple_darwin='-arch arm64' when
cross-compiling from x86_64 to aarch64 (or -arch x86_64 the other
way around).

Another is that the cc frontend performs some snooping of the
process hierarchy — if any parent is running in the Rosetta emulation
layer, it will default to targeting x86_64. This means that running
cc on a Developer Transition Kit is likely to suddenly and magically
revert to x86_64 if any piece of the chain is emulated (rustc,
cargo, rustup, the shell, even the terminal emulator!).

It's likely that the -m64 option is superfluous with these new
options, but I don't see any harm in it either.

This has a few benefits. The first is that it's not required to
specify `CFLAGS_aarch64_apple_darwin='-arch arm64'` when
cross-compiling from x86_64 to aarch64 (or `-arch x86_64` the other
way around).

Another is that the `cc` frontend performs some snooping of the
process hierarchy — if any parent is running in the Rosetta emulation
layer, it will default to targeting x86_64. This means that running
`cc` on a Developer Transition Kit is likely to suddenly and magically
revert to x86_64 if any piece of the chain is emulated (`rustc`,
`cargo`, `rustup`, the shell, even the terminal emulator!).

It's likely that the `-m64` option is superfluous with these new
options, but I don't see any harm in it either.
@alexcrichton
Copy link
Member

👍

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants