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

Fix: Build arm64 binaries for macOS #2988

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

spnda
Copy link
Contributor

@spnda spnda commented Jul 30, 2022

x86_64 binaries cannot be linked when building solely for arm64. This uses the matrix to build separately for x86_64 and arm64. I specifically opted for this instead of building a universal binary as there seems to be no guarantee that universal binary 2 files can be read and understood by older linkers, and the fact that a universal binary will effectively have two copies of the library/executable wasting a considerable amount of space. Also, upgrading the runner to macOS-11 in 457d11e was required for this to work.

@greg-lunarg greg-lunarg added the kokoro:run Trigger Google bot runs label Aug 1, 2022
@kokoro-team kokoro-team removed the kokoro:run Trigger Google bot runs label Aug 1, 2022
@greg-lunarg greg-lunarg self-requested a review August 3, 2022 16:31
Copy link
Contributor

@greg-lunarg greg-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the code!

@greg-lunarg greg-lunarg merged commit de0b1bf into KhronosGroup:master Aug 3, 2022
@greg-lunarg
Copy link
Contributor

greg-lunarg commented Aug 3, 2022

Continuous deployment tests failed for macOS-11 arm64.

The glslang-testsuite failed with multiple such failures:

/Users/runner/work/glslang/glslang/build/StandAlone/glslangValidator: Bad CPU type in executable

The glslang-testsuites test failed with BAD_COMMAND

I will have to revert until we have fixes for this.

@spnda
Copy link
Contributor Author

spnda commented Aug 3, 2022

@greg-lunarg This PR makes it build arm64 binaries. However, the macos-11 and macos-12 GH runners are running on x86_64. They simply cannot run arm64 binaries. The only options currently (besides reverting) would be to either drop tests when running arm64 (easily done by an if condition in the yaml), or wait until GitHub provides arm64-based runners. I personally don't think dropping tests in this case is bad, as they still run and do their job on ubuntu, macos (x86_64), and windows and I don't think there's any architecture exclusive code in the glslang source. And for the GH hosted runners, this may take a while because up until now they've been quite hesitant offering any arm64 runners.

@greg-lunarg
Copy link
Contributor

@spnda I am going to revert until I have come to a decision about how to handle this situation.

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

3 participants