add binutils

This commit is contained in:
Sebastien Bourdeauducq 2019-03-27 16:55:36 +08:00
parent ed53324019
commit 472114c136
2 changed files with 35 additions and 0 deletions

33
binutils.nix Normal file
View File

@ -0,0 +1,33 @@
{ stdenv, buildPackages
, fetchurl, zlib, platform
}:
stdenv.mkDerivation rec {
basename = "binutils";
version = "2.30";
name = "${basename}-${platform}-${version}";
src = fetchurl {
url = "https://ftp.gnu.org/gnu/binutils/binutils-${version}.tar.bz2";
sha256 = "028cklfqaab24glva1ks2aqa1zxa6w6xmc8q34zs1sb7h22dxspg";
};
configureFlags =
[ "--enable-shared" "--enable-deterministic-archives" "--target=${platform}-linux"];
outputs = [ "out" "info" "man" ];
depsBuildBuild = [ buildPackages.stdenv.cc ];
buildInputs = [ zlib ];
enableParallelBuilding = true;
meta = {
description = "Tools for manipulating binaries (linker, assembler, etc.)";
longDescription = ''
The GNU Binutils are a collection of binary tools. The main
ones are `ld' (the GNU linker) and `as' (the GNU assembler).
They also include the BFD (Binary File Descriptor) library,
`gprof', `nm', `strip', etc.
'';
homepage = http://www.gnu.org/software/binutils/;
license = stdenv.lib.licenses.gpl3Plus;
/* Give binutils a lower priority than gcc-wrapper to prevent a
collision due to the ld/as wrappers/symlinks in the latter. */
priority = "10";
};
}

View File

@ -8,5 +8,7 @@ in rec {
jtagtap = pkgs.callPackage ./jtagtap.nix { inherit nmigen; }; jtagtap = pkgs.callPackage ./jtagtap.nix { inherit nmigen; };
minerva = pkgs.callPackage ./minerva.nix { inherit nmigen; inherit jtagtap; }; minerva = pkgs.callPackage ./minerva.nix { inherit nmigen; inherit jtagtap; };
heavycomps = pkgs.callPackage ./heavycomps.nix { inherit nmigen; }; heavycomps = pkgs.callPackage ./heavycomps.nix { inherit nmigen; };
binutils-riscv = pkgs.callPackage ./binutils.nix { platform = "riscv32"; };
binutils-or1k = pkgs.callPackage ./binutils.nix { platform = "or1k"; };
llvm-hx = pkgs.callPackage ./llvm-hx.nix { inherit llvm-src; }; llvm-hx = pkgs.callPackage ./llvm-hx.nix { inherit llvm-src; };
} }