Merge pull request #140507 from obsidiansystems/newlib-nano-21.05

[backport release 21.05]: newlib: Add parameter for "nano" variant
This commit is contained in:
John Ericson 2021-10-04 15:21:22 -04:00 committed by GitHub
commit 6314733b4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 4 deletions

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";
in stdenv.mkDerivation {
@ -22,10 +27,21 @@ in stdenv.mkDerivation {
"--disable-newlib-supplied-syscalls"
"--disable-nls"
"--enable-newlib-retargetable-locking"
] ++ (if !nanoizeNewlib then [
"--enable-newlib-io-long-long"
"--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;

View File

@ -15006,6 +15006,7 @@ in
else if name == "newlib" && stdenv.targetPlatform.isVc4 then targetPackages.vc4-newlib or vc4-newlib
else if name == "newlib" && stdenv.targetPlatform.isOr1k then targetPackages.or1k-newlib or or1k-newlib
else if name == "newlib" then targetPackages.newlibCross or newlibCross
else if name == "newlib-nano" then targetPackages.newlib-nanoCross or newlib-nanoCross
else if name == "musl" then targetPackages.muslCross or muslCross
else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64
else if name == "libSystem" then
@ -31621,7 +31622,15 @@ in
newlib = callPackage ../development/misc/newlib { };
newlibCross = callPackage ../development/misc/newlib {
stdenv = crossLibcStdenv;
};
};
newlib-nano = callPackage ../development/misc/newlib {
nanoizeNewlib = true;
};
newlib-nanoCross = callPackage ../development/misc/newlib {
nanoizeNewlib = true;
stdenv = crossLibcStdenv;
};
omnisharp-roslyn = callPackage ../development/tools/omnisharp-roslyn { };