From 7cc62144b2946796568e0125d1b56839c0b49226 Mon Sep 17 00:00:00 2001 From: John Q Crosscompiler Date: Thu, 26 Jul 2018 09:33:36 -0400 Subject: [PATCH] systems: Allow detection of powerpc and sparc --- lib/systems/inspect.nix | 1 + lib/systems/parse.nix | 3 +++ pkgs/build-support/bintools-wrapper/default.nix | 2 ++ 3 files changed, 6 insertions(+) diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index c0c283469fe..0c70f2a7cd5 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -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; }; }; diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index d79947ad3de..47841a9eba5 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -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"; }; }; diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 2739537c25d..91f9e7c71e3 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -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);