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

build: add support of Darwin arm64 (Apple Silicon chipset) for native mode and cross-compile #86

Merged
merged 12 commits into from
Nov 10, 2024

Conversation

DeckerSU
Copy link
Owner

@DeckerSU DeckerSU commented Nov 10, 2024

This PR enables users to build KomodoOcean for the arm64-apple-darwin triplet (Darwin aarch64). The build is supported for both cross-compilation and native compilation for Apple Silicon chips. It was tested with the following environment:

sw_vers && pkgutil --pkg-info=com.apple.pkg.CLTools_Executables && clang --version
...
ProductName:		macOS
ProductVersion:		15.1
BuildVersion:		24B83
package-id: com.apple.pkg.CLTools_Executables
version: 16.1.0.0.1.1729049160
volume: /
location: /
install-time: 1731199973
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

If you’ve just upgraded from an earlier OS version to macOS Sequoia, you may need to reinstall XCode Command Line Tools as described here.

Also, note that if you are building natively for arm64 macOS, the build script will prompt you to upgrade Berkeley DB to 6.2.32. This version is still under testing, so proceed at your own risk. Be sure to back up your wallet.dat file before using the daemon or wallet with the updated BDB version.

The zcutil directory now includes the following additional build scripts:

  • build-mac.sh - Native build for macOS x86_64. (If building on Apple Silicon, use arch -x86_64 zsh before starting the build to switch architecture / use Rosetta). Use this when building directly on a Mac.
  • build-mac-cross.sh - Cross-compile on Linux for macOS x86_64. This will produce Mach-O 64-bit x86_64 executable binaries.
  • build-mac-arm.sh - Native build for macOS aarch64. Use this on an Apple Silicon Mac to perform a native build and obtain Mach-O 64-bit executable arm64 binaries.
  • build-mac-arm-cross.sh - Cross-compile from Linux for macOS aarch64.
  • build-aarch64-cross.sh - Cross-compile for generic aarch64 targets.

These scripts help streamline the build process across different architectures and operating environments.

@DeckerSU DeckerSU merged commit 1e4f5ec into static-experimental Nov 10, 2024
1 check passed
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.

1 participant