systems: Allow detection of powerpc and sparc
commit7cc62144b2946796568e0125d1b56839c0b49226
authorJohn Q Crosscompiler <john.q.crosscompiler@example.com>
dateThu 26 Jul 2018, 09:33 (8 years ago)
parent812f474
lib/systems/inspect.nix+1
@@ -16,6 +16,7 @@ rec {
1616 isAarch64 = { cpu = { family = "arm"; bits = 64; }; };
1717 isMips = { cpu = { family = "mips"; }; };
1818 isRiscV = { cpu = { family = "riscv"; }; };
19+ isSparc = { cpu = { family = "sparc"; }; };
1920 isWasm = { cpu = { family = "wasm"; }; };
2021
2122 is32bit = { cpu = { bits = 32; }; };
lib/systems/parse.nix+3
@@ -93,6 +93,9 @@ rec {
9393 riscv32 = { bits = 32; significantByte = littleEndian; family = "riscv"; };
9494 riscv64 = { bits = 64; significantByte = littleEndian; family = "riscv"; };
9595
96+ sparc = { bits = 32; significantByte = bigEndian; family = "sparc"; };
97+ sparc64 = { bits = 64; significantByte = bigEndian; family = "sparc"; };
98+
9699 wasm32 = { bits = 32; significantByte = littleEndian; family = "wasm"; };
97100 wasm64 = { bits = 64; significantByte = littleEndian; family = "wasm"; };
98101 };
pkgs/build-support/bintools-wrapper/default.nix+2
@@ -185,6 +185,8 @@ stdenv.mkDerivation {
185185 "mips64" = "btsmip";
186186 "mips64el" = "ltsmip";
187187 }.${targetPlatform.parsed.cpu.name}
188+ else if targetPlatform.isPowerPC then "powerpc"
189+ else if targetPlatform.isSparc then "sparc"
188190 else throw "unknown emulation for platform: " + targetPlatform.config;
189191 in targetPlatform.platform.bfdEmulation or (fmt + sep + arch);
190192