diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2018-10-19 11:43:33 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2018-10-29 14:34:10 -0500 |
commit | 8db71d9d773956d41778b88d88ead126a0138e67 (patch) | |
tree | 1f474caa00b8622f97c025301163cea07ea08e86 /pkgs/development/misc/newlib | |
parent | 2650a1f91ed08049cc6a70051ef238d0fb3dc9e5 (diff) |
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.
Diffstat (limited to 'pkgs/development/misc/newlib')
-rw-r--r-- | pkgs/development/misc/newlib/default.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/misc/newlib/default.nix b/pkgs/development/misc/newlib/default.nix new file mode 100644 index 0000000000000..e26f0f78f2102 --- /dev/null +++ b/pkgs/development/misc/newlib/default.nix @@ -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"; + }; +} |