Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 25, 2025. It is now read-only.
/zig-bootstrapPublic archive

take off every zig

NotificationsYou must be signed in to change notification settings

ziglang/zig-bootstrap

Repository files navigation

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

Version Information

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

  • LLVM, LLD, Clang 21.1.0
  • zlib 1.3.1
  • zstd 1.5.2
  • zig 0.16.0-dev.1354+94e98bfe8

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

Patches

  • all: Deleted unused files.
  • LLVM: Support .lib extension for static zstd.
  • LLVM: Portable handling of .def linker flag
  • LLVM: Don't pass -static when building executables.
  • Clang: Ignore the examples directory
  • Clang: Disable building of libclang-cpp.so.
  • Clang: removenvptx-arch andamdgpu-arch symlinks
  • LLD: Added additional include directory to Zig's libunwind.
  • LLD: RespectLLD_BUILD_TOOLS=OFF
  • LLD: Skip building docs
  • zlib: Delete the ability to build a shared library.

Host System Dependencies

  • C++ compiler capable of building LLVM, Clang, and LLD from source (GCC 5.1+or Clang)
    • On some systems, static libstdc++/libc++ may need to be installed
  • CMake 3.19 or later
  • make, ninja, or any other build system supported by CMake
  • POSIX system (bash, mkdir, cd)
  • Python 3

Build Instructions

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

All parameters are required:

  • <arch>-<os>-<abi>: Replace with one of the Supported Targets below, or usenative for the<arch> value (e.g.native-linux-gnu) to use the nativearchitecture.
  • <mcpu>: Replace with a-mcpu parameter of Zig.baseline is recommendedand means it will target a generic CPU for the target.native means itwill target the native CPU. See the Zig documentation for more details.

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

  • CMAKE_GENERATOR can be used to select a different generator instead of thedefault. For example,CMAKE_GENERATOR=Ninja.
  • CMAKE_BUILD_PARALLEL_LEVEL can be used to introduce parallelism to buildsystems (such as make) which do not default to parallel builds. This optionis irrelevant when using Ninja.

When it succeeds, output can be found inout/zig-<target>-<cpu>/.

Windows Build Instructions

Bootstrapping on Windows with MSVC is also possible viabuild.bat, whichtakes the same arguments asbuild above.

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

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

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

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

Supported Targets

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 requestchanging the status to "OK".

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

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

FreeBSD

TargetStatus
aarch64-freebsd-noneOK
arm-freebsd-eabihfOK
powerpc64-freebsd-noneOK
powerpc64le-freebsd-noneOK
riscv64-freebsd-noneOK
x86_64-freebsd-noneOK

Linux

TargetStatus
aarch64-linux-gnuOK
aarch64-linux-muslOK
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
hexagon-linux-musl#215
loongarch64-linux-gnuOK
loongarch64-linux-gnusfOK
loongarch64-linux-muslOK
loongarch64-linux-muslsfOK
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-gnuabin32#214
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-gnuOK
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
thumbeb-linux-musleabiOK
thumbeb-linux-musleabihfOK
x86-linux-gnuOK
x86-linux-muslOK
x86_64-linux-gnuOK
x86_64-linux-gnux32OK
x86_64-linux-muslOK
x86_64-linux-muslx32OK

macOS

TargetStatus
aarch64-macos-noneOK
x86_64-macos-noneOK

NetBSD

TargetStatus
aarch64-netbsd-noneOK
aarch64_be-netbsd-noneOK
arm-netbsd-eabiOK
arm-netbsd-eabihfOK
armeb-netbsd-eabiOK
armeb-netbsd-eabihfOK
mips-netbsd-eabiOK
mips-netbsd-eabihfOK
mipsel-netbsd-eabiOK
mipsel-netbsd-eabihfOK
powerpc-netbsd-eabiOK
powerpc-netbsd-eabihfOK
riscv32-netbsd-none#233
riscv64-netbsd-none#234
sparc-netbsd-none#230
sparc64-netbsd-none#231
x86-netbsd-noneOK
x86_64-netbsd-noneOK

Windows

TargetStatus
aarch64-windows-gnuOK
thumb-windows-gnuOK
x86-windows-gnuOK
x86_64-windows-gnuOK

About

take off every zig

Resources

Stars

Watchers

Forks

Sponsor this project

    Contributors27


    [8]ページ先頭

    ©2009-2026 Movatter.jp