Enabling cross-builds with uclibc again (I had that too much abandoned).
Hydra now should even test it. svn path=/nixpkgs/trunk/; revision=20500
This commit is contained in:
parent
67e7ad56d7
commit
1522caa556
@ -1,17 +1,17 @@
|
|||||||
{stdenv, fetchurl, linuxHeaders, gccCross ? null}:
|
{stdenv, fetchurl, linuxHeaders, cross ? null, gccCross ? null}:
|
||||||
|
|
||||||
assert stdenv.isLinux;
|
assert stdenv.isLinux;
|
||||||
|
assert cross != null -> gccCross != null;
|
||||||
|
|
||||||
let
|
let
|
||||||
target = if (gccCross != null) then gccCross.target else null;
|
enableArmEABI = (cross == null && stdenv.platform.kernelArch == "arm")
|
||||||
enableArmEABI = (target == null && stdenv.system "armv5tel-linux")
|
|| (cross != null && cross.arch == "arm");
|
||||||
|| (target != null && target.arch == "arm");
|
|
||||||
|
|
||||||
configArmEABI = if enableArmEABI then
|
configArmEABI = if enableArmEABI then
|
||||||
''-e 's/.*CONFIG_ARM_OABI.*//' \
|
''-e 's/.*CONFIG_ARM_OABI.*//' \
|
||||||
-e 's/.*CONFIG_ARM_EABI.*/CONFIG_ARM_EABI=y/' '' else "";
|
-e 's/.*CONFIG_ARM_EABI.*/CONFIG_ARM_EABI=y/' '' else "";
|
||||||
|
|
||||||
enableBigEndian = (target != null && target.bigEndian);
|
enableBigEndian = (cross != null && cross.bigEndian);
|
||||||
|
|
||||||
configBigEndian = if enableBigEndian then ""
|
configBigEndian = if enableBigEndian then ""
|
||||||
else
|
else
|
||||||
@ -19,12 +19,12 @@ let
|
|||||||
-e 's/.*ARCH_WANTS_BIG_ENDIAN.*/#ARCH_WANTS_BIG_ENDIAN=y/' \
|
-e 's/.*ARCH_WANTS_BIG_ENDIAN.*/#ARCH_WANTS_BIG_ENDIAN=y/' \
|
||||||
-e 's/.*ARCH_WANTS_LITTLE_ENDIAN.*/ARCH_WANTS_LITTLE_ENDIAN=y/' '';
|
-e 's/.*ARCH_WANTS_LITTLE_ENDIAN.*/ARCH_WANTS_LITTLE_ENDIAN=y/' '';
|
||||||
|
|
||||||
archMakeFlag = if (target != null) then "ARCH=${target.arch}" else "";
|
archMakeFlag = if (cross != null) then "ARCH=${cross.arch}" else "";
|
||||||
crossMakeFlag = if (target != null) then "CROSS=${target.config}-" else "";
|
crossMakeFlag = if (cross != null) then "CROSS=${cross.config}-" else "";
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "uclibc-0.9.30.1" + stdenv.lib.optionalString (target != null)
|
name = "uclibc-0.9.30.1" + stdenv.lib.optionalString (cross != null)
|
||||||
("-" + target.config);
|
("-" + cross.config);
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://www.uclibc.org/downloads/uClibc-0.9.30.1.tar.bz2;
|
url = http://www.uclibc.org/downloads/uClibc-0.9.30.1.tar.bz2;
|
||||||
@ -46,7 +46,7 @@ stdenv.mkDerivation {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
# Cross stripping hurts.
|
# Cross stripping hurts.
|
||||||
dontStrip = if (target != null) then true else false;
|
dontStrip = if (cross != null) then true else false;
|
||||||
|
|
||||||
makeFlags = [ crossMakeFlag "VERBOSE=1" ];
|
makeFlags = [ crossMakeFlag "VERBOSE=1" ];
|
||||||
|
|
||||||
@ -54,13 +54,13 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
patches = [ ./unifdef-getline.patch ];
|
patches = [ ./unifdef-getline.patch ];
|
||||||
|
|
||||||
# This will allow the usual gcc-cross-wrapper strip phase work as usual
|
# # This will allow the usual gcc-cross-wrapper strip phase work as usual
|
||||||
crossConfig = if (target != null) then target.config else null;
|
# crossConfig = if (cross != null) then cross.config else null;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
make PREFIX=$out VERBOSE=1 install ${crossMakeFlag}
|
make PREFIX=$out VERBOSE=1 install ${crossMakeFlag}
|
||||||
(cd $out/include && ln -s ${linuxHeaders}/include/* .) || exit 1
|
(cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
|
||||||
sed -i s@/lib/@$out/lib/@g $out/lib/libc.so
|
sed -i s@/lib/@$out/lib/@g $out/lib/libc.so
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -3740,9 +3740,14 @@ let
|
|||||||
installLocales = getPkgConfig "glibc" "locales" false;
|
installLocales = getPkgConfig "glibc" "locales" false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
glibcCross = glibc211Cross;
|
||||||
|
|
||||||
# We can choose:
|
# We can choose:
|
||||||
libcCross = glibc211Cross;
|
libcCrossChooser = name : if (name == "glibc") then glibcCross
|
||||||
# libcCross = uclibcCross;
|
else if (name == "uclibc") then uclibcCross
|
||||||
|
else throw "Unknown libc";
|
||||||
|
|
||||||
|
libcCross = libcCrossChooser crossSystem.libc;
|
||||||
|
|
||||||
eglibc = import ../development/libraries/eglibc {
|
eglibc = import ../development/libraries/eglibc {
|
||||||
inherit fetchsvn stdenv;
|
inherit fetchsvn stdenv;
|
||||||
@ -6395,10 +6400,11 @@ let
|
|||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uclibcCross = target: import ../os-specific/linux/uclibc {
|
uclibcCross = import ../os-specific/linux/uclibc {
|
||||||
inherit fetchurl stdenv;
|
inherit fetchurl stdenv;
|
||||||
linuxHeaders = linuxHeadersCross target;
|
linuxHeaders = linuxHeadersCross;
|
||||||
gccCross = gccCrossStageStatic target;
|
gccCross = gccCrossStageStatic;
|
||||||
|
cross = assert crossSystem != null; crossSystem;
|
||||||
};
|
};
|
||||||
|
|
||||||
udev = makeOverridable (import ../os-specific/linux/udev) {
|
udev = makeOverridable (import ../os-specific/linux/udev) {
|
||||||
|
@ -37,6 +37,7 @@ let
|
|||||||
float = "soft";
|
float = "soft";
|
||||||
withTLS = true;
|
withTLS = true;
|
||||||
platform = pkgs.platforms.sheevaplug;
|
platform = pkgs.platforms.sheevaplug;
|
||||||
|
libc = "glibc";
|
||||||
openssl.system = "linux-generic32";
|
openssl.system = "linux-generic32";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -48,6 +49,27 @@ in {
|
|||||||
});
|
});
|
||||||
}) // (
|
}) // (
|
||||||
|
|
||||||
|
/* Test some cross builds to the Sheevaplug - uclibc*/
|
||||||
|
let
|
||||||
|
crossSystem = {
|
||||||
|
config = "armv5tel-unknown-linux-gnueabi";
|
||||||
|
bigEndian = false;
|
||||||
|
arch = "arm";
|
||||||
|
float = "soft";
|
||||||
|
withTLS = true;
|
||||||
|
platform = pkgs.platforms.sheevaplug;
|
||||||
|
libc = "uclibc";
|
||||||
|
openssl.system = "linux-generic32";
|
||||||
|
};
|
||||||
|
|
||||||
|
in {
|
||||||
|
crossSheevaplugLinuxUclibc = mapTestOnCross crossSystem (
|
||||||
|
basic //
|
||||||
|
{
|
||||||
|
ubootSheevaplug.hostDrv = nativePlatforms;
|
||||||
|
});
|
||||||
|
}) // (
|
||||||
|
|
||||||
/* Test some cross builds to the mipsel */
|
/* Test some cross builds to the mipsel */
|
||||||
let
|
let
|
||||||
crossSystem = {
|
crossSystem = {
|
||||||
@ -56,6 +78,7 @@ let
|
|||||||
arch = "mips";
|
arch = "mips";
|
||||||
float = "soft";
|
float = "soft";
|
||||||
withTLS = true;
|
withTLS = true;
|
||||||
|
libc = "glibc";
|
||||||
platform = {
|
platform = {
|
||||||
name = "malta";
|
name = "malta";
|
||||||
kernelBaseConfig = "malta_defconfig";
|
kernelBaseConfig = "malta_defconfig";
|
||||||
@ -80,6 +103,7 @@ let
|
|||||||
float = "hard";
|
float = "hard";
|
||||||
withTLS = true;
|
withTLS = true;
|
||||||
cpu = "ultrasparc";
|
cpu = "ultrasparc";
|
||||||
|
libc = "glibc";
|
||||||
platform = {
|
platform = {
|
||||||
name = "ultrasparc";
|
name = "ultrasparc";
|
||||||
kernelHeadersBaseConfig = "sparc64_defconfig";
|
kernelHeadersBaseConfig = "sparc64_defconfig";
|
||||||
|
@ -52,18 +52,13 @@ rec {
|
|||||||
(path: value:
|
(path: value:
|
||||||
let
|
let
|
||||||
job = toJob value;
|
job = toJob value;
|
||||||
getPkg = pkgs: setCrossMaintainers
|
getPkg = pkgs: (pkgs.lib.addMetaAttrs {
|
||||||
(pkgs.lib.addMetaAttrs { schedulingPriority = toString job.schedulingPriority; }
|
schedulingPriority = toString job.schedulingPriority;
|
||||||
|
maintainers = crossMaintainers;
|
||||||
|
}
|
||||||
(pkgs.lib.getAttrFromPath path pkgs));
|
(pkgs.lib.getAttrFromPath path pkgs));
|
||||||
in testOnCross crossSystem job.systems getPkg);
|
in testOnCross crossSystem job.systems getPkg);
|
||||||
|
|
||||||
setCrossMaintainers = pkg:
|
|
||||||
pkg //
|
|
||||||
{
|
|
||||||
meta = (if pkg ? meta then pkg.meta else {})
|
|
||||||
// { maintainers = crossMaintainers; };
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Find all packages that have a meta.platforms field listing the
|
/* Find all packages that have a meta.platforms field listing the
|
||||||
supported platforms. */
|
supported platforms. */
|
||||||
packagesWithMetaPlatform = attrSet:
|
packagesWithMetaPlatform = attrSet:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user