Skip to content

Fix crosscompiling for x86_64 on ARM64 macOS#15001

Merged
BillyONeal merged 1 commit intomicrosoft:masterfrom
orudge:fix-crosscompile-arm64-macos
Dec 9, 2020
Merged

Fix crosscompiling for x86_64 on ARM64 macOS#15001
BillyONeal merged 1 commit intomicrosoft:masterfrom
orudge:fix-crosscompile-arm64-macos

Conversation

@orudge
Copy link
Copy Markdown
Contributor

@orudge orudge commented Dec 8, 2020

The x64-osx triplet does not explicitly specify the x86_64 architecture in the OSX_ARCHITECTURES variable. This means that CMake-based projects can in some cases incorrectly produce arm64 binaries instead of x86_64, if building on an arm64 platform.

I found an update of CMake was also necessary to incorporate some Apple Silicon-related fixes in order to build the ports I was having trouble with (libpng primarily, though there are additional issues with libpng that I will submit in a separate pull request).

@orudge orudge force-pushed the fix-crosscompile-arm64-macos branch from b222eec to e605719 Compare December 8, 2020 10:29
@orudge
Copy link
Copy Markdown
Contributor Author

orudge commented Dec 8, 2020

It looks like there's a separate PR (#14716) for updating CMake (which looks to be the cause of some of the build failures/regressions), so I'll remove that commit from my branch and just include the triplet change here.

@orudge orudge force-pushed the fix-crosscompile-arm64-macos branch from e605719 to 96de55c Compare December 8, 2020 16:38
@JackBoosY JackBoosY self-assigned this Dec 9, 2020
@JackBoosY
Copy link
Copy Markdown
Contributor

I think for arm64, we need a new triplet instead of modifying it. @strega-nil Am I right?

@orudge
Copy link
Copy Markdown
Contributor Author

orudge commented Dec 9, 2020

I think for arm64, we need a new triplet instead of modifying it. @strega-nil Am I right?

Apologies if I’m misunderstanding - there’s already an arm64-osx community triplet which in most cases works fine. This PR is for fixing compilation of x86_64 on an arm64 host, which in some cases may incorrectly produce arm64 binaries due to the macOS arch not being specified in the triplet.

@strega-nil
Copy link
Copy Markdown
Contributor

This is a good change.

@strega-nil strega-nil added info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. and removed requires:discussion labels Dec 9, 2020
@BillyONeal BillyONeal merged commit c670d13 into microsoft:master Dec 9, 2020
@BillyONeal
Copy link
Copy Markdown
Member

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants