Adding a glibc variant with the memusage program

This commit is contained in:
Lluís Batlle i Rossell 2013-08-20 10:15:40 +02:00
parent e72c2ddee4
commit 2fbbe2c1a9
3 changed files with 19 additions and 5 deletions

View File

@ -8,6 +8,7 @@ cross:
, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null , machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
, mig ? null , mig ? null
, profilingLibraries ? false, meta , profilingLibraries ? false, meta
, withGd ? false, gd ? null, libpng ? null
, preConfigure ? "", ... }@args: , preConfigure ? "", ... }@args:
let let
@ -103,12 +104,13 @@ stdenv.mkDerivation ({
# To avoid linking with -lgcc_s (dynamic link) # To avoid linking with -lgcc_s (dynamic link)
# so the glibc does not depend on its compiler store path # so the glibc does not depend on its compiler store path
"libc_cv_as_needed=no" "libc_cv_as_needed=no"
]; ] ++ stdenv.lib.optional withGd "--with-gd";
installFlags = [ "sysconfdir=$(out)/etc" ]; installFlags = [ "sysconfdir=$(out)/etc" ];
buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ] buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
++ stdenv.lib.optional (mig != null) mig; ++ stdenv.lib.optional (mig != null) mig
++ stdenv.lib.optionals withGd [ gd libpng ];
# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to # Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to
# prevent a retained dependency on the bootstrap tools in the stdenv-linux # prevent a retained dependency on the bootstrap tools in the stdenv-linux
@ -125,7 +127,7 @@ stdenv.mkDerivation ({
# Remove the `gccCross' attribute so that the *native* glibc store path # Remove the `gccCross' attribute so that the *native* glibc store path
# doesn't depend on whether `gccCross' is null or not. # doesn't depend on whether `gccCross' is null or not.
// (removeAttrs args [ "gccCross" "fetchurl" "fetchgit" ]) // // (removeAttrs args [ "gccCross" "fetchurl" "fetchgit" "withGd" "gd" "libpng" ]) //
{ {
name = name + "-${version}" + name = name + "-${version}" +
@ -188,6 +190,10 @@ stdenv.mkDerivation ({
} // meta; } // meta;
} }
// stdenv.lib.optionalAttrs withGd {
preBuild = "unset NIX_DONT_SET_RPATH";
}
// stdenv.lib.optionalAttrs (hurdHeaders != null) { // stdenv.lib.optionalAttrs (hurdHeaders != null) {
# Work around the fact that the configure snippet that looks for # Work around the fact that the configure snippet that looks for
# <hurd/version.h> does not honor `--with-headers=$sysheaders' and that # <hurd/version.h> does not honor `--with-headers=$sysheaders' and that

View File

@ -5,6 +5,7 @@
, profilingLibraries ? false , profilingLibraries ? false
, gccCross ? null , gccCross ? null
, debugSymbols ? false , debugSymbols ? false
, withGd ? false, gd ? null, libpng ? null
}: }:
assert stdenv.gcc.gcc != null; assert stdenv.gcc.gcc != null;
@ -16,10 +17,11 @@ in
build cross ({ build cross ({
name = "glibc" name = "glibc"
+ stdenv.lib.optionalString (hurdHeaders != null) "-hurd" + stdenv.lib.optionalString (hurdHeaders != null) "-hurd"
+ stdenv.lib.optionalString debugSymbols "-debug"; + stdenv.lib.optionalString debugSymbols "-debug"
+ stdenv.lib.optionalString withGd "-gd";
inherit fetchurl fetchgit stdenv kernelHeaders installLocales inherit fetchurl fetchgit stdenv kernelHeaders installLocales
profilingLibraries gccCross; profilingLibraries gccCross withGd gd libpng;
builder = ./builder.sh; builder = ./builder.sh;

View File

@ -4099,6 +4099,12 @@ let
gccCross = null; gccCross = null;
}; };
glibc_memusage = callPackage ../development/libraries/glibc/2.17 {
kernelHeaders = linuxHeaders;
installLocales = false;
withGd = true;
};
glibc217Cross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.17) glibc217Cross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.17)
(let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu"; (let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
in { in {