systems: Allow detection of powerpc and sparc

This commit is contained in:
John Q Crosscompiler 2018-07-26 09:33:36 -04:00 committed by Graham Christensen
parent 812f4749ae
commit 7cc62144b2
No known key found for this signature in database
GPG Key ID: ACA1C1D120C83D5C
3 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@ rec {
isAarch64 = { cpu = { family = "arm"; bits = 64; }; };
isMips = { cpu = { family = "mips"; }; };
isRiscV = { cpu = { family = "riscv"; }; };
isSparc = { cpu = { family = "sparc"; }; };
isWasm = { cpu = { family = "wasm"; }; };
is32bit = { cpu = { bits = 32; }; };

View File

@ -93,6 +93,9 @@ rec {
riscv32 = { bits = 32; significantByte = littleEndian; family = "riscv"; };
riscv64 = { bits = 64; significantByte = littleEndian; family = "riscv"; };
sparc = { bits = 32; significantByte = bigEndian; family = "sparc"; };
sparc64 = { bits = 64; significantByte = bigEndian; family = "sparc"; };
wasm32 = { bits = 32; significantByte = littleEndian; family = "wasm"; };
wasm64 = { bits = 64; significantByte = littleEndian; family = "wasm"; };
};

View File

@ -185,6 +185,8 @@ stdenv.mkDerivation {
"mips64" = "btsmip";
"mips64el" = "ltsmip";
}.${targetPlatform.parsed.cpu.name}
else if targetPlatform.isPowerPC then "powerpc"
else if targetPlatform.isSparc then "sparc"
else throw "unknown emulation for platform: " + targetPlatform.config;
in targetPlatform.platform.bfdEmulation or (fmt + sep + arch);