Skip to content

Build macOS universal binaries - #270

Merged
sunfishcode merged 1 commit into
WebAssembly:mainfrom
type-dance:macos-universal-binaries
Dec 22, 2022
Merged

Build macOS universal binaries#270
sunfishcode merged 1 commit into
WebAssembly:mainfrom
type-dance:macos-universal-binaries

Conversation

@TerrorJack

Copy link
Copy Markdown
Contributor

This PR builds macOS universal binaries on the x86_64-darwin GitHub hosted runners. The same artifacts will work out of the box on either aarch64-darwin or x86_64-darwin. Turns out to be quite easy to implement and doesn't need aarch64-darwin runners. Hopefully closes #221 and allows apple silicon users to use wasi-sdk without rosetta emulation!

Downsides:

  • Larger binary sizes. Though I believe most people can live with this.
  • Longer build times for macOS. This can be solved by adding ccache logic to CI, though that's better suited for another PR.

@TerrorJack

Copy link
Copy Markdown
Contributor Author

The artifacts indeed work on apple m1:

$ otool -L wasm-ld
wasm-ld (architecture x86_64):
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)
wasm-ld (architecture arm64):
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)
$ ./wasm-ld --version
LLD 15.0.6
$ uname -a
Darwin build02 21.6.0 Darwin Kernel Version 21.6.0: Sat Jun 18 17:05:47 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T8101 arm64 arm Darwin

@sunfishcode

Copy link
Copy Markdown
Member

Looks good; thanks!

@sunfishcode
sunfishcode merged commit 9173dd9 into WebAssembly:main Dec 22, 2022
@TerrorJack
TerrorJack deleted the macos-universal-binaries branch December 22, 2022 02:06
@aykevl aykevl mentioned this pull request Apr 14, 2024
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.

Add release binary for Mac m1 - apple silicon platform

2 participants