Porting changes from stdenv-updates into this branch.
This comes from: svn diff ^/nixpkgs/trunk/@18255 ^/nixpkgs/branches/stdenv-updates/ > diff patch -p0 < diff and then adding into svn all files new from the patch. trunk@18255 comes from the last time I updated stdenv-updates from trunk. svn path=/nixpkgs/stdenv-updates2/; revision=18272
This commit is contained in:
48
pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
Normal file
48
pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
Normal file
@@ -0,0 +1,48 @@
|
||||
set -e
|
||||
|
||||
# Unpack the bootstrap tools tarball.
|
||||
echo Unpacking the bootstrap tools...
|
||||
$mkdir $out
|
||||
$bzip2 -d < $tarball | (cd $out && $cpio -V -i)
|
||||
|
||||
# Set the ELF interpreter / RPATH in the bootstrap binaries.
|
||||
echo Patching the bootstrap tools...
|
||||
|
||||
# On x86_64, ld-linux-x86-64.so.2 barfs on patchelf'ed programs. So
|
||||
# use a copy of patchelf.
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? $out/bin/cp $out/bin/patchelf .
|
||||
|
||||
for i in $out/bin/* $out/libexec/gcc/*/*/*; do
|
||||
echo patching $i
|
||||
if ! test -L $i; then
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
|
||||
$out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
|
||||
$out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
|
||||
fi
|
||||
done
|
||||
for i in $out/lib/librt* ; do
|
||||
echo patching $i
|
||||
if ! test -L $i; then
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
|
||||
$out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
|
||||
$out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
|
||||
fi
|
||||
done
|
||||
|
||||
# Fix the libc linker script.
|
||||
export PATH=$out/bin
|
||||
cat $out/lib/libc.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libc.so.tmp
|
||||
mv $out/lib/libc.so.tmp $out/lib/libc.so
|
||||
cat $out/lib/libpthread.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libpthread.so.tmp
|
||||
mv $out/lib/libpthread.so.tmp $out/lib/libpthread.so
|
||||
|
||||
# Provide some additional symlinks.
|
||||
ln -s bash $out/bin/sh
|
||||
|
||||
ln -s bzip2 $out/bin/bunzip2
|
||||
|
||||
# fetchurl needs curl.
|
||||
bzip2 -d < $curl > $out/bin/curl
|
||||
chmod +x $out/bin/curl
|
||||
@@ -10,13 +10,24 @@ echo Patching the bootstrap tools...
|
||||
|
||||
# On x86_64, ld-linux-x86-64.so.2 barfs on patchelf'ed programs. So
|
||||
# use a copy of patchelf.
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 $out/bin/cp $out/bin/patchelf .
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? $out/bin/cp $out/bin/patchelf .
|
||||
|
||||
for i in $out/bin/* $out/libexec/gcc/*/*/*; do
|
||||
echo patching $i
|
||||
if ! test -L $i; then
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \
|
||||
./patchelf --set-interpreter $out/lib/ld-linux*.so.2 --set-rpath $out/lib --force-rpath $i
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
|
||||
$out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
|
||||
$out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
|
||||
fi
|
||||
done
|
||||
for i in $out/lib/librt* ; do
|
||||
echo patching $i
|
||||
if ! test -L $i; then
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
|
||||
$out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
|
||||
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
|
||||
$out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -24,6 +35,8 @@ done
|
||||
export PATH=$out/bin
|
||||
cat $out/lib/libc.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libc.so.tmp
|
||||
mv $out/lib/libc.so.tmp $out/lib/libc.so
|
||||
cat $out/lib/libpthread.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libpthread.so.tmp
|
||||
mv $out/lib/libpthread.so.tmp $out/lib/libpthread.so
|
||||
|
||||
# Provide some additional symlinks.
|
||||
ln -s bash $out/bin/sh
|
||||
|
||||
Reference in New Issue
Block a user