diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-04-20 16:52:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-20 16:52:26 -0400 |
commit | c351eb2842367845790fda0631ac9917ce6c832b (patch) | |
tree | 0d195fe4ad2eb8c25b3ef11573fdf0712e543b19 /lib | |
parent | bfd9eaeb5379de060b4bed7aabe2e5383b7da96f (diff) | |
parent | 4224b034cc9cf415517f5779c7a6fc5fda2ff635 (diff) | |
download | nixlib-c351eb2842367845790fda0631ac9917ce6c832b.tar nixlib-c351eb2842367845790fda0631ac9917ce6c832b.tar.gz nixlib-c351eb2842367845790fda0631ac9917ce6c832b.tar.bz2 nixlib-c351eb2842367845790fda0631ac9917ce6c832b.tar.lz nixlib-c351eb2842367845790fda0631ac9917ce6c832b.tar.xz nixlib-c351eb2842367845790fda0631ac9917ce6c832b.tar.zst nixlib-c351eb2842367845790fda0631ac9917ce6c832b.zip |
Merge pull request #59897 from matthewbauer/mb-cross-fixes2
Miscellaneous cross compilation fixes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/systems/default.nix | 14 | ||||
-rw-r--r-- | lib/systems/parse.nix | 46 |
2 files changed, 43 insertions, 17 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 52b9bd46e600..b45a5fd8d2ba 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -72,16 +72,22 @@ 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" else if final.isx86 then "i386" else { "powerpc" = "ppc"; + "powerpcle" = "ppc"; "powerpc64" = "ppc64"; - "powerpc64le" = "ppc64"; - "mips64" = "mips"; - "mipsel64" = "mipsel"; + "powerpc64le" = "ppc64le"; }.${final.parsed.cpu.name} or final.parsed.cpu.name; emulator = pkgs: let @@ -103,7 +109,7 @@ rec { in if final.parsed.kernel.name == pkgs.stdenv.hostPlatform.parsed.kernel.name && pkgs.stdenv.hostPlatform.isCompatible final - then "${pkgs.runtimeShell} -c" + then "${pkgs.runtimeShell} -c '\"$@\"' --" else if final.isWindows then "${wine}/bin/${wine-name}" else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 8cc7d3ae271f..3e23a721f0d9 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -127,22 +127,42 @@ rec { (b == i386 && isCompatible a i486) (b == i486 && isCompatible a i586) (b == i586 && isCompatible a i686) - # NOTE: Not true in some cases. Like in WSL mode. + + # XXX: Not true in some cases. Like in WSL mode. (b == i686 && isCompatible a x86_64) - # ARM + # ARMv4 (b == arm && isCompatible a armv5tel) - (b == armv5tel && isCompatible a armv6m) - (b == armv6m && isCompatible a armv6l) - (b == armv6l && isCompatible a armv7a) - (b == armv7a && isCompatible a armv7r) - (b == armv7r && isCompatible a armv7m) - (b == armv7m && isCompatible a armv7l) - (b == armv7l && isCompatible a armv8a) - (b == armv8a && isCompatible a armv8r) - (b == armv8r && isCompatible a armv8m) - # NOTE: not always true! Some arm64 cpus don’t support arm32 mode. - (b == armv8m && isCompatible a aarch64) + + # ARMv5 + (b == armv5tel && isCompatible a armv6l) + + # ARMv6 + (b == armv6l && isCompatible a armv6m) + (b == armv6m && isCompatible a armv7l) + + # ARMv7 + (b == armv7l && isCompatible a armv7a) + (b == armv7l && isCompatible a armv7r) + (b == armv7l && isCompatible a armv7m) + (b == armv7a && isCompatible a armv8a) + (b == armv7r && isCompatible a armv8a) + (b == armv7m && isCompatible a armv8a) + (b == armv7a && isCompatible a armv8r) + (b == armv7r && isCompatible a armv8r) + (b == armv7m && isCompatible a armv8r) + (b == armv7a && isCompatible a armv8m) + (b == armv7r && isCompatible a armv8m) + (b == armv7m && isCompatible a armv8m) + + # ARMv8 + (b == armv8r && isCompatible a armv8a) + (b == armv8m && isCompatible a armv8a) + + # XXX: not always true! Some arm64 cpus don’t support arm32 mode. + (b == aarch64 && a == armv8a) + (b == armv8a && isCompatible a aarch64) + (b == aarch64 && a == aarch64_be) (b == aarch64_be && isCompatible a aarch64) |