Files
serenity/Ports/zig/patches/0010-build-Set-correct-Zig-version.patch
T
Lucas Chollet cc0939a666 Everywhere: Stop using pc in our target triples
While `pc` is not particularly wrong on x86_64, it's nonsensical on
other supported platforms, namely aarch64 and riscv64.

For consistency, we now don't use this vendor anymore, regardless of the
platform.

Within the LLVM project, we now build as `$arch-serenity`. This is
enough in most cases, the only place where we have to specify a vendor
is the target .cfg file where we use `$arch-unknown-serenity`.

When building GCC and friends, again we simply identify as
`$arch-serenity` and this is enough.

As a result, the tools in Toolchain/Local/$arch/bin are now named after
this pattern: `$arch-serenity-$tool`.

These changes affect the toolchain build scripts, serenity's build
scripts and the Ports.

The last place where we should see `x86_64-pc-serenity` is the output of
`config.sub`, which assume the vendor is `pc` on vendor-less `x86*`
triples. So `x86_64-serenity` is expanded to `x86_64-pc-serenity`,
luckily enough and AFAICT, the whole GNU ecosystem considers `pc`,
`unknown` and vendor-less target triples the same. So `configure`
shouldn't have an issue finding the right tools anyway.

The gn files were edited with sed and are not tested.

This commit also includes a check in `Meta/serenity.sh` to give a nicer
error message when trying to build the system with an old toolchain.

----

To test this patch, on a clean tree I:
 - Ran `./Meta/serenity.sh x86_64 GNU`
 - Ran `./Toolchain/BuildJakt.sh`
 - Tested these ports: python3(configure based), libjxl(cmake based) and
   rizin(meson based)
 - Also booted on aarch64 and risv64

I also repeated the steps above with a Clang toolchain.

On a working tree I tested all the affected ports, the results are:
 - tinycc build fine but can't compile programs, I observed the same on
   master.
 - gdb and epsilon don't build but report the same errors as on master.
 - I manually edited the libgpg-error, and it builds fine.
 - The gcc port works fine.
2026-03-13 20:59:49 +01:00

26 lines
876 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: sin-ack <[email protected]>
Date: Mon, 17 Jul 2023 03:26:04 +0300
Subject: [PATCH] build: Set correct Zig version
The build script contains the version of zig-bootstrap's infrequently
updated vendored Zig. Since we overwrite it with Zig master we have to
patch the version too.
---
build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build b/build
index e27ffac30d6263d0533d3679186c6ac287ab4d5d..aefa5a7b9bb3bc8fbba73b3bfc6a7cbd8b3f1122 100755
--- a/build
+++ b/build
@@ -7,7 +7,7 @@ TARGET="$1" # Example: riscv64-linux-gnu
MCPU="$2" # Examples: `baseline`, `native`, `generic+v7a`, or `arm1176jzf_s`
ROOTDIR="$(pwd)"
-ZIG_VERSION="0.16.0-dev.452+1f7ee99b3"
+ZIG_VERSION="0.16.0-dev.627+e6e4792a5"
TARGET_OS_AND_ABI=${TARGET#*-} # Example: linux-gnu