Skip to content

fix(build): ELF-aware ar/ranlib for the aarch64 cross build on macOS hosts - #1209

Merged
michalharakal merged 1 commit into
developfrom
fix/cross-arm64-elf-ar
Aug 29, 2026
Merged

michalharakal merged 1 commit into
developfrom
fix/cross-arm64-elf-ar

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Found while validating the transformers 0.51 migration against a locally published snapshot: on a macOS host the aarch64 cross build's static archive was silently empty (BSD ar/ranlib emit just a __.SYMDEF from ELF objects), so published linuxArm64 klibs shipped without the C kernels and consumers failed at link with undefined symbol: skainet_q4k_matmul et al.

  • toolchain-aarch64.cmake resolves CMAKE_AR/CMAKE_RANLIB (overridable via -DSKAINET_AARCH64_AR/-DSKAINET_AARCH64_RANLIB, preferring llvm-ar).
  • The gradle configure task forwards matching -PskainetAarch64Ar/Ranlib properties — e.g. Konan's bundled llvm-ar plus a one-line ranlib wrapper on a Mac.

Verified: archive goes 96 B → 57 KB with all symbols (_rm twins included); a linuxArm64 consumer executable links clean against the republished snapshot. Linux CI hosts are unaffected (their default ar handles ELF; find_program picks the same tools as before).

🤖 Generated with Claude Code

…hosts

The cross toolchain file set only the compiler; on a macOS host CMake then
used /usr/bin/ar + ranlib, which silently produce an EMPTY static archive
from cross-compiled ELF objects (just a __.SYMDEF) — published linuxArm64
klibs shipped without the C kernels, and consumers died at link with
"undefined symbol: skainet_q4k_matmul" et al.

toolchain-aarch64.cmake now resolves CMAKE_AR/CMAKE_RANLIB (overridable via
-DSKAINET_AARCH64_AR/-DSKAINET_AARCH64_RANLIB, preferring llvm-ar), and the
gradle configure task forwards the matching -PskainetAarch64Ar/Ranlib
properties — e.g. Konan's bundled llvm-ar on a Mac.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@michalharakal
michalharakal merged commit a47b095 into develop Aug 29, 2026
17 checks passed
@michalharakal
michalharakal deleted the fix/cross-arm64-elf-ar branch August 29, 2026 20:32
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