newlib: Add parameter for "nano" variant

This commit is contained in:
John Ericson 2021-09-29 21:18:21 -04:00
parent 413a0aa722
commit d1c08981f6

View File

@ -1,4 +1,9 @@
{ stdenv, fetchurl, buildPackages }: { stdenv, fetchurl, buildPackages
, # "newlib-nano" is what the official ARM embedded toolchain calls this build
# configuration that prioritizes low space usage. We include it as a preset
# for embedded projects striving for a similar configuration.
nanoizeNewlib ? false
}:
let version = "3.3.0"; let version = "3.3.0";
in stdenv.mkDerivation { in stdenv.mkDerivation {
@ -22,10 +27,21 @@ in stdenv.mkDerivation {
"--disable-newlib-supplied-syscalls" "--disable-newlib-supplied-syscalls"
"--disable-nls" "--disable-nls"
"--enable-newlib-retargetable-locking"
] ++ (if !nanoizeNewlib then [
"--enable-newlib-io-long-long" "--enable-newlib-io-long-long"
"--enable-newlib-register-fini" "--enable-newlib-register-fini"
"--enable-newlib-retargetable-locking" ] else [
]; "--enable-newlib-reent-small"
"--disable-newlib-fvwrite-in-streamio"
"--disable-newlib-fseek-optimization"
"--disable-newlib-wide-orient"
"--enable-newlib-nano-malloc"
"--disable-newlib-unbuf-stream-opt"
"--enable-lite-exit"
"--enable-newlib-global-atexit"
"--enable-newlib-nano-formatted-io"
]);
dontDisableStatic = true; dontDisableStatic = true;