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

Use the target triple from the C++ toolchain instead of deriving it from values in the Apple configuration fragment. #858

Conversation

keith
Copy link
Member

@keith keith commented Jul 7, 2022

When using --host_cpu=darwin_x86_64 on an ARM (Apple Silicon) host, the value returned by the Apple configuration fragment is wrong, and we end up compiling Swift for arm64. Since the C++ toolchain already has the correct triple verbatim as we want it in the target_gnu_system_name field, just use that, and add some generally useful utilities for manipulating the triples and their components.

Note to open-source rules maintainers: This change requires/assumes that your C++ toolchain configuration returns a complete target triple that includes minimum OS version and target environment; for example, x86_64-apple-ios13.0-simulator.

PiperOrigin-RevId: 429897884
(cherry picked from commit 62b33ed)

…rom values in the Apple configuration fragment.

When using `--host_cpu=darwin_x86_64` on an ARM (Apple Silicon) host, the value returned by the Apple configuration fragment is wrong, and we end up compiling Swift for `arm64`. Since the C++ toolchain already has the correct triple verbatim as we want it in the `target_gnu_system_name` field, just use that, and add some generally useful utilities for manipulating the triples and their components.

Note to open-source rules maintainers: This change requires/assumes that your C++ toolchain configuration returns a complete target triple that includes minimum OS version and target environment; for example, `x86_64-apple-ios13.0-simulator`.

PiperOrigin-RevId: 429897884
(cherry picked from commit 62b33ed)
@keith
Copy link
Member Author

keith commented Jul 7, 2022

#768

@keith keith closed this Jul 7, 2022
@keith keith deleted the ks/use-the-target-triple-from-the-c-toolchain-instead-of-deriving-it-from-values-in-the-apple-configuration-fragment branch July 7, 2022 00:27
@keith keith restored the ks/use-the-target-triple-from-the-c-toolchain-instead-of-deriving-it-from-values-in-the-apple-configuration-fragment branch July 7, 2022 16:18
@keith keith reopened this Jul 7, 2022
@keith keith marked this pull request as ready for review July 7, 2022 16:19
@keith keith enabled auto-merge (rebase) July 7, 2022 16:20
@keith
Copy link
Member Author

keith commented Jul 7, 2022

we can take this one after all

@keith keith merged commit 2546e60 into master Jul 7, 2022
@keith keith deleted the ks/use-the-target-triple-from-the-c-toolchain-instead-of-deriving-it-from-values-in-the-apple-configuration-fragment branch July 7, 2022 17:02
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.

3 participants