@@ -7,7 +7,9 @@ sudo pkg update -fq
7
7
sudo pkg install -y cmake py39-s3cmd wget curl jq samurai
8
8
9
9
ZIGDIR=" $( pwd) "
10
- CACHE_BASENAME=" zig+llvm+lld+clang-x86_64-freebsd-gnu-0.10.0-dev.3524+74673b7f6"
10
+ TARGET=" x86_64-freebsd-gnu"
11
+ MCPU=" baseline"
12
+ CACHE_BASENAME=" zig+llvm+lld+clang-$TARGET -0.10.0-dev.3524+74673b7f6"
11
13
PREFIX=" $HOME /$CACHE_BASENAME "
12
14
13
15
cd $HOME
@@ -30,38 +32,47 @@ export TERM=dumb
30
32
mkdir build
31
33
cd build
32
34
cmake .. \
33
- -DCMAKE_BUILD_TYPE=Release \
34
- -DCMAKE_PREFIX_PATH=$PREFIX \
35
- " -DCMAKE_INSTALL_PREFIX= $( pwd ) /release " \
36
- -DZIG_STATIC=ON \
37
- -DZIG_TARGET_TRIPLE=x86_64-freebsd-gnu \
38
- -GNinja
35
+ -DCMAKE_BUILD_TYPE=Release \
36
+ -DCMAKE_PREFIX_PATH=$PREFIX \
37
+ -DZIG_TARGET_TRIPLE= " $TARGET " \
38
+ -DZIG_TARGET_MCPU= " $MCPU " \
39
+ -DZIG_STATIC=ON \
40
+ -GNinja
39
41
samu install
40
42
41
- # Here we rebuild zig but this time using the Zig binary we just now produced to
42
- # build zig1.o rather than relying on the one built with stage0. This makes it
43
- # a stage3 build rather than a stage2 build .
44
- cmake .. -DZIG_EXECUTABLE= " $PREFIX /bin/zig"
45
- samu install
43
+ # TODO: eliminate this workaround. Without this, zig does not end up passing
44
+ # -isystem /usr/include when building libc++, resulting in #include <sys/endian.h>
45
+ # "file not found" errors .
46
+ stage2 /bin/zig libc > libc.txt
47
+ export ZIG_LIBC= " $( pwd ) /libc.txt "
46
48
47
- # Here we skip some tests to save time.
48
- release/bin/zig build test docs \
49
+ stage2/bin/zig build \
50
+ --prefix stage3-release \
49
51
--search-prefix " $PREFIX " \
50
52
-Dstatic-llvm \
53
+ -Drelease \
54
+ -Dstrip \
55
+ -Dtarget=" $TARGET " \
56
+ -Denable-stage1
57
+
58
+ # Here we skip some tests to save time.
59
+ stage3-release/bin/zig build test docs \
60
+ -Dstatic-llvm \
61
+ --search-prefix " $PREFIX " \
51
62
-Dskip-stage1 \
52
63
-Dskip-non-native
53
64
54
65
if [ -f ~ /.s3cfg ]; then
55
- mv ../LICENSE release/
56
- mv ../zig-cache/langref.html release/
57
- mv release/bin/zig release/
58
- rmdir release/bin
66
+ mv ../LICENSE stage3- release/
67
+ mv ../zig-cache/langref.html stage3- release/
68
+ mv stage3- release/bin/zig stage3- release/
69
+ rmdir stage3- release/bin
59
70
60
71
GITBRANCH=$( basename $GITHUB_REF )
61
- VERSION=$( release/zig version)
72
+ VERSION=$( stage3- release/zig version)
62
73
DIRNAME=" zig-freebsd-x86_64-$VERSION "
63
74
TARBALL=" $DIRNAME .tar.xz"
64
- mv release " $DIRNAME "
75
+ mv stage3- release " $DIRNAME "
65
76
tar cfJ " $TARBALL " " $DIRNAME "
66
77
67
78
s3cmd put -P --add-header=" cache-control: public, max-age=31536000, immutable" " $TARBALL " s3://ziglang.org/builds/
0 commit comments