From 6728277e199c18b6e03bf123b84915743d1f2f23 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 14 Jan 2023 17:38:50 +0000 Subject: [PATCH] libc: wipe out all references from copied libgcc_s.so.1 Without the change a copy from freshly built `gcc` still retains a reference even after `patchelf --remove-rpath` because `patchelf` does not cleanup dynamic sprintgs section. The change stubs the reference out and fixes build on bootstraps where `gcc` is built before `glibc`. --- pkgs/development/libraries/glibc/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index dfe165c869d2f..9193404d01235 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -86,6 +86,9 @@ in # rely on default RUNPATHs of the binary and other libraries # Do no force-pull wrong glibc. patchelf --remove-rpath $out/lib/libgcc_s.so.1 + # 'patchelf' does not remove the string itself. Wipe out + # string reference to avoid possible link to bootstrapTools + ${buildPackages.nukeReferences}/bin/nuke-refs $out/lib/libgcc_s.so.1 fi '';