@ -16,6 +16,11 @@ let
sha256 = " 1 4 i g k 6 k 0 0 b n p f w 6 6 0 q h s w a g y h v r 0 g f q g 4 q 5 5 d x v a a q 7 i k f k r i r 7 1 " ;
} ;
stack_chk_fail_local_c = fetchurl {
url = " h t t p s : / / g i t . a l p i n e l i n u x . o r g / a p o r t s / p l a i n / m a i n / m u s l / _ _ s t a c k _ c h k _ f a i l _ l o c a l . c ? h = 3 . 1 0 - s t a b l e " ;
sha256 = " 1 n h k z z y 9 p k l g j c q 2 y g 8 9 d 3 l 1 8 j i f 3 3 1 s r d 3 z 3 v h y 5 q w x l 1 s p v 6 i 9 " ;
} ;
# iconv tool, implemented by musl author.
# Original: http://git.etalabs.net/cgit/noxcuse/plain/src/iconv.c?id=02d288d89683e99fd18fe9f54d4e731a6c474a4f
# We use copy from Alpine which fixes error messages, see:
@ -87,6 +92,16 @@ stdenv.mkDerivation rec {
NIX_DONT_SET_RPATH = true ;
preBuild = ''
$ { if ( stdenv . targetPlatform . libc == " m u s l " && stdenv . targetPlatform . isx86_32 ) then
" # t h e - x c f l a g i s r e q u i r e d s i n c e t h e f i l e e x t e n s i o n c o n f u s e s g c c
# that detect the file as a linker script.
$ CC - x c - c $ { stack_chk_fail_local_c } - o __stack_chk_fail_local . o
$ AR r libssp_nonshared . a __stack_chk_fail_local . o "
else " "
}
'' ;
postInstall = ''
# Not sure why, but link in all but scsi directory as that's what uclibc/glibc do.
# Apparently glibc provides scsi itself?
@ -96,6 +111,13 @@ stdenv.mkDerivation rec {
$ STRIP - S $ out/lib/libc.a
mkdir - p $ out/bin
$ { if ( stdenv . targetPlatform . libc == " m u s l " && stdenv . targetPlatform . isx86_32 ) then
" i n s t a l l - D l i b s s p _ n o n s h a r e d . a $ o u t / l i b / l i b s s p _ n o n s h a r e d . a
$ STRIP - S $ out/lib/libssp_nonshared.a "
else " "
}
# Create 'ldd' symlink, builtin
ln - rs $ out/lib/libc.so $ out/bin/ldd