Created
December 8, 2022 06:59
-
-
Save NickCao/bf6249c10cef5f8039e3618372abbc6a to your computer and use it in GitHub Desktop.
riscv-gnu-toolchain.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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