Merge pull request #149953 from r-burns/uclibc-mips

uclibc-ng: fix cross-compile to mips (for ben-nanonote)
This commit is contained in:
Jörg Thalheim
2021-12-10 06:16:59 +00:00
committed by GitHub
+7 -3
View File
@@ -39,6 +39,8 @@ let
UCLIBC_SUSV4_LEGACY y
UCLIBC_HAS_THREADS_NATIVE y
KERNEL_HEADERS "${linuxHeaders}/include"
'' + lib.optionalString (stdenv.hostPlatform.gcc.float or "" == "soft") ''
UCLIBC_HAS_FPU n
'' + lib.optionalString (stdenv.isAarch32 && stdenv.buildPlatform != stdenv.hostPlatform) ''
CONFIG_ARM_EABI y
ARCH_WANTS_BIG_ENDIAN n
@@ -81,7 +83,8 @@ stdenv.mkDerivation {
depsBuildBuild = [ buildPackages.stdenv.cc ];
makeFlags = [
"ARCH=${stdenv.hostPlatform.parsed.cpu.name}"
"ARCH=${stdenv.hostPlatform.linuxArch}"
"TARGET_ARCH=${stdenv.hostPlatform.linuxArch}"
"VERBOSE=1"
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"CROSS=${stdenv.cc.targetPrefix}"
@@ -93,7 +96,7 @@ stdenv.mkDerivation {
installPhase = ''
mkdir -p $out
make PREFIX=$out VERBOSE=1 install
make $makeFlags PREFIX=$out VERBOSE=1 install
(cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
# libpthread.so may not exist, so I do || true
sed -i s@/lib/@$out/lib/@g $out/lib/libc.so $out/lib/libpthread.so || true
@@ -109,6 +112,7 @@ stdenv.mkDerivation {
description = "A small implementation of the C library";
maintainers = with maintainers; [ rasendubi ];
license = licenses.lgpl2;
platforms = intersectLists platforms.linux platforms.x86; # fails to build on ARM
platforms = platforms.linux;
broken = stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64;
};
}