From 472114c136a19f9f1eaa733151f7144e75c78cee Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 27 Mar 2019 16:55:36 +0800 Subject: [PATCH] add binutils --- binutils.nix | 33 +++++++++++++++++++++++++++++++++ derivations.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 binutils.nix diff --git a/binutils.nix b/binutils.nix new file mode 100644 index 0000000..ddea3fd --- /dev/null +++ b/binutils.nix @@ -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"; + }; +} diff --git a/derivations.nix b/derivations.nix index 327b676..18684a8 100644 --- a/derivations.nix +++ b/derivations.nix @@ -8,5 +8,7 @@ in rec { jtagtap = pkgs.callPackage ./jtagtap.nix { inherit nmigen; }; minerva = pkgs.callPackage ./minerva.nix { inherit nmigen; inherit jtagtap; }; 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; }; }