diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix index c97fd4eb495d..2c7ef16674ba 100644 --- a/pkgs/build-support/gcc-wrapper/default.nix +++ b/pkgs/build-support/gcc-wrapper/default.nix @@ -67,6 +67,7 @@ stdenv.mkDerivation { if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else if stdenv.system == "armv5tel-linux" then "ld-linux.so.3" else if stdenv.system == "powerpc-linux" then "ld.so.1" else + if stdenv.system == "ict_loongson-2_v0.3_fpu_v0.1-linux" then "ld.so.1" else abort "don't know the name of the dynamic linker for this platform") else ""; } diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 40acb8cfece4..037a60da7e68 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -55,6 +55,7 @@ rec { if stdenvType == "i686-linux" then stdenvLinux else if stdenvType == "x86_64-linux" then stdenvLinux else if stdenvType == "armv5tel-linux" then stdenvLinux else + if stdenvType == "ict_loongson-2_v0.3_fpu_v0.1-linux" then stdenvLinux else if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else if stdenvType == "i686-mingw" then stdenvMinGW else if stdenvType == "i686-darwin" then stdenvNix else diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/bzip2 b/pkgs/stdenv/linux/bootstrap/loongson2f/bzip2 new file mode 100755 index 000000000000..f86964d119c2 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/bzip2 differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/cpio b/pkgs/stdenv/linux/bootstrap/loongson2f/cpio new file mode 100755 index 000000000000..bf6fd66be238 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/cpio differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/curl.bz2 b/pkgs/stdenv/linux/bootstrap/loongson2f/curl.bz2 new file mode 100755 index 000000000000..f227a24bf718 Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/curl.bz2 differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix b/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix new file mode 100644 index 000000000000..a87f07e00ceb --- /dev/null +++ b/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix @@ -0,0 +1,13 @@ +{ + sh = ./sh; + bzip2 = ./bzip2; + mkdir = ./mkdir; + cpio = ./cpio; + ln = ./ln; + curl = ./curl.bz2; + + bootstrapTools = { + url = "file:///root/cross-bootstrap-tools.cpio.bz2"; + sha256 = "00aavbk76qjj2gdlmpaaj66r8nzl4d7pyl8cv1gigyzgpbr5vv3j"; + }; +} diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/ln b/pkgs/stdenv/linux/bootstrap/loongson2f/ln new file mode 100755 index 000000000000..d8afd276424f Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/ln differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/mkdir b/pkgs/stdenv/linux/bootstrap/loongson2f/mkdir new file mode 100755 index 000000000000..3a95ccf18d6e Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/mkdir differ diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/sh b/pkgs/stdenv/linux/bootstrap/loongson2f/sh new file mode 100755 index 000000000000..f8ef0a74d6bf Binary files /dev/null and b/pkgs/stdenv/linux/bootstrap/loongson2f/sh differ diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index dd5647bec456..971ef7cc3b7c 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -14,6 +14,7 @@ rec { else if system == "x86_64-linux" then import ./bootstrap/x86_64 else if system == "powerpc-linux" then import ./bootstrap/powerpc else if system == "armv5tel-linux" then import ./bootstrap/armv5tel + else if system == "ict_loongson-2_v0.3_fpu_v0.1-linux" then import ./bootstrap/loongson2f else abort "unsupported platform for the pure Linux stdenv"; diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh index 2399e48b026f..da787d2036d3 100644 --- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh @@ -3,31 +3,41 @@ set -e # Unpack the bootstrap tools tarball. echo Unpacking the bootstrap tools... $mkdir $out -$bzip2 -d < $tarball | (cd $out && $cpio -V -i) +$bzip2 -d < $tarball | (cd $out && $cpio -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 . +LD_LIBRARY_PATH=$out/lib $out/lib/ld.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 + LD_LIBRARY_PATH=$out/lib $out/lib/ld.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld.so.? --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $out/lib/ld.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld.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 + LD_LIBRARY_PATH=$out/lib $out/lib/ld.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld.so.? --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $out/lib/ld.so.? \ + $out/bin/patchelf --set-interpreter $out/lib/ld.so.? --set-rpath $out/lib --force-rpath $i + fi +done + +for i in $out/lib/libgmp* $out/lib/libppl* $out/lib/libcloog* $out/lib/libmpc*; do + echo patching $i + if test -f $i -a ! -L $i; then + LD_LIBRARY_PATH=$out/lib $out/lib/ld.so.? \ + $out/bin/patchelf --set-rpath $out/lib --force-rpath $i + LD_LIBRARY_PATH=$out/lib $out/lib/ld.so.? \ + $out/bin/patchelf --set-rpath $out/lib --force-rpath $i fi done