summary refs log tree commit diff
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2015-04-29 10:09:07 +0200
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2015-04-29 10:09:07 +0200
commit51b1297c8a3fdb9d1abdc98ebbc85e3679373c21 (patch)
tree59817826926e697862903946f0d3a7184bacf7c3
parent60d6eb7a9a43fef931b001efdf06a8856e535ce1 (diff)
downloadnixpkgs-51b1297c8a3fdb9d1abdc98ebbc85e3679373c21.tar
nixpkgs-51b1297c8a3fdb9d1abdc98ebbc85e3679373c21.tar.gz
nixpkgs-51b1297c8a3fdb9d1abdc98ebbc85e3679373c21.tar.bz2
nixpkgs-51b1297c8a3fdb9d1abdc98ebbc85e3679373c21.tar.lz
nixpkgs-51b1297c8a3fdb9d1abdc98ebbc85e3679373c21.tar.xz
nixpkgs-51b1297c8a3fdb9d1abdc98ebbc85e3679373c21.tar.zst
nixpkgs-51b1297c8a3fdb9d1abdc98ebbc85e3679373c21.zip
glibc: fix libgcc_s.so
It used to be a symlink, but now it is a link script. It's crucial to get
proper linking, specially on amrv5tel, where libgcc contains lot of code
related to the limited instruction set of the platform.

Without this fix, g++ shared lib linking was broken, because a "-lgcc" was
not propagated wherever "-lgcc_s" was required. The g++ spec only mentions
"-lgcc_s" and the "-lgcc" is introduced with the libgcc_s.so link script,
only available in the glibc path after this fix.

As a reminder, we put libgcc* in the glibc output to avoid having a
runtime dependency on the gcc path only because of the everywhere linked
libgcc. This problem was specially visible in platforms like armv5tel,
where most programs end up linked to libgcc. Platforms with a more rich
instruction set may rarely end up requiring a link to libgcc.
-rw-r--r--pkgs/development/libraries/glibc/default.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix
index f60df4a30d6..ccf6d2c0686 100644
--- a/pkgs/development/libraries/glibc/default.nix
+++ b/pkgs/development/libraries/glibc/default.nix
@@ -36,7 +36,8 @@ in
       if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then
           mkdir -p $out/lib
           cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
-          ln -s libgcc_s.so.1 $out/lib/libgcc_s.so
+          # the .so It used to be a symlink, but now it is a script
+          cp -a ${stdenv.cc.cc}/lib/libgcc_s.so $out/lib/libgcc_s.so
       fi
     '';