π ForgeZero Now Supports musl Cross-Compilation and Objective-C on Linux
I've been spending the last few weeks improving ForgeZero, adding support for more toolchains and making cross-platform development a little easier.
The latest update introduces two features that I wanted for quite some time:
- β musl cross-compilation powered by the Zig toolchain
- β Objective-C support on Linux with automatic compiler and linker selection
The best part? No additional configuration is required.
Just write your code and let ForgeZero handle the rest.
Static musl Builds
ForgeZero can now generate fully static musl binaries, making cross-compilation almost effortless.
fz -cc main.c -musl=riscv64 -toolchain zig
The resulting binary:
main: ELF 64-bit LSB executable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), statically linked, with debug_info, not stripped
Static binaries are incredibly useful when building:
- π³ Minimal Docker images (
scratch) - π¦ Portable standalone executables
- π Embedded & IoT applications
- π₯οΈ Systems without glibc
- π Cross-platform deployment pipelines
Using Zig as the backend compiler makes targeting different architectures surprisingly simple while keeping the ForgeZero interface exactly the same.
Objective-C on Linux
This is probably the feature I'm most excited about.
ForgeZero now automatically detects .m Objective-C source files and switches to the correct compilation pipeline without requiring any flags.
fz -cc main.m
Verbose output:
Objective-C detected!
Bypassing Zig linker to use Clang with -lobjc
Running:
clang main.o -o main -lobjc -Wl,--build-id=none
Built: main
No custom scripts.
No Makefiles.
No manually remembering linker flags.
ForgeZero simply detects the language and invokes the correct backend automatically.
Why Objective-C?
Most developers associate Objective-C exclusively with macOS and Apple's ecosystem.
However, GNU Objective-C works perfectly fine on Linux through Clang and libobjc.
Supporting it means ForgeZero can now build another systems programming language using exactly the same interface as C or Assembly:
fz -cc hello.c
fz -cc hello.m
fz -asm boot.asm
The command stays the sameβthe build pipeline adapts automatically.
Where ForgeZero is Going
ForgeZero originally started as a tiny utility to avoid typing endless compiler and linker commands.
Over time, it has evolved into a unified build frontend capable of orchestrating multiple toolchains while automatically selecting the right backend for the current source language.
The philosophy remains simple:
Write code, run one command, and let the build system figure out the details.
There's still a lot of work ahead, but I'm happy with the direction the project is taking.
Links
β GitHub & Documentation:
https://github.com/forgezero-cli/forgezero
π€ Author:
https://github.com/alexvoste
Feedback, ideas, and contributions are always welcome.

Top comments (0)