Latest zig from master can cross-compile to FreeBSD 14

Zig 0.15.0-dev provides all FreeBSD 14 system headers, libc headers and stub libraries for libc. Zig now allows cross-compiling, targeting all FreeBSD 14.x supported platforms.

Support dynamically-linked FreeBSD libc when cross-compiling #23835


You must specify freebsd.14.0 or newer, because the default target is freebsd.13 and the included libc is for version 14 or newer.
e.g.

zig build-exe test.zig -target aarch64-freebsd.14.0
9 Likes

I can’t find the PR, but it looks like you can also cross compile for dynamically linked linux-musl now too (which isn’t the case for 0.14.0 and earlier). It was never very hard to pull and build the musl repo to use as a sysroot, but I always thought it was weird that it wasn’t supported out of the box.