Browse Source

add RISCV GCC

Needed to refresh riscv and riscv-rt Rust crates.
pull/1/head
parent
commit
03dc4f6e32
  1. 21
      compilers/gcc.nix
  2. 2
      default.nix

21
compilers/gcc.nix

@ -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;
}

2
default.nix

@ -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; };

Loading…
Cancel
Save