# Latest zig from master can cross-compile to FreeBSD 14

**URL:** <https://ziggit.dev/t/latest-zig-from-master-can-cross-compile-to-freebsd-14/10081>\
**Category:** News\
**Tags:** cross-compile\
**Created:** [May 12, 2025, 8:11pm UTC](https://ziggit.dev/t/latest-zig-from-master-can-cross-compile-to-freebsd-14/10081 "2025-05-12T20:11:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimdin](https://ziggit.dev/user_avatar/ziggit.dev/dimdin/32/1457_2.png) [@dimdin](https://ziggit.dev/u/dimdin)\
**Post date:** [May 12, 2025, 8:11pm UTC](https://ziggit.dev/t/latest-zig-from-master-can-cross-compile-to-freebsd-14/10081/1 "2025-05-12T20:11:14Z")

</div>

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](https://www.freebsd.org/platforms/).

→ [Support dynamically-linked FreeBSD libc when cross-compiling #23835](https://github.com/ziglang/zig/pull/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
zig build-exe test.zig -target aarch64-freebsd.14.0

```

---

<div class="post-metadata">

**Author:** ![permutationlock](https://ziggit.dev/user_avatar/ziggit.dev/permutationlock/32/9958_2.png) [@permutationlock](https://ziggit.dev/u/permutationlock)\
**Post date:** [May 12, 2025, 9:28pm UTC](https://ziggit.dev/t/latest-zig-from-master-can-cross-compile-to-freebsd-14/10081/2 "2025-05-12T21:28:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dimdin](https://ziggit.dev/user_avatar/ziggit.dev/dimdin/32/1457_2.png) [@dimdin](https://ziggit.dev/u/dimdin)\
**Post date:** [May 21, 2025, 6:32am UTC](https://ziggit.dev/t/latest-zig-from-master-can-cross-compile-to-freebsd-14/10081/3 "2025-05-21T06:32:06Z")

</div>

From zig Devlog: [FreeBSD and NetBSD Cross-Compilation Support](https://ziglang.org/devlog/2025/#2025-05-20)
