diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-06-28 23:17:21 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-06-28 23:17:21 -0400 |
commit | 16be434b0bec4d14a893010b46f56a64cab74cc1 (patch) | |
tree | 25e77807d55c76d42817197d576349478ff500a5 /pkgs/os-specific/linux | |
parent | d76bc8ed15cfa21d9f1cc47a06ee1fe8ac86d6d3 (diff) | |
parent | b0ada07f36abc21c990000b5cdbe780157d6b92b (diff) | |
download | nixlib-16be434b0bec4d14a893010b46f56a64cab74cc1.tar nixlib-16be434b0bec4d14a893010b46f56a64cab74cc1.tar.gz nixlib-16be434b0bec4d14a893010b46f56a64cab74cc1.tar.bz2 nixlib-16be434b0bec4d14a893010b46f56a64cab74cc1.tar.lz nixlib-16be434b0bec4d14a893010b46f56a64cab74cc1.tar.xz nixlib-16be434b0bec4d14a893010b46f56a64cab74cc1.tar.zst nixlib-16be434b0bec4d14a893010b46f56a64cab74cc1.zip |
Merge accepted cross compilation PRs into staging
Diffstat (limited to 'pkgs/os-specific/linux')
21 files changed, 44 insertions, 51 deletions
diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index a33d24fc847b..da67747b8b24 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -1,4 +1,6 @@ -{ stdenv, kernel, perl }: +{ stdenv, kernel, perl +, hostPlatform +}: let baseBuildFlags = [ "INSTALL_HDR_PATH=$(out)" "headers_install" ]; @@ -13,7 +15,7 @@ in stdenv.mkDerivation { crossAttrs = { inherit (kernel.crossDrv) src patches; - buildFlags = [ "ARCH=${stdenv.cross.platform.kernelArch}" ] ++ baseBuildFlags; + buildFlags = [ "ARCH=${hostPlatform.platform.kernelArch}" ] ++ baseBuildFlags; }; installPhase = '' diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 16b35e9aa3e2..bbe867926927 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -25,6 +25,7 @@ kernelPatches ? [] , ignoreConfigErrors ? stdenv.platform.name != "pc" , extraMeta ? {} +, hostPlatform , ... }: @@ -59,7 +60,7 @@ let arch = stdenv.platform.kernelArch; crossAttrs = let - cp = stdenv.cross.platform; + cp = hostPlatform.platform; in { arch = cp.kernelArch; platformName = cp.name; @@ -128,7 +129,7 @@ let }; config = configWithPlatform stdenv.platform; - configCross = configWithPlatform stdenv.cross.platform; + configCross = configWithPlatform hostPlatform.platform; nativeDrv = lib.addPassthru kernel.nativeDrv passthru; diff --git a/pkgs/os-specific/linux/kernel/linux-3.10.nix b/pkgs/os-specific/linux/kernel/linux-3.10.nix index 8ab879f7b00e..9587ba356ff5 100644 --- a/pkgs/os-specific/linux/kernel/linux-3.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-3.10.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, buildLinux, ... } @ args: +{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: import ./generic.nix (args // rec { version = "3.10.105"; diff --git a/pkgs/os-specific/linux/kernel/linux-4.11.nix b/pkgs/os-specific/linux/kernel/linux-4.11.nix index f74b8f62120d..3019c6fcb964 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.11.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.11.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, buildLinux, ... } @ args: +{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: import ./generic.nix (args // rec { version = "4.11.7"; diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix index 5328bb9a0432..4f272c2e43ff 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.4.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.4.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, buildLinux, ... } @ args: +{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: import ./generic.nix (args // rec { version = "4.4.73"; diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix index 38d63a22f70d..a45ba31c0a93 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.9.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, buildLinux, ... } @ args: +{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: import ./generic.nix (args // rec { version = "4.9.34"; diff --git a/pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix b/pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix index b80c9acd659e..e27b2afb200e 100644 --- a/pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix +++ b/pkgs/os-specific/linux/kernel/linux-chromiumos-3.18.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, perl, buildLinux, ncurses, ... } @ args: +{ stdenv, hostPlatform, fetchgit, perl, buildLinux, ncurses, ... } @ args: # ChromiumOS requires a 64bit build host assert stdenv.is64bit; diff --git a/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix b/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix index 36a019215124..7f4a89dc51e2 100644 --- a/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix +++ b/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, perl, buildLinux, ... } @ args: +{ stdenv, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args: let version = "4.11.7"; diff --git a/pkgs/os-specific/linux/kernel/linux-mptcp.nix b/pkgs/os-specific/linux/kernel/linux-mptcp.nix index 3d244b794e94..7e6110bf4a39 100644 --- a/pkgs/os-specific/linux/kernel/linux-mptcp.nix +++ b/pkgs/os-specific/linux/kernel/linux-mptcp.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, buildLinux, ... } @ args: +{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: import ./generic.nix (args // rec { mptcpVersion = "0.91.3"; diff --git a/pkgs/os-specific/linux/kernel/linux-rpi.nix b/pkgs/os-specific/linux/kernel/linux-rpi.nix index 9bc6feb3de22..0e7f332e6177 100644 --- a/pkgs/os-specific/linux/kernel/linux-rpi.nix +++ b/pkgs/os-specific/linux/kernel/linux-rpi.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, perl, buildLinux, ... } @ args: +{ stdenv, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args: let modDirVersion = "4.9.24"; diff --git a/pkgs/os-specific/linux/kernel/linux-testing.nix b/pkgs/os-specific/linux/kernel/linux-testing.nix index 6bde598c47ab..45c6a5bf0e88 100644 --- a/pkgs/os-specific/linux/kernel/linux-testing.nix +++ b/pkgs/os-specific/linux/kernel/linux-testing.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, buildLinux, ... } @ args: +{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: import ./generic.nix (args // rec { version = "4.12-rc6"; diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 3466cafa2660..c295293fa2cc 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -1,5 +1,6 @@ { stdenv, runCommand, nettools, bc, perl, gmp, libmpc, mpfr, kmod, openssl , writeTextFile, ubootChooser +, hostPlatform }: let @@ -232,7 +233,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKe karch = stdenv.platform.kernelArch; - crossAttrs = let cp = stdenv.cross.platform; in + crossAttrs = let cp = hostPlatform.platform; in (drvAttrs crossConfig cp (kernelPatches ++ crossKernelPatches) crossConfigfile) // { makeFlags = commonMakeFlags ++ [ "ARCH=${cp.kernelArch}" diff --git a/pkgs/os-specific/linux/kernel/perf.nix b/pkgs/os-specific/linux/kernel/perf.nix index 0a3b4070be17..3fbad924568f 100644 --- a/pkgs/os-specific/linux/kernel/perf.nix +++ b/pkgs/os-specific/linux/kernel/perf.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation { /* I don't want cross-python or cross-perl - I don't know if cross-python even works */ propagatedBuildInputs = [ elfutils.crossDrv newt.crossDrv ]; - makeFlags = "CROSS_COMPILE=${stdenv.cross.config}-"; + makeFlags = "CROSS_COMPILE=${stdenv.cc.prefix}"; elfutils = elfutils.crossDrv; inherit (kernel.crossDrv) src patches; }; diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix index 84b66ac0d9c7..92ac1a77898c 100644 --- a/pkgs/os-specific/linux/klibc/default.nix +++ b/pkgs/os-specific/linux/klibc/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, linuxHeaders, perl }: +{ stdenv, fetchurl, linuxHeaders, perl +, buildPlatform, hostPlatform +}: let commonMakeFlags = [ @@ -23,17 +25,12 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" "stackprotector" ]; makeFlags = commonMakeFlags ++ [ - "KLIBCARCH=${stdenv.platform.kernelArch}" + "KLIBCARCH=${hostPlatform.platform.kernelArch}" "KLIBCKERNELSRC=${linuxHeaders}" - ] ++ stdenv.lib.optional (stdenv.platform.kernelArch == "arm") "CONFIG_AEABI=y"; - - crossAttrs = { - makeFlags = commonMakeFlags ++ [ - "KLIBCARCH=${stdenv.cross.platform.kernelArch}" - "KLIBCKERNELSRC=${linuxHeaders.crossDrv}" - "CROSS_COMPILE=${stdenv.cross.config}-" - ] ++ stdenv.lib.optional (stdenv.cross.platform.kernelArch == "arm") "CONFIG_AEABI=y"; - }; + ] # TODO(@Ericson2314): We now can get the ABI from + # `hostPlatform.parsed.abi`, is this still a good idea? + ++ stdenv.lib.optional (hostPlatform.platform.kernelArch == "arm") "CONFIG_AEABI=y" + ++ stdenv.lib.optional (hostPlatform != buildPlatform) "CROSS_COMPILE=${stdenv.cc.prefix}"; # Install static binaries as well. postInstall = '' diff --git a/pkgs/os-specific/linux/mdadm/4.nix b/pkgs/os-specific/linux/mdadm/4.nix index 05d98de0b234..a83e7c852ee2 100644 --- a/pkgs/os-specific/linux/mdadm/4.nix +++ b/pkgs/os-specific/linux/mdadm/4.nix @@ -1,4 +1,7 @@ -{ stdenv, fetchurl, groff }: +{ stdenv +, fetchurl, groff +, buildPlatform, hostPlatform +}: assert stdenv.isLinux; @@ -19,8 +22,8 @@ stdenv.mkDerivation rec { makeFlags = [ "NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin" "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm" - ] ++ stdenv.lib.optionals (stdenv ? cross) [ - "CROSS_COMPILE=${stdenv.cross.config}-" + ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.prefix}" ]; nativeBuildInputs = [ groff ]; diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix index e0109791ef22..589099c911cf 100644 --- a/pkgs/os-specific/linux/mdadm/default.nix +++ b/pkgs/os-specific/linux/mdadm/default.nix @@ -1,4 +1,7 @@ -{ stdenv, fetchurl, groff }: +{ stdenv +, fetchurl, groff +, buildPlatform, hostPlatform +}: assert stdenv.isLinux; @@ -19,8 +22,8 @@ stdenv.mkDerivation rec { makeFlags = [ "NIXOS=1" "INSTALL=install" "INSTALL_BINDIR=$(out)/sbin" "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm" - ] ++ stdenv.lib.optionals (stdenv ? cross) [ - "CROSS_COMPILE=${stdenv.cross.config}-" + ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.prefix}" ]; nativeBuildInputs = [ groff ]; diff --git a/pkgs/os-specific/linux/mingetty/default.nix b/pkgs/os-specific/linux/mingetty/default.nix index 4e2888fa942a..a8348acd5d76 100644 --- a/pkgs/os-specific/linux/mingetty/default.nix +++ b/pkgs/os-specific/linux/mingetty/default.nix @@ -8,10 +8,6 @@ stdenv.mkDerivation { sha256 = "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"; }; - crossAttrs = { - makeFlags = "CC=${stdenv.cross.config}-gcc"; - }; - preInstall = '' mkdir -p $out/sbin $out/share/man/man8 makeFlagsArray=(SBINDIR=$out/sbin MANDIR=$out/share/man/man8) diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix index 36f623f38b3a..2fcf6dbf3c00 100644 --- a/pkgs/os-specific/linux/procps-ng/default.nix +++ b/pkgs/os-specific/linux/procps-ng/default.nix @@ -15,10 +15,6 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - crossAttrs = { - CC = stdenv.cross.config + "-gcc"; - }; - # Too red configureFlags = [ "--disable-modern-top" ]; diff --git a/pkgs/os-specific/linux/procps/watch.nix b/pkgs/os-specific/linux/procps/watch.nix index 2547e26def4b..5fdd1287a647 100644 --- a/pkgs/os-specific/linux/procps/watch.nix +++ b/pkgs/os-specific/linux/procps/watch.nix @@ -15,10 +15,6 @@ stdenv.mkDerivation { enableParallelBuilding = true; - crossAttrs = { - CC = stdenv.cross.config + "-gcc"; - }; - installPhase = "mkdir $out; mkdir -p $out/bin; cp -p watch $out/bin"; meta = { diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix index 6d83c98a422e..0c0edde05e22 100644 --- a/pkgs/os-specific/linux/shadow/default.nix +++ b/pkgs/os-specific/linux/shadow/default.nix @@ -1,11 +1,13 @@ { stdenv, fetchpatch, fetchFromGitHub, autoreconfHook, libxslt, libxml2 , docbook_xml_dtd_412, docbook_xsl, gnome_doc_utils, flex, bison -, pam ? null, glibcCross ? null }: +, pam ? null, glibcCross ? null +, buildPlatform, hostPlatform +}: let glibc = - if stdenv ? cross + if hostPlatform != buildPlatform then glibcCross else assert stdenv ? glibc; stdenv.glibc; diff --git a/pkgs/os-specific/linux/sysvinit/default.nix b/pkgs/os-specific/linux/sysvinit/default.nix index 042e601ec14f..6ec8abdc1760 100644 --- a/pkgs/os-specific/linux/sysvinit/default.nix +++ b/pkgs/os-specific/linux/sysvinit/default.nix @@ -15,11 +15,7 @@ stdenv.mkDerivation { sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h ''; - makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man"; - - crossAttrs = { - makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man CC=${stdenv.cross.config}-gcc"; - }; + makeFlags = [ "SULOGINLIBS=-lcrypt" "ROOT=$(out)" "MANDIR=/share/man" ]; preInstall = '' |