or1k-newlib: Add newlib for OpenRISC 1000

This commit is contained in:
Samuel Dionne-Riel 2020-07-17 16:02:26 -04:00
parent 6d8327ea96
commit 46db711cda
2 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,36 @@
{ stdenv, texinfo, flex, bison, fetchFromGitHub, crossLibcStdenv, buildPackages }:
crossLibcStdenv.mkDerivation {
name = "newlib";
src = fetchFromGitHub {
owner = "openrisc";
repo = "newlib";
rev = "8ac94ca7bbe4ceddafe6583ee4766d3c15b18ac8";
sha256 = "0hzhijmry5slpp6x12pgng8v7jil3mn18ahrhnw431lqrs1cma0s";
};
depsBuildBuild = [ buildPackages.stdenv.cc ];
# newlib expects CC to build for build platform, not host platform
preConfigure = ''
export CC=cc
'';
configurePlatforms = [ "build" "target" ];
configureFlags = [
"--host=${stdenv.buildPlatform.config}"
"--disable-newlib-supplied-syscalls"
"--disable-nls"
"--enable-newlib-io-long-long"
"--enable-newlib-register-fini"
"--enable-newlib-retargetable-locking"
];
dontDisableStatic = true;
passthru = {
incdir = "/${stdenv.targetPlatform.config}/include";
libdir = "/${stdenv.targetPlatform.config}/lib";
};
}

View file

@ -10664,6 +10664,8 @@ in
vc4-newlib = callPackage ../development/misc/vc4/newlib.nix {};
resim = callPackage ../misc/emulators/resim {};
or1k-newlib = callPackage ../development/misc/or1k/newlib.nix {};
rappel = callPackage ../development/misc/rappel/default.nix { };
pharo-vms = callPackage ../development/pharo/vm { };
@ -12841,6 +12843,7 @@ in
else if name == "avrlibc" then targetPackages.avrlibcCross or avrlibcCross
else if name == "newlib" && stdenv.targetPlatform.isMsp430 then targetPackages.msp430NewlibCross or msp430NewlibCross
else if name == "newlib" && stdenv.targetPlatform.isVc4 then targetPackages.vc4-newlib or vc4-newlib
else if name == "newlib" && stdenv.targetPlatform.isOr1k then targetPackages.or1k-newlib or or1k-newlib
else if name == "newlib" then targetPackages.newlibCross or newlibCross
else if name == "musl" then targetPackages.muslCross or muslCross
else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64