From e9b9bea26190f6aaaabf01773c982d30aa0d6a66 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Wed, 3 Nov 2021 11:54:15 +0100 Subject: [PATCH] glibc: include ldd and other scripts in cross-builds Since the script interpreters are not patched (anymore?), no reference to any shell is generated by the scripts in glibc's `bin` output: ``` $ nix-store --query --references /nix/store/nmfj3a2k2kr2lypndn37x6qbd8537f9b-glibc-riscv64-unknown-linux-gnu-2.33-50-bin /nix/store/afgfd3vl3x5zx89awn3fjayn83yl9vcy-glibc-riscv64-unknown-linux-gnu-2.33-50 /nix/store/nmfj3a2k2kr2lypndn37x6qbd8537f9b-glibc-riscv64-unknown-linux-gnu-2.33-50-bin ``` This means that it's safe to include the scripts in glibc's bin output even in cross builds. One interesting improvement for the future could be to split these scripts into a separate derivation and properly patch their script interpreter (currently they are using impure /bin/sh). --- pkgs/development/libraries/glibc/common.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 3f78ef4041a6..d9cbc8907a04 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -286,9 +286,4 @@ stdenv.mkDerivation ({ // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) { preInstall = null; # clobber the native hook - - # To avoid a dependency on the build system 'bash'. - preFixup = '' - rm -f $bin/bin/{ldd,tzselect,catchsegv,xtrace} - ''; })