Skip to content

Commit 6522156

Browse files
committed
glibc: Include a copy of libgcc_s.so.1
This prevents failures like "libgcc_s.so.1 must be installed for pthread_cancel to work" that occur because Glibc assumes libgcc_s.so.1 to be in Glibc's libdir. This solution is pretty hacky, because the libgcc_s.so.1 from bootstrap-tools might be too old. So if we update GCC, programs might end up using an outdated libgcc_s.so.1. Ideally, we would build libgcc_s.so.1 *before* Glibc, which might not be impossible... Fixes #3548.
1 parent 3bd2cfa commit 6522156

3 files changed

Lines changed: 1 addition & 7 deletions

File tree

pkgs/development/libraries/glibc/builder.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ postInstall() {
4646
ln -s lib $out/lib64
4747
fi
4848

49-
# This file, that should not remain in the glibc derivation,
50-
# may have not been created during the preInstall
51-
rm -f $out/lib/libgcc_s.so.1
52-
5349
# Get rid of more unnecessary stuff.
5450
rm -rf $out/var $out/sbin/sln
5551
}

pkgs/development/libraries/glibc/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ in
3535
preInstall = ''
3636
if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then
3737
mkdir -p $out/lib
38-
ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
38+
cp ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
3939
fi
4040
'';
4141

pkgs/tools/filesystems/squashfs/default.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ stdenv.mkDerivation rec {
1212
buildInputs = [ zlib xz ];
1313

1414
preBuild = "cd squashfs-tools";
15-
16-
NIX_LDFLAGS = "-lgcc_s"; # for pthread_cancel
1715

1816
installFlags = "INSTALL_DIR=\${out}/bin";
1917

0 commit comments

Comments
 (0)