Cleanup some top-level cross compiling toolchain things
Also, switch the cross gcc to use the default gcc.
This commit is contained in:
parent
e3927f6b92
commit
105feaa9f4
@ -1127,11 +1127,9 @@ let
|
|||||||
|
|
||||||
cool-retro-term = callPackage ../applications/misc/cool-retro-term { };
|
cool-retro-term = callPackage ../applications/misc/cool-retro-term { };
|
||||||
|
|
||||||
coreutils = callPackage ../tools/misc/coreutils
|
coreutils = callPackage ../tools/misc/coreutils {
|
||||||
{
|
aclSupport = stdenv.isLinux;
|
||||||
# TODO: Add ACL support for cross-Linux.
|
};
|
||||||
aclSupport = crossSystem == null && stdenv.isLinux;
|
|
||||||
};
|
|
||||||
|
|
||||||
cpio = callPackage ../tools/archivers/cpio { };
|
cpio = callPackage ../tools/archivers/cpio { };
|
||||||
|
|
||||||
@ -3602,36 +3600,22 @@ let
|
|||||||
|
|
||||||
gccApple = throw "gccApple is no longer supported";
|
gccApple = throw "gccApple is no longer supported";
|
||||||
|
|
||||||
gcc48_realCross = lib.addMetaAttrs { hydraPlatforms = []; }
|
|
||||||
(callPackage ../development/compilers/gcc/4.8 {
|
|
||||||
inherit noSysDirs;
|
|
||||||
binutilsCross = binutilsCross;
|
|
||||||
libcCross = libcCross;
|
|
||||||
profiledCompiler = false;
|
|
||||||
enableMultilib = false;
|
|
||||||
crossStageStatic = false;
|
|
||||||
cross = assert crossSystem != null; crossSystem;
|
|
||||||
});
|
|
||||||
|
|
||||||
gcc_realCross = gcc48_realCross;
|
|
||||||
|
|
||||||
gccCrossStageStatic = let
|
gccCrossStageStatic = let
|
||||||
libcCross1 =
|
libcCross1 =
|
||||||
if stdenv.cross.libc == "msvcrt" then windows.mingw_w64_headers
|
if stdenv.cross.libc == "msvcrt" then windows.mingw_w64_headers
|
||||||
else if stdenv.cross.libc == "libSystem" then darwin.xcode
|
else if stdenv.cross.libc == "libSystem" then darwin.xcode
|
||||||
else null;
|
else null;
|
||||||
in
|
in wrapGCCCross {
|
||||||
wrapGCCCross {
|
gcc = forceNativeDrv (gcc.cc.override {
|
||||||
gcc = forceNativeDrv (lib.addMetaAttrs { hydraPlatforms = []; } (
|
cross = crossSystem;
|
||||||
gcc_realCross.override {
|
crossStageStatic = true;
|
||||||
crossStageStatic = true;
|
langCC = false;
|
||||||
langCC = false;
|
libcCross = libcCross1;
|
||||||
libcCross = libcCross1;
|
enableShared = false;
|
||||||
enableShared = false;
|
});
|
||||||
}));
|
|
||||||
libc = libcCross1;
|
libc = libcCross1;
|
||||||
binutils = binutilsCross;
|
binutils = binutilsCross;
|
||||||
cross = assert crossSystem != null; crossSystem;
|
cross = crossSystem;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Only needed for mingw builds
|
# Only needed for mingw builds
|
||||||
@ -3643,21 +3627,17 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
gccCrossStageFinal = wrapGCCCross {
|
gccCrossStageFinal = wrapGCCCross {
|
||||||
gcc = forceNativeDrv (gcc_realCross.override {
|
gcc = forceNativeDrv (gcc.cc.override {
|
||||||
libpthreadCross =
|
cross = crossSystem;
|
||||||
# FIXME: Don't explicitly refer to `i586-pc-gnu'.
|
crossStageStatic = false;
|
||||||
if crossSystem != null && crossSystem.config == "i586-pc-gnu"
|
|
||||||
then gnu.libpthreadCross
|
|
||||||
else null;
|
|
||||||
|
|
||||||
# XXX: We have troubles cross-compiling libstdc++ on MinGW (see
|
# XXX: We have troubles cross-compiling libstdc++ on MinGW (see
|
||||||
# <http://hydra.nixos.org/build/4268232>), so don't even try.
|
# <http://hydra.nixos.org/build/4268232>), so don't even try.
|
||||||
langCC = (crossSystem == null
|
langCC = crossSystem.config != "i686-pc-mingw32";
|
||||||
|| crossSystem.config != "i686-pc-mingw32");
|
});
|
||||||
});
|
|
||||||
libc = libcCross;
|
libc = libcCross;
|
||||||
binutils = binutilsCross;
|
binutils = binutilsCross;
|
||||||
cross = assert crossSystem != null; crossSystem;
|
cross = crossSystem;
|
||||||
};
|
};
|
||||||
|
|
||||||
gcc44 = lowPrio (wrapCC (makeOverridable (import ../development/compilers/gcc/4.4) {
|
gcc44 = lowPrio (wrapCC (makeOverridable (import ../development/compilers/gcc/4.4) {
|
||||||
@ -3684,10 +3664,6 @@ let
|
|||||||
# be passed.
|
# be passed.
|
||||||
cross = null;
|
cross = null;
|
||||||
libcCross = if crossSystem != null then libcCross else null;
|
libcCross = if crossSystem != null then libcCross else null;
|
||||||
libpthreadCross =
|
|
||||||
if crossSystem != null && crossSystem.config == "i586-pc-gnu"
|
|
||||||
then gnu.libpthreadCross
|
|
||||||
else null;
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
gcc46 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.6 {
|
gcc46 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.6 {
|
||||||
@ -3705,10 +3681,6 @@ let
|
|||||||
# be passed.
|
# be passed.
|
||||||
cross = null;
|
cross = null;
|
||||||
libcCross = if crossSystem != null then libcCross else null;
|
libcCross = if crossSystem != null then libcCross else null;
|
||||||
libpthreadCross =
|
|
||||||
if crossSystem != null && crossSystem.config == "i586-pc-gnu"
|
|
||||||
then gnu.libpthreadCross
|
|
||||||
else null;
|
|
||||||
texinfo = texinfo413;
|
texinfo = texinfo413;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -3723,10 +3695,6 @@ let
|
|||||||
# be passed.
|
# be passed.
|
||||||
cross = null;
|
cross = null;
|
||||||
libcCross = if crossSystem != null then libcCross else null;
|
libcCross = if crossSystem != null then libcCross else null;
|
||||||
libpthreadCross =
|
|
||||||
if crossSystem != null && crossSystem.config == "i586-pc-gnu"
|
|
||||||
then gnu.libpthreadCross
|
|
||||||
else null;
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
gcc49 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.9 {
|
gcc49 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.9 {
|
||||||
@ -3740,10 +3708,6 @@ let
|
|||||||
# be passed.
|
# be passed.
|
||||||
cross = null;
|
cross = null;
|
||||||
libcCross = if crossSystem != null then libcCross else null;
|
libcCross = if crossSystem != null then libcCross else null;
|
||||||
libpthreadCross =
|
|
||||||
if crossSystem != null && crossSystem.config == "i586-pc-gnu"
|
|
||||||
then gnu.libpthreadCross
|
|
||||||
else null;
|
|
||||||
|
|
||||||
isl = isl_0_11;
|
isl = isl_0_11;
|
||||||
|
|
||||||
@ -3761,10 +3725,6 @@ let
|
|||||||
# be passed.
|
# be passed.
|
||||||
cross = null;
|
cross = null;
|
||||||
libcCross = if crossSystem != null then libcCross else null;
|
libcCross = if crossSystem != null then libcCross else null;
|
||||||
libpthreadCross =
|
|
||||||
if crossSystem != null && crossSystem.config == "i586-pc-gnu"
|
|
||||||
then gnu.libpthreadCross
|
|
||||||
else null;
|
|
||||||
|
|
||||||
isl = isl_0_14;
|
isl = isl_0_14;
|
||||||
}));
|
}));
|
||||||
@ -5172,12 +5132,11 @@ let
|
|||||||
gold = false;
|
gold = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
binutilsCross =
|
binutilsCross = lowPrio (forceNativeDrv (
|
||||||
if crossSystem != null && crossSystem.libc == "libSystem" then darwin.cctools_cross
|
if crossSystem.libc == "libSystem" then darwin.cctools_cross
|
||||||
else lowPrio (forceNativeDrv (import ../development/tools/misc/binutils {
|
else binutils.override {
|
||||||
inherit stdenv fetchurl zlib bison;
|
|
||||||
noSysDirs = true;
|
noSysDirs = true;
|
||||||
cross = assert crossSystem != null; crossSystem;
|
cross = crossSystem;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
bison2 = callPackage ../development/tools/parsing/bison/2.x.nix { };
|
bison2 = callPackage ../development/tools/parsing/bison/2.x.nix { };
|
||||||
@ -6158,28 +6117,19 @@ let
|
|||||||
withGd = true;
|
withGd = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
glibcCross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc)
|
glibcCross = forceNativeDrv (glibc.override {
|
||||||
(let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
|
gccCross = gccCrossStageStatic;
|
||||||
in {
|
kernelHeaders = linuxHeadersCross;
|
||||||
inherit stdenv fetchurl;
|
});
|
||||||
gccCross = gccCrossStageStatic;
|
|
||||||
kernelHeaders = if crossGNU then gnu.hurdHeaders else linuxHeadersCross;
|
|
||||||
installLocales = config.glibc.locales or false;
|
|
||||||
}
|
|
||||||
// lib.optionalAttrs crossGNU {
|
|
||||||
inherit (gnu) machHeaders hurdHeaders libpthreadHeaders mig;
|
|
||||||
inherit fetchgit;
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
# We can choose:
|
# We can choose:
|
||||||
libcCrossChooser = name : if name == "glibc" then glibcCross
|
libcCrossChooser = name: if name == "glibc" then glibcCross
|
||||||
else if name == "uclibc" then uclibcCross
|
else if name == "uclibc" then uclibcCross
|
||||||
else if name == "msvcrt" then windows.mingw_w64
|
else if name == "msvcrt" then windows.mingw_w64
|
||||||
else if name == "libSystem" then darwin.xcode
|
else if name == "libSystem" then darwin.xcode
|
||||||
else throw "Unknown libc";
|
else throw "Unknown libc";
|
||||||
|
|
||||||
libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc;
|
libcCross = libcCrossChooser crossSystem.libc;
|
||||||
|
|
||||||
# Only supported on Linux
|
# Only supported on Linux
|
||||||
glibcLocales = if stdenv.isLinux then callPackage ../development/libraries/glibc/locales.nix { } else null;
|
glibcLocales = if stdenv.isLinux then callPackage ../development/libraries/glibc/locales.nix { } else null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user