Closed tisonkun closed 2 weeks ago
/path/to/zig-bootstrap/out/zig-native-linux-gnu-native/bin/zig build -p stage3 --search-prefix /path/to/zig-bootstrap/out/native-linux-gnu-native/ --zig-lib-dir lib -Dstatic-llvm
Maybe try to build zig
with the same commit as zig-sources in zig-bootstrap
.
Otherwise zig can still be bootstrapped from zig cc
or ziglang
, e. g.
#!/bin/sh
set -eu
ROOTDIR="$(pwd)"
ZIG_DIR=$(python -c "import os; import ziglang; print(os.path.dirname(ziglang.__file__))" 2>&1)
export ZIG_EXE="$ZIG_DIR/zig"
TARGET_OS_CMAKE=""
mkdir -p "$ROOTDIR/out/build-zig-host"
mkdir -p "$ROOTDIR/out/host"
cd "$ROOTDIR/out/build-zig-host"
cmake "$ROOTDIR/zig" \
-DCMAKE_INSTALL_PREFIX="$ROOTDIR/out/host" \
-DCMAKE_PREFIX_PATH="$ROOTDIR/out/host" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER="$(pwd)/../../zigcc" \
-DCMAKE_CXX_COMPILER="$(pwd)/../../zigc++" \
-DCMAKE_GENERATOR=Ninja
cmake --build . --target install
ZIG="$ROOTDIR/out/host/bin/zig"
#!/bin/sh
$ZIG_EXE cc $@
#!/bin/sh
$ZIG_EXE c++ $@
This is completely expected AFAIK. It's like if you build stage3 with CMake normally, some incompatible changes happen to lib/
or build.zig
, and then you try to build again with that same stage3.
Following the instructions here, I run:
It fails with a long list fills with:
where zig-bootstrap produce as: