Skip to content

Latest commit

History

119 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

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.

  • LLVM 12.0.0-rc3
  • Clang 12.0.0-rc3
  • LLD 12.0.0-rc3
  • Zig master branch (check the build script for the specific revision. It will will be zig 0.8.0 when the release is tagged)

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

Patches

  • Remove unused test/ files in order to make tarball less bloated.
  • LLD: add additional include directory to Zig's libunwind.

Host System Dependencies

  • C++ compiler capable of building LLVM, Clang, and LLD from source
  • cmake 3.4.3 or later
  • make
  • POSIX system (bash, mkdir, cd)
  • Python

Build Instructions

build -j1 <arch>-<os>-<abi> baseline

All parameters are required:

  • -j1: Replace with your jobs parameter to make.
  • <arch>-<os>-<abi>: Replace with one of the Supported Triples below, or use native for the <arch> value (e.g. native-linux-gnu) to use the native architecture.
  • baseline: Replace with a -mcpu parameter of Zig. baseline means it will target a generic CPU for the target. native means it will target the native CPU. See the Zig documentation for more details.

If it succeeds, the output will be in out/zig-triple-mcpu/.

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_be-linux-gnunot tested
aarch64_be-linux-muslnot tested
aarch64_be-windows-gnunot tested
aarch64-linux-gnuOK
aarch64-linux-muslOK
aarch64-windows-gnunot tested
aarch64-macos-gnu#44
armeb-linux-gnueabinot tested
armeb-linux-gnueabihfnot tested
armeb-linux-musleabinot tested
armeb-linux-musleabihfnot tested
armeb-windows-gnunot tested
arm-linux-gnueabinot tested
arm-linux-gnueabihfnot tested
arm-linux-musleabiOK
arm-linux-musleabihfOK
arm-windows-gnunot tested
i386-linux-gnunot tested
i386-linux-muslOK
i386-windows-gnuOK
mips64el-linux-gnuabi64not tested
mips64el-linux-gnuabin32not tested
mips64el-linux-musl#3
mips64-linux-gnuabi64not tested
mips64-linux-gnuabin32not tested
mips64-linux-muslnot tested
mipsel-linux-gnunot tested
mipsel-linux-musl#12
mips-linux-gnunot tested
mips-linux-muslnot tested
powerpc64le-linux-gnu#24
powerpc64le-linux-musl#5
powerpc64-linux-gnunot tested
powerpc64-linux-muslnot tested
powerpc-linux-gnunot tested
powerpc-linux-muslnot tested
riscv64-linux-gnunot tested
riscv64-linux-muslOK
s390x-linux-gnunot tested
s390x-linux-muslnot tested
sparc-linux-gnunot tested
sparcv9-linux-gnuziglang/zig#4931
x86_64-freebsd-gnu#45
x86_64-linux-gnuOK
x86_64-linux-gnux32#20
x86_64-linux-muslOK
x86_64-windows-gnuOK
x86_64-macos-gnu#38

Other Notable Targets Known to Work

  • arm-linux-musleabi with mcpu value of generic+v6kz. This produces a build of Zig that runs on the RPi 1 and RPi Zero.
    • If you want to produce a build for this CPU exactly, use arm1176jzf_s.

About

take off every zig

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages