summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2018-07-26 14:21:20 -0400
committerGitHub <noreply@github.com>2018-07-26 14:21:20 -0400
commitbbe31da148bb7003f22412ce1e5348a1d2bccef3 (patch)
treea31b5a8935d6b71298287d15108795a65783380e
parent1f47fe8442be601109bc9ccd108e92f15c3c7d9a (diff)
parent7cc62144b2946796568e0125d1b56839c0b49226 (diff)
downloadnixpkgs-bbe31da148bb7003f22412ce1e5348a1d2bccef3.tar
nixpkgs-bbe31da148bb7003f22412ce1e5348a1d2bccef3.tar.gz
nixpkgs-bbe31da148bb7003f22412ce1e5348a1d2bccef3.tar.bz2
nixpkgs-bbe31da148bb7003f22412ce1e5348a1d2bccef3.tar.lz
nixpkgs-bbe31da148bb7003f22412ce1e5348a1d2bccef3.tar.xz
nixpkgs-bbe31da148bb7003f22412ce1e5348a1d2bccef3.tar.zst
nixpkgs-bbe31da148bb7003f22412ce1e5348a1d2bccef3.zip
Merge pull request #44124 from grahamc/sparc
systems: Allow detection of powerpc and sparc
-rw-r--r--lib/systems/inspect.nix1
-rw-r--r--lib/systems/parse.nix3
-rw-r--r--pkgs/build-support/bintools-wrapper/default.nix2
3 files changed, 6 insertions, 0 deletions
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);