Merge pull request #140055 from obsidiansystems/newlib-nano

newlib: Add parameter for "nano" variant
This commit is contained in:
John Ericson 2021-10-04 11:11:12 -04:00 committed by GitHub
commit 927a438a16
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
}:
stdenv.mkDerivation rec {
pname = "newlib";
@ -22,10 +27,21 @@ stdenv.mkDerivation rec {
"--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

@ -16086,6 +16086,7 @@ with pkgs;
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
@ -32974,7 +32975,15 @@ with pkgs;
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 { dotnet-sdk = dotnet-sdk_5; };