diff --git a/pkgs/development/libraries/glibc/2.13/builder.sh b/pkgs/development/libraries/glibc/2.13/builder.sh index 9a1c1490019a..f979b91200d2 100644 --- a/pkgs/development/libraries/glibc/2.13/builder.sh +++ b/pkgs/development/libraries/glibc/2.13/builder.sh @@ -51,5 +51,11 @@ postInstall() { rm -f $out/lib/libgcc_s.so.1 } +postFixup() { + # libelf uses gencat, so we need to fix it's rpath so that it doesn't pick up the system rpath. + patchelf --set-rpath $out/lib $out/bin/gencat + # librt (used by acl, used by coreutils) links against pthread, try *not* to pick up the system one. + patchelf --set-rpath $out/lib $out/lib/librt-*.so +} genericBuild diff --git a/pkgs/development/libraries/glibc/2.14/builder.sh b/pkgs/development/libraries/glibc/2.14/builder.sh index 9a1c1490019a..7d829816fb7b 100644 --- a/pkgs/development/libraries/glibc/2.14/builder.sh +++ b/pkgs/development/libraries/glibc/2.14/builder.sh @@ -51,5 +51,12 @@ postInstall() { rm -f $out/lib/libgcc_s.so.1 } +postFixup() { + # libelf uses gencat, so we need to fix it's rpath so that it doesn't pick up the system rpath. + patchelf --set-rpath $out/lib $out/bin/gencat + # librt (used by acl, used by coreutils) links against pthread, try *not* to pick up the system one. + patchelf --set-rpath $out/lib $out/lib/librt-*.so +} + genericBuild diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 597ab802d74e..9ccb5226cedc 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -44,6 +44,14 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = stdenv.lib.optionalString selinuxSupport "-lsepol"; + # the coreutils install calls the ginstall just compiled, before we have + # a chance to patchelf it. + libPath = stdenv.lib.makeLibraryPath ([stdenv.gcc.libc] ++ buildInputs); + + preInstall = '' + patchelf --set-rpath $libPath src/ginstall + ''; + meta = { homepage = http://www.gnu.org/software/coreutils/; description = "The basic file, shell and text manipulation utilities of the GNU operating system";