about summary refs log tree commit diff
path: root/pkgs/development/tools/misc
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-11-24 16:04:15 -0500
committerGitHub <noreply@github.com>2019-11-24 16:04:15 -0500
commit814f9104d721dcbf267720d8964095626b45321b (patch)
treefe67ce45a164e7977776c8d822684339ca4e37a6 /pkgs/development/tools/misc
parent3e3918d02ab6b06e96d57b3cca3fe5d08c1afc85 (diff)
parent4aa1ffae041bb9c65eb3067e9dbaaa70710ed100 (diff)
Merge pull request #72657 from cleverca22/vc4
Initial implementation of vc4 cross-compile
Diffstat (limited to 'pkgs/development/tools/misc')
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix27
1 files changed, 19 insertions, 8 deletions
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 210659289d1e2..4b3e2cc3bede5 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -1,11 +1,13 @@
 { stdenv, lib, buildPackages
-, fetchurl, zlib, autoreconfHook, gettext
+, fetchFromGitHub, fetchurl, zlib, autoreconfHook, gettext
 # Enabling all targets increases output size to a multiple.
 , withAllTargets ? false, libbfd, libopcodes
 , enableShared ? true
 , noSysDirs
 , gold ? !stdenv.buildPlatform.isDarwin || stdenv.hostPlatform == stdenv.targetPlatform
 , bison ? null
+, flex
+, texinfo
 }:
 
 let
@@ -20,16 +22,23 @@ let
   # PATH to both be usable.
   targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
                   "${stdenv.targetPlatform.config}-";
+  vc4-binutils-src = fetchFromGitHub {
+    owner = "itszor";
+    repo = "binutils-vc4";
+    rev = "708acc851880dbeda1dd18aca4fd0a95b2573b36";
+    sha256 = "1kdrz6fki55lm15rwwamn74fnqpy0zlafsida2zymk76n3656c63";
+  };
+  # HACK to ensure that we preserve source from bootstrap binutils to not rebuild LLVM
+  normal-src = stdenv.__bootPackages.binutils-unwrapped.src or (fetchurl {
+    url = "mirror://gnu/binutils/${basename}.tar.bz2";
+    sha256 = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z";
+  });
 in
 
 stdenv.mkDerivation {
   name = targetPrefix + basename;
 
-  # HACK to ensure that we preserve source from bootstrap binutils to not rebuild LLVM
-  src = stdenv.__bootPackages.binutils-unwrapped.src or (fetchurl {
-    url = "mirror://gnu/binutils/${basename}.tar.bz2";
-    sha256 = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z";
-  });
+  src = if stdenv.targetPlatform.isVc4 then vc4-binutils-src else normal-src;
 
   patches = [
     # Make binutils output deterministic by default.
@@ -54,6 +63,8 @@ stdenv.mkDerivation {
     # cross-compiling.
     ./always-search-rpath.patch
 
+  ] ++ lib.optionals (!stdenv.targetPlatform.isVc4)
+  [
     # https://sourceware.org/bugzilla/show_bug.cgi?id=22868
     ./gold-symbol-visibility.patch
 
@@ -69,9 +80,9 @@ stdenv.mkDerivation {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [
     bison
-  ] ++ lib.optionals stdenv.targetPlatform.isiOS [
+  ] ++ (lib.optionals stdenv.targetPlatform.isiOS [
     autoreconfHook
-  ];
+  ]) ++ lib.optionals stdenv.targetPlatform.isVc4 [ texinfo flex ];
   buildInputs = [ zlib gettext ];
 
   inherit noSysDirs;