diff options
author | Michael Bishop <cleverca22@gmail.com> | 2019-11-02 12:47:38 -0300 |
---|---|---|
committer | Michael Bishop <cleverca22@gmail.com> | 2019-11-19 22:19:15 -0400 |
commit | 4aa1ffae041bb9c65eb3067e9dbaaa70710ed100 (patch) | |
tree | 7c1d8395796e35e95e89e4e522dd036c9ba48608 /pkgs/development/tools/misc | |
parent | 91b02cd86b09bdd3549663e81883a2c3a7e11961 (diff) | |
download | nixlib-4aa1ffae041bb9c65eb3067e9dbaaa70710ed100.tar nixlib-4aa1ffae041bb9c65eb3067e9dbaaa70710ed100.tar.gz nixlib-4aa1ffae041bb9c65eb3067e9dbaaa70710ed100.tar.bz2 nixlib-4aa1ffae041bb9c65eb3067e9dbaaa70710ed100.tar.lz nixlib-4aa1ffae041bb9c65eb3067e9dbaaa70710ed100.tar.xz nixlib-4aa1ffae041bb9c65eb3067e9dbaaa70710ed100.tar.zst nixlib-4aa1ffae041bb9c65eb3067e9dbaaa70710ed100.zip |
initial implementation of vc4 cross-compile
Diffstat (limited to 'pkgs/development/tools/misc')
-rw-r--r-- | pkgs/development/tools/misc/binutils/default.nix | 27 |
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 210659289d1e..4b3e2cc3bede 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; |