You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I haven't tried with Zig directly for an equivalent Hello World program, at a glance it looks like Zig supports static builds just fine. (EDIT:zig build vs zig cc is a different story it seems)
It's more likely to be an incompatibility with how cargo-zigbuild is implemented? libgcc / gcc_eh are related to internals with the rust compiler or cargo IIRC. Perhaps there is some logic there that needs to be carried over to cargo-zigbuild 🤷♂️
EDIT: I am partially wrong.
While those files to link are related to the cargo build, Zig cannot compile a basic hello.c with static linking (the advice there doesn't seem to apply to libc.a as it'd compile but segfault when run on the same build host).
Zig needs to fix their cc static build support before cargo-zigbuild can do anything about it.
Zig Version
0.11.0
Steps to Reproduce and Observed Behavior
Hi! I am trying to statically cross-compile Ruff from Linux to Linux-ARM (aarch64-unknown-linux-gnu). At the linking stage with command
TARGET=aarch64-unknown-linux-gnu PKG_CONFIG_ALLOW_CROSS=1 cargo zigbuild --release --target=$TARGET --verbose
I get an error
I have config.toml like this:
The maintainer of cargo-zigbuild advised me to open an issue here
rust-cross/cargo-zigbuild#186
Expected Behavior
Successful build as for Linux-x86_64
The text was updated successfully, but these errors were encountered: