Skip to content

Instantly share code, notes, and snippets.

@NickCao
Created December 8, 2022 06:59
Show Gist options
  • Save NickCao/bf6249c10cef5f8039e3618372abbc6a to your computer and use it in GitHub Desktop.
Save NickCao/bf6249c10cef5f8039e3618372abbc6a to your computer and use it in GitHub Desktop.
riscv-gnu-toolchain.nix
{ lib
, stdenv
, fetchFromGitHub
, util-linux
, git
, cacert
, autoconf
, automake
, curl
, python3
, gawk
, bison
, flex
, texinfo
, gperf
, bc
, libmpc
, mpfr
, gmp
, zlib
, expat
}:
stdenv.mkDerivation rec {
pname = "riscv-gnu-toolchain";
version = "2022.11.23";
src = fetchFromGitHub {
owner = "riscv-collab";
repo = "riscv-gnu-toolchain";
rev = "${version}";
sha256 = "sha256-5BWWbjQ65/tDpWmY9r+oA013OhVkjga8GCLK90ZXe5k=";
leaveDotGit = true;
};
postPatch = ''
# hack for unknown issue in fetchgit
git reset --hard
patchShebangs ./scripts
'';
nativeBuildInputs = [
python3
util-linux
git
cacert
autoconf
automake
curl
python3
gawk
bison
flex
texinfo
gperf
bc
];
buildInputs = [
libmpc
mpfr
gmp
zlib
expat
];
configureFlags = [
"--enable-multilib"
];
makeFlags = [
"newlib"
"linux"
];
hardeningDisable = [
"format"
];
enableParallelBuilding = true;
__noChroot = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment