Skip to content

Commit

Permalink
update to Zig 0.12.0-dev.2271+14efbbfd8
Browse files Browse the repository at this point in the history
  • Loading branch information
erikarvstedt committed Jan 18, 2024
1 parent f3ef222 commit fa498b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ rec {
buildInputs = with pkgs; [
libxml2
zlib
libgcc.lib
] ++ (with llvmPackages; [
libclang
lld
Expand Down
8 changes: 5 additions & 3 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ buildBootstrap() {

ninja install

setGlibc "$build_dir/stage3/bin/zig"
fixDynamicLinking "$build_dir/stage3/bin/zig"
}

# As a faster alternative to `buildBootstrap`, fetch a prebuilt Zig stage3 binary
Expand Down Expand Up @@ -67,8 +67,10 @@ prepareBuild() {
# (because the linker uses the glibc directory in which the linker itself is located).
# But it fixes "wrong version" warnings for glibc in tools like `ldd`, which only use
# resources like RPATH for resolving shared libraries.
setGlibc() {
fixDynamicLinking() {
binary=$1
patchelf --shrink-rpath \
"$binary"
patchelf --set-interpreter "$(cat "$NIX_BINTOOLS/nix-support/dynamic-linker")" \
--add-rpath "$(cat "$NIX_BINTOOLS/nix-support/orig-libc")/lib" \
"$binary"
Expand Down Expand Up @@ -102,7 +104,7 @@ build() {
printAndRun "$build_dir"/stage3/bin/zig build --prefix "$build_dir/$prefix" \
--cache-dir "$build_dir/zig-cache" -Denable-llvm -Dno-lib "$@"

setGlibc "$build_dir/$prefix/bin/zig"
fixDynamicLinking "$build_dir/$prefix/bin/zig"
}

#―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Expand Down
10 changes: 5 additions & 5 deletions zig-release.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
version = "0.12.0-dev.2201+89d4ac628";
version = "0.12.0-dev.2271+14efbbfd8";
src = {
rev = "89d4ac628959fe301ee93b88fdc66ab1988d5f33";
hash = "sha256-IwRbVdhZk/O04ED4NHsnMApH552lm+spOnmAxJOaI30=";
rev = "14efbbfd89c7e034436faa87a201a35324b9dff3";
hash = "sha256-F05xeoE4Sr1X9Sus5FzuQbhNt/xiot6i0x0gVKg1huw=";
};
binaries = {
x86_64-linux.sha256 = "51bdf4502c046fc01815d4622368741cce9d773d0c5bf80930f10f3d74a682df";
aarch64-linux.sha256 = "00b1d8f1c277f5fc79d681d3b74c6ab69ccf667c64e36c21c3f07ca972667064";
x86_64-linux.sha256 = "096ee7c645a8de11981b12e174b099b626d89bc6d3530e961b941c80cf3792d8";
aarch64-linux.sha256 = "8ea9a3ad1e43b93fa42784f308669dfddeb2840747e69cad2ed0e8ae5dcc1764";
};
}

0 comments on commit fa498b5

Please sign in to comment.