HeavyX/compilers/gcc.nix

22 lines
813 B
Nix
Raw Normal View History

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