Skip to content

fix: macOS ARM64 + Xcode 26+ Hunter package compatibility#18

Open
pgarciagon wants to merge 1 commit intokoinos:masterfrom
pgarciagon:fix/macos-arm64
Open

fix: macOS ARM64 + Xcode 26+ Hunter package compatibility#18
pgarciagon wants to merge 1 commit intokoinos:masterfrom
pgarciagon:fix/macos-arm64

Conversation

@pgarciagon
Copy link
Copy Markdown

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:

  1. fizzybytes.hpp uses std::basic_string<uint8_t> which instantiates
    char_traits<unsigned char>, deprecated in libc++ 16+ and a hard error in
    Xcode 26 beta.
  2. ZLIBzutil.h defines fdopen(fd,mode) NULL whenever TARGET_OS_MAC
    is set. On macOS TARGET_OS_MAC is always true, silently replacing legitimate
    fdopen() calls with NULL.
  3. rocksdb — With PORTABLE=ON and a CMake toolchain file, rocksdb's CRC
    auto-detection does not fire for ARM; the crc32c falls back to software and
    the build may fail with strict compiler flags.
  4. libsecp256k1-vrfFindGMP.cmake searches /usr/local only; on Apple
    Silicon Homebrew installs GMP under /opt/homebrew, causing configure to fail.

Fix

The 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.

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
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.

2 participants