From a35e308a57baa9b433138d5248e9cd57fa7f87f8 Mon Sep 17 00:00:00 2001 From: Patryk Sondej Date: Sun, 9 Nov 2025 23:03:08 +0100 Subject: [PATCH 1/2] zig: fix performance issue --- pkgs/development/compilers/zig/bintools.nix | 4 +--- pkgs/development/compilers/zig/cc.nix | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/zig/bintools.nix b/pkgs/development/compilers/zig/bintools.nix index c14817cbb375..de2f0343ca45 100644 --- a/pkgs/development/compilers/zig/bintools.nix +++ b/pkgs/development/compilers/zig/bintools.nix @@ -4,7 +4,6 @@ zig, runCommand, makeWrapper, - coreutils, }: let targetPrefix = lib.optionalString ( @@ -30,8 +29,7 @@ runCommand "zig-bintools-${zig.version}" for tool in ar objcopy ranlib ld.lld; do makeWrapper "$zig/bin/zig" "$out/bin/$tool" \ --add-flags "$tool" \ - --suffix PATH : "${lib.makeBinPath [ coreutils ]}" \ - --run "export ZIG_GLOBAL_CACHE_DIR=\$(mktemp -d)" + --run "export ZIG_GLOBAL_CACHE_DIR=\$TMPDIR/zig-cache" done ln -s $out/bin/ld.lld $out/bin/ld diff --git a/pkgs/development/compilers/zig/cc.nix b/pkgs/development/compilers/zig/cc.nix index f2716d395e69..1768d17542cd 100644 --- a/pkgs/development/compilers/zig/cc.nix +++ b/pkgs/development/compilers/zig/cc.nix @@ -4,7 +4,6 @@ zig, stdenv, makeWrapper, - coreutils, }: let targetPrefix = lib.optionalString ( @@ -34,8 +33,7 @@ runCommand "zig-cc-${zig.version}" for tool in cc c++ ld.lld; do makeWrapper "$zig/bin/zig" "$out/bin/$tool" \ --add-flags "$tool" \ - --suffix PATH : "${lib.makeBinPath [ coreutils ]}" \ - --run "export ZIG_GLOBAL_CACHE_DIR=\$(mktemp -d)" + --run "export ZIG_GLOBAL_CACHE_DIR=\$TMPDIR/zig-cache" done ln -s $out/bin/c++ $out/bin/clang++ From fcafa714086bdf52bfdca5f66906001c7775d911 Mon Sep 17 00:00:00 2001 From: Patryk Sondej Date: Sun, 9 Nov 2025 23:17:43 +0100 Subject: [PATCH 2/2] zig: remove unneeded `dynamic-linker` option --- pkgs/development/compilers/zig/passthru.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/development/compilers/zig/passthru.nix b/pkgs/development/compilers/zig/passthru.nix index 802d53c16178..439df42d31d5 100644 --- a/pkgs/development/compilers/zig/passthru.nix +++ b/pkgs/development/compilers/zig/passthru.nix @@ -22,10 +22,7 @@ nixSupport.cc-cflags = [ "-target" "${stdenv.targetPlatform.system}-${stdenv.targetPlatform.parsed.abi.name}" - ] - ++ lib.optional ( - stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.isStatic or false) - ) "-Wl,-dynamic-linker=${targetPackages.stdenv.cc.bintools.dynamicLinker}"; + ]; }; stdenv = overrideCC stdenv zig.cc;