fix(build): ELF-aware ar/ranlib for the aarch64 cross build on macOS hosts - #1209
Merged
Merged
Conversation
…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>
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.
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
__.SYMDEFfrom ELF objects), so published linuxArm64 klibs shipped without the C kernels and consumers failed at link withundefined symbol: skainet_q4k_matmulet al.toolchain-aarch64.cmakeresolvesCMAKE_AR/CMAKE_RANLIB(overridable via-DSKAINET_AARCH64_AR/-DSKAINET_AARCH64_RANLIB, preferringllvm-ar).-PskainetAarch64Ar/Ranlibproperties — e.g. Konan's bundledllvm-arplus a one-line ranlib wrapper on a Mac.Verified: archive goes 96 B → 57 KB with all symbols (
_rmtwins included); a linuxArm64 consumer executable links clean against the republished snapshot. Linux CI hosts are unaffected (their default ar handles ELF;find_programpicks the same tools as before).🤖 Generated with Claude Code