| ... | @@ -7,21 +7,21 @@ brew update && brew install s3cmd | ... | @@ -7,21 +7,21 @@ brew update && brew install s3cmd |
| 7 | | 7 | |
| 8 | ZIGDIR="$(pwd)" | 8 | ZIGDIR="$(pwd)" |
| 9 | ARCH="x86_64" | 9 | ARCH="x86_64" |
| 10 | CACHE_BASENAME="zig+llvm+lld+clang-$ARCH-macos-gnu-0.8.0-dev.1939+5a3ea9bec" | 10 | TARGET="$ARCH-macos-gnu" |
| | 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.8.0-dev.2168+2d1196773" |
| 11 | PREFIX="$HOME/$CACHE_BASENAME" | 12 | PREFIX="$HOME/$CACHE_BASENAME" |
| | 13 | MCPU="baseline" |
| 12 | JOBS="-j2" | 14 | JOBS="-j2" |
| 13 | | 15 | |
| 14 | rm -rf $PREFIX | 16 | rm -rf $PREFIX |
| 15 | cd $HOME | 17 | cd $HOME |
| | 18 | |
| 16 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | 19 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" |
| 17 | tar xf "$CACHE_BASENAME.tar.xz" | 20 | tar xf "$CACHE_BASENAME.tar.xz" |
| 18 | | 21 | |
| 19 | ZIG="$PREFIX/bin/zig" | 22 | ZIG="$PREFIX/bin/zig" |
| 20 | NATIVE_LIBC_TXT="$HOME/native_libc.txt" | 23 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" |
| 21 | $ZIG libc >"$NATIVE_LIBC_TXT" | 24 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" |
| 22 | export ZIG_LIBC="$NATIVE_LIBC_TXT" | | |
| 23 | export CC="$ZIG cc" | | |
| 24 | export CXX="$ZIG c++" | | |
| 25 | | 25 | |
| 26 | cd $ZIGDIR | 26 | cd $ZIGDIR |
| 27 | | 27 | |
| ... | @@ -37,22 +37,21 @@ cmake .. \ | ... | @@ -37,22 +37,21 @@ cmake .. \ |
| 37 | -DCMAKE_INSTALL_PREFIX="$(pwd)/release" \ | 37 | -DCMAKE_INSTALL_PREFIX="$(pwd)/release" \ |
| 38 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | 38 | -DCMAKE_PREFIX_PATH="$PREFIX" \ |
| 39 | -DCMAKE_BUILD_TYPE=Release \ | 39 | -DCMAKE_BUILD_TYPE=Release \ |
| 40 | -DZIG_TARGET_TRIPLE="$ARCH-native-gnu" \ | 40 | -DZIG_TARGET_TRIPLE="$TARGET" \ |
| 41 | -DZIG_TARGET_MCPU="baseline" \ | 41 | -DZIG_TARGET_MCPU="$MCPU" \ |
| 42 | -DZIG_STATIC=ON | 42 | -DZIG_STATIC=ON |
| 43 | | 43 | |
| 44 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | 44 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables |
| 45 | # so that installation and testing do not get affected by them. | 45 | # so that installation and testing do not get affected by them. |
| 46 | unset CC | 46 | unset CC |
| 47 | unset CXX | 47 | unset CXX |
| 48 | unset ZIG_LIBC | | |
| 49 | | 48 | |
| 50 | make $JOBS install | 49 | make $JOBS install |
| 51 | | 50 | |
| 52 | # Here we rebuild zig but this time using the Zig binary we just now produced to | 51 | # Here we rebuild zig but this time using the Zig binary we just now produced to |
| 53 | # build zig1.o rather than relying on the one built with stage0. See | 52 | # build zig1.o rather than relying on the one built with stage0. See |
| 54 | # https://github.com/ziglang/zig/issues/6830 for more details. | 53 | # https://github.com/ziglang/zig/issues/6830 for more details. |
| 55 | cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2" | 54 | cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" |
| 56 | make $JOBS install | 55 | make $JOBS install |
| 57 | | 56 | |
| 58 | for step in test-toolchain test-std docs; do | 57 | for step in test-toolchain test-std docs; do |