Home

Awesome

bootstrap-zig

The purpose of this project is to start with minimum system dependencies and end with a fully operational Zig compiler for any target.

Version Information

This repository copies sources from upstream. Patches listed below. Use git to find and inspect the patch diffs.

For other versions, check the git tags of this repository.

Patches

Host System Dependencies

Build Instructions

./build <arch>-<os>-<abi> <mcpu>

All parameters are required:

Please be aware of the following two CMake environment variables that can significantly affect how long it takes to build:

When it succeeds, output can be found in out/zig-<triple>-<cpu>/.

Windows Build Instructions

Bootstrapping on Windows with MSVC is also possible via build.bat, which takes the same arguments as build above.

This script requires that the "C++ CMake tools for Windows" component be installed via the Visual Studio installer.

The script must be run within the Developer Command Prompt for VS 2019 shell:

build.bat <arch>-<os>-<abi> <mcpu>

To build for x86 Windows, run the script within the x86 Native Tools Command Prompt for VS 2019.

Supported Triples

If you try a "not tested" one and find a problem please file an issue, and a pull request linking to the issue in the table.

If you try a "not tested" one and find that it works, please file a pull request changing the status to "OK".

If you try an "OK" one and it does not work, please check if there is an existing issue, and if not, file an issue.

Note: Generally, for Linux targets, we prefer the musl libc builds over the glibc builds here, because musl builds end up producing a static binary, which is more portable across Linux distributions.

triplesupport status
aarch64-linux-gnuOK
aarch64-linux-muslOK
aarch64-macos-noneOK
aarch64-windows-gnuOK
aarch64_be-linux-gnuOK
aarch64_be-linux-muslOK
arm-linux-gnueabiOK
arm-linux-gnueabihfOK
arm-linux-musleabiOK
arm-linux-musleabihfOK
armeb-linux-gnueabiOK
armeb-linux-gnueabihfOK
armeb-linux-musleabiOK
armeb-linux-musleabihfOK
loongarch64-linux-gnuOK
loongarch64-linux-gnusfOK
loongarch64-linux-muslOK
mips-linux-gnueabiOK
mips-linux-gnueabihfOK
mips-linux-musleabiOK
mips-linux-musleabihfOK
mips64-linux-gnuabi64OK
mips64-linux-gnuabin32OK
mips64-linux-muslabi64OK
mips64-linux-muslabin32OK
mips64el-linux-gnuabi64OK
mips64el-linux-gnuabin32OK
mips64el-linux-muslabi64OK
mips64el-linux-muslabin32OK
mipsel-linux-gnueabiOK
mipsel-linux-gnueabihfOK
mipsel-linux-musleabiOK
mipsel-linux-musleabihfOK
powerpc-linux-gnueabiOK
powerpc-linux-gnueabihfOK
powerpc-linux-musleabiOK
powerpc-linux-musleabihfOK
powerpc64-linux-gnu#113
powerpc64-linux-muslOK
powerpc64le-linux-gnuOK
powerpc64le-linux-muslOK
riscv32-linux-gnuOK
riscv32-linux-muslOK
riscv64-linux-gnuOK
riscv64-linux-muslOK
s390x-linux-gnuOK
s390x-linux-muslOK
sparc-linux-gnu#117
sparc64-linux-gnu#172
thumb-linux-musleabiOK
thumb-linux-musleabihfOK
thumb-windows-gnuOK
thumbeb-linux-musleabiOK
thumbeb-linux-musleabihfOK
x86-linux-gnuOK
x86-linux-muslOK
x86-windows-gnuOK
x86_64-freebsd-none#45
x86_64-linux-gnuOK
x86_64-linux-gnux32OK
x86_64-linux-muslOK
x86_64-linux-muslx32OK
x86_64-macos-noneOK
x86_64-netbsd-none#71
x86_64-windows-gnuOK

Other Notable Targets Known to Work