Hi All! so far I came across this misunderstanding regarding building system and how I can tune it. The problem arises when I try cross-compile my console app. for several platforms looping them in build.zig.
When it comes to compiling for freebsd (even at freebsd host), strange error happens. It can be reproduced both with stocked 0.13 zig as well as master’s 0.14 versions.
The simplest way to reproduce is replace
const target = b.standardTargetOptions(.{});
with
const target = b.resolveTargetQuery(.{ .abi = .gnu, .os_tag = .freebsd, .cpu_arch = .x86_64 });
right after initialization of blank project with zig init.
The target triplet (as I expect) true for native host compilation target @ freebsd host.
As as sidenote, I see that zig targets strangely resolves freebsd’s triplet as
...
"native": {
"triple": "x86_64-freebsd.15.0.23...15.0.23-gnu",
...
Are there any rakes around I have missed?
UPD: same error about missing libc even if I specify min/max versions of OS, which seems must sutisy my particular case:
const target = b.resolveTargetQuery(.{ .abi = .gnu, .os_tag = .freebsd, .cpu_arch = .x86_64, .os_version_min = .{ .semver = .{ .major = 15, .minor = 0, .patch = 23 } }, .os_version_max = .{ .semver = .{ .major = 15, .minor = 0, .patch = 23 } } });
error:
error: libc not available
note: run 'zig libc -h' to learn about libc installations
note: run 'zig targets' to see the targets for which zig can always provide libc
error: the following command failed with 22 compilation errors:
/usr/local/bin/zig build-exe -ODebug -target x86_64-freebsd.15.0.23...15.0.23-gnu -mcpu baseline -Mroot=/home/ws/p/fbsd-zig/src/main.zig --cache-dir /home/ws/p/fbsd-zig/.zig-cache --global-cache-dir /home/ws/.cache/zig --name fbsd-zig --listen=-
Build Summary: 2/5 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
+- install fbsd-zig transitive failure
+- zig build-exe fbsd-zig Debug x86_64-freebsd.15.0.23...15.0.23-gnu 22 errors