
Recent changes to ForgeZero introduce two new build targets:
- musl libc cross-compilation through the Zig toolchain
- Objective-C compilation support on Linux
The goal is not to add another compiler frontend, but to keep a single command-line interface while selecting the appropriate backend automatically.
musl Targets
ForgeZero can now build statically linked musl binaries for supported architectures.
Example:
fz -cc main.c -musl=riscv64 -toolchain zig
Result:
main: ELF 64-bit LSB executable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), statically linked, with debug_info, not stripped
The implementation uses the Zig toolchain as a cross compiler while exposing a consistent ForgeZero interface.
Typical use cases include:
- static deployment
- container images
- embedded systems
- cross-compilation without a dedicated sysroot
- portable binaries
No changes are required to existing build scripts besides selecting the musl target.
Objective-C Detection
ForgeZero now recognizes Objective-C source files (.m) and automatically switches to the Clang frontend and Objective-C runtime linker.
Example:
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
The language detection is automatic.
There is no separate Objective-C mode or dedicated command. Source type determines the compilation pipeline.
Unified Build Interface
The same interface can now be used for multiple languages:
fz -cc hello.c
fz -cc hello.m
fz -asm boot.asm
ForgeZero selects the compiler, linker and runtime based on the source file and requested target instead of requiring the user to manage toolchain details manually.
This behavior will be extended to additional languages and targets in future releases.
Repository
GitHub: https://github.com/forgezero-cli/forgezero
Author: https://github.com/alexvoste