kernel-headers: infer ARCH from config triple

This makes us less reliant on the systems/examples.nix. You should be
able to cross compile with just your triple:

$ nix build --arg crossSystem '{ config = "armv6l-unknown-linux-gnueabi"; }' stdenv
This commit is contained in:
Matthew Bauer 2019-04-19 14:51:25 -04:00
parent 97a3c7f5a3
commit d8934feba1
2 changed files with 8 additions and 1 deletions

View File

@ -72,6 +72,13 @@ rec {
release = null;
};
kernelArch =
if final.isAarch32 then "arm"
else if final.isAarch64 then "arm64"
else if final.isx86_32 then "x86"
else if final.isx86_64 then "ia64"
else final.parsed.cpu.name;
qemuArch =
if final.isArm then "arm"
else if final.isx86_64 then "x86_64"

View File

@ -12,7 +12,7 @@ let
inherit sha256;
};
ARCH = stdenvNoCC.hostPlatform.platform.kernelArch or (throw "missing kernelArch");
ARCH = stdenvNoCC.hostPlatform.platform.kernelArch or stdenvNoCC.hostPlatform.kernelArch;
# It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
# We do this so we have a build->build, not build->host, C compiler.