841d9c7fc1
GitOrigin-RevId: 3a8d7958a610cd3fec3a6f424480f91a1b259185
36 lines
885 B
Nix
36 lines
885 B
Nix
{ stdenv, fetchurl, buildPackages }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "newlib";
|
|
version = "4.1.0";
|
|
|
|
src = fetchurl {
|
|
url = "ftp://sourceware.org/pub/newlib/newlib-${version}.tar.gz";
|
|
sha256 = "0m01sjjyj0ib7bwlcrvmk1qkkgd66zf1dhbw716j490kymrf75pj";
|
|
};
|
|
|
|
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";
|
|
};
|
|
}
|