add RISCV GCC

Needed to refresh riscv and riscv-rt Rust crates.
This commit is contained in:
Sebastien Bourdeauducq 2019-06-08 21:50:47 +08:00
parent 033659344f
commit 03dc4f6e32
2 changed files with 23 additions and 0 deletions

21
compilers/gcc.nix Normal file
View File

@ -0,0 +1,21 @@
{ stdenv, buildPackages
, fetchurl, gmp, mpfr, libmpc, platform, platform-binutils
}:
stdenv.mkDerivation rec {
basename = "gcc";
version = "9.1.0";
name = "${basename}-${platform}-${version}";
src = fetchurl {
url = "https://ftp.gnu.org/gnu/gcc/gcc-${version}/gcc-${version}.tar.xz";
sha256 = "1817nc2bqdc251k0lpc51cimna7v68xjrnvqzvc50q3ax4s6i9kr";
};
configureFlags =
[ "--target=${platform}-unknown-elf" "--disable-libgcc" "--disable-libssp" "--enable-languages=c"
"--with-as=${platform-binutils}/bin/${platform}-unknown-elf-as"
"--with-ld=${platform-binutils}/bin/${platform}-unknown-elf-ld" ];
outputs = [ "out" "info" "man" ];
hardeningDisable = [ "format" "pie" ];
propagatedBuildInputs = [ gmp mpfr libmpc platform-binutils ];
enableParallelBuilding = true;
}

View File

@ -17,7 +17,9 @@ rec {
heavycomps = pkgs.callPackage ./heavycomps.nix { inherit nmigen; };
binutils-riscv32 = pkgs.callPackage ./compilers/binutils.nix { platform = "riscv32"; };
gcc-riscv32 = pkgs.callPackage ./compilers/gcc.nix { platform = "riscv32"; platform-binutils = binutils-riscv32; };
binutils-riscv64 = pkgs.callPackage ./compilers/binutils.nix { platform = "riscv64"; };
gcc-riscv64 = pkgs.callPackage ./compilers/gcc.nix { platform = "riscv64"; platform-binutils = binutils-riscv64; };
rust-riscv32imc-crates = pkgs.callPackage ./compilers/rust-riscv32imc-crates.nix { };
fw-helloworld = pkgs.callPackage ./firmware { inherit rust-riscv32i-crates binutils-riscv32; };