newlib: init at 3.0.0

Fixes #47533

newlib seems to think it’s a compiler when it’s not. Anyway had to
make host refer to build platform for things to work.
This commit is contained in:
Matthew Bauer
2018-10-29 14:34:10 -05:00
parent 2650a1f91e
commit 8db71d9d77
2 changed files with 41 additions and 1 deletions
+34
View File
@@ -0,0 +1,34 @@
{ stdenv, fetchurl, buildPackages }:
let version = "3.0.0";
in stdenv.mkDerivation {
name = "newlib-${version}";
src = fetchurl {
url = "ftp://sourceware.org/pub/newlib/newlib-${version}.tar.gz";
sha256 = "0chka3szh50krcz2dcxcsr1v1i000jylwnsrp2pgrrblxqsn6mn8";
};
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"
];
dontDisableStatic = true;
passthru = {
incdir = "/${stdenv.hostPlatform.config}/include";
libdir = "/${stdenv.hostPlatform.config}/lib";
};
}