From a540814c6f5df4b0d484a26eb7c00fc70ac02509 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Fri, 22 May 2026 05:41:25 +0300 Subject: [PATCH] minimal-bootstrap: drop patchelf compiler reference Static patchelf does not need build-compiler paths in debug or source metadata. Add deterministic compiler flags and disallow references to the bootstrap compiler. Size impact against upstream/staging: - patchelf-static closure: 167.634 MiB -> 1.237 MiB (-166.397 MiB) Assisted-by: codex with gpt-5.5-high --- pkgs/os-specific/linux/minimal-bootstrap/patchelf/static.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/minimal-bootstrap/patchelf/static.nix b/pkgs/os-specific/linux/minimal-bootstrap/patchelf/static.nix index 7bf32df8ecb9..d14ca2df1d49 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/patchelf/static.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/patchelf/static.nix @@ -43,6 +43,8 @@ bash.runCommand "${pname}-${version}" gzip ]; + disallowedReferences = [ gcc ]; + passthru.tests.get-version = result: bash.runCommand "${pname}-get-version-${version}" { } '' @@ -70,7 +72,7 @@ bash.runCommand "${pname}-${version}" --host=${hostPlatform.config} \ --disable-dependency-tracking \ CC=musl-gcc \ - CXXFLAGS=-static + CXXFLAGS="-static -g0 -O2 -DNDEBUG -ffile-prefix-map=${gcc}=. -fmacro-prefix-map=${gcc}=." # Build make -j $NIX_BUILD_CORES