feat: add Windows ARM64 and FreeBSD amd64 support#32
Merged
Conversation
Extend AAPCS64 ARM64 implementation to Windows by adding 'windows' to build constraints. Windows ARM64 uses identical calling convention to Unix ARM64 (confirmed by Microsoft docs, purego, and libffi). No new assembly needed — runtime.cgocall works on Windows without fakecgo (Go runtime explicitly exempts Windows from iscgo check). Changes: - Rename call_unix.go -> call_arm64.go (now serves 3 OS) - Rename syscall_unix_arm64.go/s -> syscall_arm64.go/s - Extend dl_windows.go and callback_windows.go to all GOARCH Resolves #31
Adds a cross-compile job that builds for all supported targets: linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64, windows/arm64, freebsd/amd64. This catches build tag errors for platforms without native CI runners (Windows ARM64 has no GitHub Actions runner available).
…ure) freebsd/amd64 fails cross-compilation due to: - fakecgo/freebsd.go: cgo_export_dynamic not allowed with CGO_ENABLED=0 - amd64 Execute method missing for freebsd (build tag excludes it) This is a pre-existing issue unrelated to Windows ARM64 changes. Tracked in #32.
FreeBSD uses System V AMD64 ABI (identical to Linux) but differs in: - dlopen/dlsym live in libc.so.7 (not libdl.so.2) - RTLD_DEFAULT matches macOS value, not Linux - fakecgo requires -gcflags="...=-std" for cgo_export_dynamic Changes: - Add internal/dl/dl_freebsd.go (RTLD constants) - Add internal/dl/dl_freebsd_nocgo.go (libc.so.7 imports) - Extend build tags in 15 files to include freebsd - CI cross-compile includes freebsd/amd64 with gcflags workaround
- README: platform table updated (7 targets), roadmap v0.5.0 entry - ARCHITECTURE.md: platform matrix with Windows ARM64 and FreeBSD - CHANGELOG: v0.5.0 entry with all changes
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
libc.so.7dynamic loading (dl_freebsd.go,dl_freebsd_nocgo.go). Extended 15+ build tags to includefreebsdKey findings from research
syscall.SyscallNis broken for float args on ARM64 Windows (Go runtime TODO inasmstdcall) -- usedruntime.cgocallinsteadruntime.cgocallworks on Windows without fakecgo (cgocall.go:135explicitly exempts Windows)libc.so.7(notlibdl.so.2), requires-gcflagsfor fakecgoPlatform support: 6 -> 7 targets
Resolves #31
Test plan
go fmt ./...clean.claude/,docs/dev/,tmp/)