2018-10-19 17:43:33 +01:00
|
|
|
{ stdenv, fetchurl, buildPackages }:
|
|
|
|
|
2019-07-02 03:15:07 +01:00
|
|
|
let version = "3.1.0";
|
2018-10-19 17:43:33 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "newlib";
|
|
|
|
inherit version;
|
2018-10-19 17:43:33 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "ftp://sourceware.org/pub/newlib/newlib-${version}.tar.gz";
|
2019-07-02 03:15:07 +01:00
|
|
|
sha256 = "0ahh3n079zjp7d9wynggwrnrs27440aac04340chf1p9476a2kzv";
|
2018-10-19 17:43:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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"
|
2018-10-12 21:21:26 +01:00
|
|
|
"--enable-newlib-retargetable-locking"
|
2018-10-19 17:43:33 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
dontDisableStatic = true;
|
|
|
|
|
|
|
|
passthru = {
|
2018-10-12 21:21:26 +01:00
|
|
|
incdir = "/${stdenv.targetPlatform.config}/include";
|
|
|
|
libdir = "/${stdenv.targetPlatform.config}/lib";
|
2018-10-19 17:43:33 +01:00
|
|
|
};
|
|
|
|
}
|