fix: add FreeBSD ARM64 support (v0.5.3)#53
Merged
Merged
Conversation
Add freebsd to build tags in 4 files that were missing it: - internal/arch/arm64/call_arm64.go (root cause of #52) - internal/syscall/syscall_arm64.go - internal/syscall/syscall_arm64.s - ffi/callback_arm64.s (hidden bug: Go side had freebsd, asm did not) FreeBSD ARM64 uses identical AAPCS64 calling convention as Linux ARM64. No code changes needed — purely build tag additions. CI cross-compilation check now validates all 8 platforms. Platform count: 7 → 8 targets.
Add explicit comments explaining that go vet warnings on lines 52 and 84 are false positives — Windows DLL handles and function pointers are OS values, not Go heap pointers.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
freebsdto build tags in 4 files (Fails to build under FreeBSD / arm #52)ffi/callback_arm64.swas missingfreebsdwhile Go side already included it —NewCallback()would silently return invalid addresses on FreeBSD ARM64Details
FreeBSD ARM64 uses the identical AAPCS64 calling convention as Linux ARM64 — no code changes needed, purely build tag additions. Confirmed by ARM IHI 0055 specification and purego reference (identical approach in their FreeBSD ARM64 support commit).
Files changed (build tags):
internal/arch/arm64/call_arm64.golinux || darwin || windows+ freebsdinternal/syscall/syscall_arm64.golinux || darwin || windows+ freebsdinternal/syscall/syscall_arm64.slinux || darwin || windows+ freebsdffi/callback_arm64.slinux || darwin+ freebsdVerification: All 8 platforms cross-compile successfully:
Test plan
GOOS=freebsd GOARCH=arm64passesgo vetclean (pre-existingdl_windows.gowarnings unchanged)Closes #52