Repository navigation
fix: macOS ARM64 + Xcode 26+ Hunter package compatibility - #18
Open
pgarciagon wants to merge 5 commits into
Open
pgarciagon wants to merge 5 commits into
pgarciagon wants to merge 5 commits into
Conversation
Four Hunter package fixes to allow koinos-cmake consumers to build natively on Apple Silicon (arm64) with Xcode 16+/libc++ 26+: - fizzy: use pgarciagon/fizzy fix/macos-libcxx26-char-traits; wraps bytes.hpp in clang diagnostic pragma to suppress char_traits<uint8_t> deprecation (hard error on Xcode 26 beta) - ZLIB: use pgarciagon/zlib fix/macos-fdopen-conflict; guards fdopen() NULL macro in zutil.h with !defined(__APPLE__) to avoid conflict with macOS stdio.h declaration - rocksdb: append -march=armv8-a+crc+crypto to CXX/C flags; PORTABLE=ON does not auto-detect ARM CRC when a toolchain file is active - libsecp256k1-vrf: pass GMP_LIBRARY/GMP_INCLUDE_DIR pointing at Homebrew /opt/homebrew (Apple Silicon prefix); FindGMP.cmake only searches /usr/local by default
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e _GNU_SOURCE Replaces the local-only file:// darwin-patched tarball with a committable GitHub fork pin (pgarciagon/koinos-exception-cpp) that declares BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED before the Boost includes in exception.hpp. This is one of the two macOS ARM64 gaps not yet covered by this branch's committable config (the other is abseil, still under investigation). Same fork-pin pattern as the fizzy and ZLIB entries; revert to the canonical URL once the upstream koinos-exception-cpp PR merges. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…corruption) fizzy defaults to C++17 while koinos consumers build at C++20 (KoinosCompilerOptions). Verified from the built flags: fizzy compiled -std=c++17, koinos-chain -std=c++20. That standard mismatch gives fizzy's public types (Module and its nested std containers) a different ABI/layout across the fizzy/consumer translation-unit boundary, corrupting memory at runtime — observed as EXC_BAD_ACCESS (SIGBUS) in fizzy::Module::~Module during module_cache teardown, and as the read_contract_tests baseline crash. Pin CMAKE_CXX_STANDARD=20 for fizzy, matching abseil's existing entry and the consumer standard. This is the real macOS ARM64 VM crash cause (NOT abseil SSE, which this branch's earlier notes wrongly suspected — the pinned abseil is arm64-safe, and the fault is EXC_BAD_ACCESS not EXC_BAD_INSTRUCTION). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… memory corruption)" This reverts commit e9e0722.
Author
|
Status update from native macOS ARM64 build work — two additional package fixes and one remaining runtime blocker beyond this PR's original four: Added (committable, verified):
Cleared (not a problem):
Remaining runtime blocker (macOS 26 SDK / libc++ 26):
Net: this PR + koinos_exception covers everything needed to build koinos-chain natively on macOS ARM64. Running the VM on the macOS 26 SDK additionally needs the fizzy type replacement. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Building koinos-chain natively on Apple Silicon (arm64) with Xcode 16+ fails in
four different Hunter-managed packages due to macOS/ARM64-specific issues:
bytes.hppusesstd::basic_string<uint8_t>which instantiateschar_traits<unsigned char>, deprecated in libc++ 16+ and a hard error inXcode 26 beta.
zutil.hdefinesfdopen(fd,mode) NULLwheneverTARGET_OS_MACis set. On macOS
TARGET_OS_MACis always true, silently replacing legitimatefdopen()calls withNULL.PORTABLE=ONand a CMake toolchain file, rocksdb's CRCauto-detection does not fire for ARM; the crc32c falls back to software and
the build may fail with strict compiler flags.
FindGMP.cmakesearches/usr/localonly; on AppleSilicon Homebrew installs GMP under
/opt/homebrew, causing configure to fail.Fix
-march=armv8-a+crc+cryptotoCMAKE_CXX_FLAGS/CMAKE_C_FLAGSGMP_LIBRARY/GMP_INCLUDE_DIRpointing at/opt/homebrewThe fizzy and ZLIB entries reference temporary forks while the upstream PRs are
reviewed; they should be reverted to canonical URLs once those PRs are merged.
Testing
Full koinos-chain build on macOS 15, Apple M3, arm64, Xcode 16.3 / Xcode 26 beta.