Skip to content

Commit 5dd780e

Browse files
committed
Ports: Update Zig to 0.15.0-dev.208+8acedfd5b
1 parent dc4711c commit 5dd780e

29 files changed

+801
-2289
lines changed

Ports/AvailablePorts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
352352
| [`xorriso`](xorriso/) | xorriso | 1.5.6 | https://www.gnu.org/software/xorriso |
353353
| [`xz`](xz/) | xz | 5.6.2 | https://tukaani.org/xz/ |
354354
| [`yasm`](yasm/) | Yasm Modular Assembler | 1.3.0 | https://yasm.tortall.net/ |
355-
| [`zig`](zig/) | Zig programming language | 0.12.0-dev.141+ddf5859c2 | https://ziglang.org/ |
355+
| [`zig`](zig/) | Zig programming language | 0.15.0-dev.208+8acedfd5b | https://ziglang.org/ |
356356
| [`zlib`](zlib/) | zlib | 1.3.1 | https://www.zlib.net/ |
357357
| [`zsh`](zsh/) | Z Shell (Zsh) | 5.9 | https://www.zsh.org |
358358
| [`zstd`](zstd/) | Zstandard | 1.5.6 | https://facebook.github.io/zstd/ |

Ports/gcc/package.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env -S bash ../.port_include.sh
2-
port=gcc
3-
version=13.2.0
4-
useconfigure=true
2+
port='gcc'
3+
# Update SERENITY_GCC_VERSION in Zig's package.sh when changing this
4+
version='13.2.0'
5+
useconfigure='true'
56
configopts=("--target=${SERENITY_ARCH}-pc-serenity" "--with-sysroot=/" "--with-build-sysroot=${SERENITY_INSTALL_ROOT}" "--enable-languages=c,c++" "--disable-lto" "--disable-nls" "--enable-shared" "--enable-default-pie" "--enable-host-shared" "--enable-threads=posix" "--enable-initfini-array" "--with-linker-hash-style=gnu")
67
files=(
78
"https://ftpmirror.gnu.org/gnu/gcc/gcc-${version}/gcc-${version}.tar.xz#e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da"

Ports/zig/.gitignore

-1
This file was deleted.

Ports/zig/package.sh

+26-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,45 @@
11
#!/usr/bin/env -S bash ../.port_include.sh
22

33
port='zig'
4-
version='0.12.0-dev.141+ddf5859c2'
4+
version='0.15.0-dev.208+8acedfd5b'
55
files=(
6-
'https://github.com/ziglang/zig-bootstrap/archive/34644ad5032c58e39327d33d7f96d63d7c330003.tar.gz#e502ae17b01f03c627927d60b2e26b5f7f83b0e8be27b6ef55511d52e5892ccf'
7-
'https://github.com/ziglang/zig/archive/ddf5859c22527c6bf5d8bb13310db996fcc58874.tar.gz#9adaf787b6233cfbe784d2d8a72398784f3742e2f5ac700cbd59ba952f9491ad'
6+
'https://github.com/ziglang/zig-bootstrap/archive/03a95efaf981b9cee59af8027304c37a59d36fc0.tar.gz#6541363baacc64ede96bcfb81b562a8a825d65fb4a05ab4e321be74c656a61d1'
7+
'https://github.com/ziglang/zig/archive/8acedfd5baabab705946ad097746f9183ef62420.tar.gz#062ad37a4b501340e10b121ef4f825c411ec51385d34666e5f11f18ef9d6d6d9'
88
)
99

1010
# The actual directory to build in.
11-
workdir='zig-bootstrap-34644ad5032c58e39327d33d7f96d63d7c330003'
11+
workdir='zig-bootstrap-03a95efaf981b9cee59af8027304c37a59d36fc0'
1212
# The newer Zig directory we move into the workdir.
13-
zigdir='zig-ddf5859c22527c6bf5d8bb13310db996fcc58874'
13+
zigdir='zig-8acedfd5baabab705946ad097746f9183ef62420'
14+
15+
# This is read in the build script to set gcc_dir in the custom libc definition file
16+
# TODO: Maybe we can just symlink the crt files to /usr/local/lib or otherwise remove the need for a hardcoded version
17+
export SERENITY_GCC_VERSION='13.2.0'
1418

1519
post_fetch() {
20+
# NOTE: Running this multiple times is a massive footgun as patches only get applied once, the
21+
# next time we'd end up with a clean copy of the original Zig sources.
22+
if [ -f .post-fetch-executed ]; then
23+
return
24+
fi
25+
run touch .post-fetch-executed
26+
1627
# Move the newer version of Zig into the bootstrap
1728
run rm -rf zig
18-
run mv "../${zigdir}" zig
29+
run cp -r "../${zigdir}" zig
1930

20-
# Copy the scripts that the build process will use
21-
run mkdir -p out
22-
run cp -r "${PORT_META_DIR}/scripts" out/
31+
# Copy libSystem definitions which are required on macOS, once we set $ZIG_LIBC it will no
32+
# longer be found in its original place
33+
run cp zig/lib/libc/darwin/libSystem.tbd "${DESTDIR}/usr/lib/"
2334
}
2435

2536
build() {
37+
if [ ! -f "${DESTDIR}/usr/local/lib/gcc/${SERENITY_ARCH}-pc-serenity/${SERENITY_GCC_VERSION}/crtbeginS.o" ] ||
38+
[ ! -f "${DESTDIR}/usr/local/lib/gcc/${SERENITY_ARCH}-pc-serenity/${SERENITY_GCC_VERSION}/crtendS.o" ]; then
39+
echo "crtbeginS.o or crtendS.o could not be found, ensure the GCC port is installed."
40+
exit 1
41+
fi
42+
2643
host_env
2744
cd "${workdir}"
2845
./build "${SERENITY_ARCH}-serenity-none" "native"

Ports/zig/patches/0001-Support-Add-support-for-building-LLVM-on-SerenityOS.patch

-78
This file was deleted.

0 commit comments

Comments
 (0)