Merge glibc-2.18 branch into stdenv-updates

It's to separate from other changes coming from master.

Conflicts:
	pkgs/development/libraries/glibc/2.18/common.nix (taking both changes)
	pkgs/development/libraries/ncurses/5_4.nix (deleted)
This commit is contained in:
Vladimír Čunát 2013-12-28 18:26:50 +01:00
commit cb639302df
62 changed files with 1874 additions and 1501 deletions

View File

@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
export DVIDecodeDelegate=${tetex}/bin/dvips
'' else "";
configureFlags = "" + stdenv.lib.optionalString (ghostscript != null && stdenv.system != "x86_64-darwin") ''
configureFlags = "" + stdenv.lib.optionalString (stdenv.system != "x86_64-darwin") ''
--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts
--with-gslib
'' + ''
@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
propagatedBuildInputs =
[ bzip2 fontconfig freetype libjpeg libpng libtiff libxml2 zlib librsvg
libtool jasper libX11
] ++ stdenv.lib.optional (ghostscript != null && stdenv.system != "x86_64-darwin") ghostscript;
] ++ stdenv.lib.optional (stdenv.system != "x86_64-darwin") ghostscript;
buildInputs = [ tetex pkgconfig ];

View File

@ -0,0 +1,36 @@
{ stdenv, fetchurl, pkgconfig, libX11, libXft, libXinerama, libXpm }:
stdenv.mkDerivation rec {
name = "dzen2-0.9.5";
buildInputs = [ pkgconfig libX11 libXft libXinerama libXpm ];
src = fetchurl {
url = "https://github.com/robm/dzen/tarball/master/dzen2-0.9.5git.tar.gz";
sha256 = "d4f7943cd39dc23fd825eb684b49dc3484860fa8443d30b06ee38af72a53b556";
};
patchPhase = ''
CFLAGS=" -Wall -Os ''${INCS} -DVERSION=\"''${VERSION}\" -DDZEN_XINERAMA -DDZEN_XPM -DDZEN_XFT `pkg-config --cflags xft`"
LIBS=" -L/usr/lib -lc -lXft -lXpm -lXinerama -lX11"
echo "CFLAGS=$CFLAGS" >>config.mk
echo "LIBS=$LIBS" >>config.mk
echo "LDFLAGS=$LIBS" >>config.mk
substituteInPlace config.mk --replace /usr/local "$out"
substituteInPlace gadgets/config.mk --replace /usr/local "$out"
'';
buildPhase = ''
mkdir -p $out/bin $out/man/man1
make clean install
cd gadgets
make clean install
'';
meta = {
homepage = https://github.com/robm/dzen;
license = stdenv.lib.licenses.mit;
description = "X notification utility";
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -246,7 +246,7 @@ stdenv.mkDerivation ({
enableMultilib version; };
# ghdl does not build fine with parallel building
enableParallelBuilding = !langVhdl;
enableParallelBuilding = !langVhdl && !langAda;
meta = {
homepage = http://gcc.gnu.org/;

View File

@ -360,7 +360,7 @@ stdenv.mkDerivation ({
passthru = { inherit langC langCC langAda langFortran langVhdl
enableMultilib version; };
enableParallelBuilding = true;
enableParallelBuilding = !langAda;
meta = {
homepage = http://gcc.gnu.org/;

View File

@ -434,7 +434,7 @@ stdenv.mkDerivation ({
passthru = { inherit langC langCC langAda langFortran langVhdl
langGo version; };
enableParallelBuilding = true;
enableParallelBuilding = !langAda;
inherit (stdenv) is64bit;

View File

@ -69,6 +69,7 @@ stdenv.mkDerivation {
sha256 = "15k91ihzs6190pnryh4cl0b3c2pjpl9d790mr14x16zq52y7px2d";
})
./time_utc_144.patch
./boost-149-cstdint.patch
];
crossAttrs = rec {

View File

@ -57,7 +57,7 @@ stdenv.mkDerivation {
};
# See <http://svn.boost.org/trac/boost/ticket/4688>.
patches = [ ./boost_filesystem_post_1_49_0.patch ./time_utc.patch ] ++ (stdenv.lib.optional stdenv.isDarwin ./boost-149-darwin.patch );
patches = [ ./boost_filesystem_post_1_49_0.patch ./time_utc.patch ./boost-149-cstdint.patch ] ++ (stdenv.lib.optional stdenv.isDarwin ./boost-149-darwin.patch );
enableParallelBuilding = true;

View File

@ -1,91 +0,0 @@
{ stdenv, fetchurl, icu, expat, zlib, bzip2, python
, enableRelease ? true
, enableDebug ? false
, enableSingleThreaded ? false
, enableMultiThreaded ? true
, enableShared ? true
, enableStatic ? false
, enablePIC ? false
, enableExceptions ? false
, taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
}:
let
variant = stdenv.lib.concatStringsSep ","
(stdenv.lib.optional enableRelease "release" ++
stdenv.lib.optional enableDebug "debug");
threading = stdenv.lib.concatStringsSep ","
(stdenv.lib.optional enableSingleThreaded "single" ++
stdenv.lib.optional enableMultiThreaded "multi");
link = stdenv.lib.concatStringsSep ","
(stdenv.lib.optional enableShared "shared" ++
stdenv.lib.optional enableStatic "static");
# To avoid library name collisions
layout = if taggedLayout then "tagged" else "system";
cflags = if enablePIC && enableExceptions then
"cflags=\"-fPIC -fexceptions\" cxxflags=-fPIC linkflags=-fPIC"
else if enablePIC then
"cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
else if enableExceptions then
"cflags=-fexceptions"
else
"";
in
stdenv.mkDerivation {
name = "boost-1.53.0";
meta = {
homepage = "http://boost.org/";
description = "Boost C++ Library Collection";
license = "boost-license";
platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.simons ];
};
src = fetchurl {
url = "mirror://sourceforge/boost/boost_1_53_0.tar.bz2";
sha256 = "15livg6y1l3gdsg6ybvp3y4gp0w3xh1rdcq5bjf0qaw804dh92pq";
};
enableParallelBuilding = true;
buildInputs = [icu expat zlib bzip2 python];
configureScript = "./bootstrap.sh";
configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python";
buildPhase = "./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install";
# normal install does not install bjam, this is a separate step
installPhase = ''
cd tools/build/v2
sh bootstrap.sh
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install
'';
crossAttrs = rec {
buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
# override them.
propagatedBuildInputs = buildInputs;
# We want to substitute the contents of configureFlags, removing thus the
# usual --build and --host added on cross building.
preConfigure = ''
export configureFlags="--prefix=$out --without-icu"
'';
buildPhase = ''
set -x
cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ;
EOF
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
'';
};
}

View File

@ -1,91 +0,0 @@
{ stdenv, fetchurl, icu, expat, zlib, bzip2, python
, enableRelease ? true
, enableDebug ? false
, enableSingleThreaded ? false
, enableMultiThreaded ? true
, enableShared ? true
, enableStatic ? false
, enablePIC ? false
, enableExceptions ? false
, taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
}:
let
variant = stdenv.lib.concatStringsSep ","
(stdenv.lib.optional enableRelease "release" ++
stdenv.lib.optional enableDebug "debug");
threading = stdenv.lib.concatStringsSep ","
(stdenv.lib.optional enableSingleThreaded "single" ++
stdenv.lib.optional enableMultiThreaded "multi");
link = stdenv.lib.concatStringsSep ","
(stdenv.lib.optional enableShared "shared" ++
stdenv.lib.optional enableStatic "static");
# To avoid library name collisions
layout = if taggedLayout then "tagged" else "system";
cflags = if enablePIC && enableExceptions then
"cflags=\"-fPIC -fexceptions\" cxxflags=-fPIC linkflags=-fPIC"
else if enablePIC then
"cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
else if enableExceptions then
"cflags=-fexceptions"
else
"";
in
stdenv.mkDerivation {
name = "boost-1.54.0";
meta = {
homepage = "http://boost.org/";
description = "Boost C++ Library Collection";
license = "boost-license";
platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.simons ];
};
src = fetchurl {
url = "mirror://sourceforge/boost/boost_1_54_0.tar.bz2";
sha256 = "07df925k56pbz3gvhxpx54aij34qd40a7sxw4im11brnwdyr4zh4";
};
enableParallelBuilding = true;
buildInputs = [icu expat zlib bzip2 python];
configureScript = "./bootstrap.sh";
configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python";
buildPhase = "./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install";
# normal install does not install bjam, this is a separate step
installPhase = ''
cd tools/build/v2
sh bootstrap.sh
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install
'';
crossAttrs = rec {
buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
# all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
# override them.
propagatedBuildInputs = buildInputs;
# We want to substitute the contents of configureFlags, removing thus the
# usual --build and --host added on cross building.
preConfigure = ''
export configureFlags="--prefix=$out --without-icu"
'';
buildPhase = ''
set -x
cat << EOF > user-config.jam
using gcc : cross : $crossConfig-g++ ;
EOF
./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
'';
};
}

View File

@ -0,0 +1,15 @@
diff -ru -x '*~' boost_1_49_0-orig/boost/cstdint.hpp boost_1_49_0/boost/cstdint.hpp
--- boost_1_49_0-orig/boost/cstdint.hpp 2012-01-29 22:58:13.000000000 +0100
+++ boost_1_49_0/boost/cstdint.hpp 2013-12-10 11:48:19.304042208 +0100
@@ -41,7 +41,10 @@
// so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG.
// See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990
//
-#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG))
+#if defined(BOOST_HAS_STDINT_H) \
+ && (!defined(__GLIBC__) \
+ || defined(__GLIBC_HAVE_LONG_LONG) \
+ || (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 17)))))
// The following #include is an implementation artifact; not part of interface.
# ifdef __hpux

View File

@ -9,7 +9,8 @@ stdenv.mkDerivation {
sha256 = "0dk9jx9hjjwsgly0iwvr5hhw870zlx21gwar7zxlzfq0zdzqqkpa";
};
doCheck = true;
# Test can randomly fail: http://hydra.nixos.org/build/7243912
doCheck = false;
meta = {
description = "Check, a unit testing framework for C";

View File

@ -1,54 +0,0 @@
# Glibc cannot have itself in its RPATH.
export NIX_NO_SELF_RPATH=1
source $stdenv/setup
postConfigure() {
# Hack: get rid of the `-static' flag set by the bootstrap stdenv.
# This has to be done *after* `configure' because it builds some
# test binaries.
export NIX_CFLAGS_LINK=
export NIX_LDFLAGS_BEFORE=
export NIX_DONT_SET_RPATH=1
unset CFLAGS
}
postInstall() {
if test -n "$installLocales"; then
make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales
fi
test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
# FIXME: Use `test -n $linuxHeaders' when `kernelHeaders' has been
# renamed.
if test -z "$hurdHeaders"; then
# Include the Linux kernel headers in Glibc, except the `scsi'
# subdirectory, which Glibc provides itself.
(cd $out/include && \
ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .)
fi
if test -f "$out/lib/libhurduser.so"; then
# libc.so, libhurduser.so, and libmachuser.so depend on each
# other, so add them to libc.so (a RUNPATH on libc.so.0.3
# would be ignored by the cross-linker.)
echo "adding \`libhurduser.so' and \`libmachuser.so' to the \`libc.so' linker script..."
sed -i "$out/lib/libc.so" \
-e"s|\(libc\.so\.[^ ]\+\>\)|\1 $out/lib/libhurduser.so $out/lib/libmachuser.so|g"
fi
# Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink
# "lib64" to "lib".
if test -n "$is64bit"; then
ln -s lib $out/lib64
fi
# This file, that should not remain in the glibc derivation,
# may have not been created during the preInstall
rm -f $out/lib/libgcc_s.so.1
}
genericBuild

View File

@ -1,13 +0,0 @@
https://bugzilla.redhat.com/show_bug.cgi?id=454629
--- glibc-20090510T1842/localedata/locales/ca_ES.orig 2009-06-26 14:05:18.422043552 +0200
+++ glibc-20090510T1842/localedata/locales/ca_ES 2009-06-26 14:05:38.292042700 +0200
@@ -138,6 +138,8 @@
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_weekday 2
+first_workday 2
END LC_TIME
LC_PAPER

View File

@ -1,244 +0,0 @@
/* Build configuration used to build glibc, Info files, and locale
information. */
cross :
{ name, fetchurl, stdenv, installLocales ? false
, gccCross ? null, kernelHeaders ? null
, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
, mig ? null, fetchgit ? null
, profilingLibraries ? false, meta
, preConfigure ? "", ... }@args :
let
# For GNU/Hurd, see below.
version = if hurdHeaders != null then "20120223" else "2.13";
needsPortsNative = stdenv.isMips || stdenv.isArm;
needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
needsPorts =
if (stdenv ? cross) && stdenv.cross != null && hurdHeaders == null then true
else if cross == null then needsPortsNative
else needsPortsCross;
srcPorts = fetchurl {
url = "mirror://gnu/glibc/glibc-ports-2.13.tar.bz2";
sha256 = "0npffql62m1xba15l1wkaqf2p0l2bvb33720gx28764jmq0la75i";
};
in
assert (cross != null) -> (gccCross != null);
assert (mig != null) -> (machHeaders != null);
assert (machHeaders != null) -> (hurdHeaders != null);
assert (hurdHeaders != null) -> (libpthreadHeaders != null);
assert (hurdHeaders != null) -> (fetchgit != null);
stdenv.mkDerivation ({
inherit kernelHeaders installLocales;
# The host/target system.
crossConfig = if cross != null then cross.config else null;
inherit (stdenv) is64bit;
enableParallelBuilding = true;
patches =
stdenv.lib.optional (fetchgit == null)
/* Fix for NIXPKGS-79: when doing host name lookups, when
nsswitch.conf contains a line like
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
don't return an error when mdns4_minimal can't be found. This
is a bug in Glibc: when a service can't be found, NSS should
continue to the next service unless "UNAVAIL=return" is set.
("NOTFOUND=return" refers to the service returning a NOTFOUND
error, not the service itself not being found.) The reason is
that the "status" variable (while initialised to UNAVAIL) is
outside of the loop that iterates over the services, the
"files" service sets status to NOTFOUND. So when the call to
find "mdns4_minimal" fails, "status" will still be NOTFOUND,
and it will return instead of continuing to "dns". Thus, the
line
hosts: mdns4_minimal [NOTFOUND=return] dns mdns4
does work because "status" will contain UNAVAIL after the
failure to find mdns4_minimal. */
./nss-skip-unavail.patch
++ [
/* Have rpcgen(1) look for cpp(1) in $PATH. */
./rpcgen-path.patch
/* Allow nixos and nix handle the locale-archive. */
./nix-locale-archive.patch
]
++ (stdenv.lib.optional (hurdHeaders == null)
/* Don't use /etc/ld.so.cache, for non-NixOS systems. Currently
disabled on GNU/Hurd, which uses a more recent libc snapshot. */
./dont_use_system_ld_so_cache.patch )
++ [
/* Without this patch many KDE binaries crash. */
./glibc-elf-localscope.patch
] ++ stdenv.lib.optional installLocales ./catalan-firstdays.patch;
postPatch = ''
# Needed for glibc to build with the gnumake 3.82
# http://comments.gmane.org/gmane.linux.lfs.support/31227
sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
# nscd needs libgcc, and we don't want it dynamically linked
# because we don't want it to depend on bootstrap-tools libs.
echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
'';
configureFlags = [
"-C"
"--enable-add-ons"
"--sysconfdir=/etc"
"--localedir=/var/run/current-system/sw/lib/locale"
"libc_cv_ssp=no"
(if kernelHeaders != null
then "--with-headers=${kernelHeaders}/include"
else "--without-headers")
(if profilingLibraries
then "--enable-profile"
else "--disable-profile")
] ++ stdenv.lib.optionals (cross == null && kernelHeaders != null) [
"--enable-kernel=2.6.35"
] ++ stdenv.lib.optionals (cross != null) [
(if cross.withTLS then "--with-tls" else "--without-tls")
(if cross.float == "soft" then "--without-fp" else "--with-fp")
] ++ stdenv.lib.optionals (cross != null
&& cross.platform ? kernelMajor
&& cross.platform.kernelMajor == "2.6") [
"--enable-kernel=2.6.0"
"--with-__thread"
] ++ stdenv.lib.optionals (cross == null &&
(stdenv.system == "armv5tel-linux")) [
"--host=arm-linux-gnueabi"
"--build=arm-linux-gnueabi"
"--without-fp"
# To avoid linking with -lgcc_s (dynamic link)
# so the glibc does not depend on its compiler store path
"libc_cv_as_needed=no"
] ++ stdenv.lib.optionals (cross == null && stdenv.platform.name == "raspberrypi") [
"--host=arm-linux-gnueabi"
"--build=arm-linux-gnueabi"
"--with-fp"
# To avoid linking with -lgcc_s (dynamic link)
# so the glibc does not depend on its compiler store path
"libc_cv_as_needed=no"
];
installFlags = [ "sysconfdir=$(out)/etc" ];
buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
++ stdenv.lib.optional (mig != null) mig;
# 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
# bootstrap.
BASH_SHELL = "/bin/sh";
# Workaround for this bug:
# http://sourceware.org/bugzilla/show_bug.cgi?id=411
# I.e. when gcc is compiled with --with-arch=i686, then the
# preprocessor symbol `__i686' will be defined to `1'. This causes
# the symbol __i686.get_pc_thunk.dx to be mangled.
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686";
}
# Remove the `gccCross' attribute so that the *native* glibc store path
# doesn't depend on whether `gccCross' is null or not.
// (removeAttrs args [ "gccCross" ]) //
{
name = name + "-${version}" +
stdenv.lib.optionalString (cross != null) "-${cross.config}";
src =
if hurdHeaders != null
then fetchgit {
# Shamefully the "official" glibc won't build on GNU, so use the one
# maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch.
# See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
url = "git://git.sv.gnu.org/hurd/glibc.git";
sha256 = "cecec9dd5a2bafc875c56b058b6d7628a22b250b53747513dec304f31ffdb82d";
rev = "d3cdecf18e6550b0984a42b43ed48c5fb26501e1";
}
else fetchurl {
url = "mirror://gnu/glibc/glibc-${version}.tar.bz2";
sha256 = "1cnv319ysc8nkwpqw6f6ymb6b8hbl0nyvyx48sddkrj50lmcjwq1";
};
# `fetchurl' is a function and thus should not be passed to the
# `derivation' primitive.
fetchurl = null;
# Remove absolute paths from `configure' & co.; build out-of-tree.
preConfigure = ''
export PWD_P=$(type -tP pwd)
for i in configure io/ftwtest-sh; do
# Can't use substituteInPlace here because replace hasn't been
# built yet in the bootstrap.
sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
done
${if needsPorts then "tar xvf ${srcPorts}" else ""}
mkdir ../build
cd ../build
configureScript="`pwd`/../$sourceRoot/configure"
${preConfigure}
'';
meta = {
homepage = http://www.gnu.org/software/libc/;
description = "The GNU C Library"
+ stdenv.lib.optionalString (hurdHeaders != null) ", for GNU/Hurd";
longDescription =
'' Any Unix-like operating system needs a C library: the library which
defines the "system calls" and other basic facilities such as
open, malloc, printf, exit...
The GNU C library is used as the C library in the GNU system and
most systems with the Linux kernel.
'';
license = "LGPLv2+";
maintainers = [ ];
#platforms = stdenv.lib.platforms.linux;
} // meta;
}
//
(if hurdHeaders != null
then {
# Work around the fact that the configure snippet that looks for
# <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
# glibc expects Mach, Hurd, and pthread headers to be in the same place.
CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include";
# `fetchgit' is a function and thus should not be passed to the
# `derivation' primitive.
fetchgit = null;
# Install NSS stuff in the right place.
# XXX: This will be needed for all new glibcs and isn't Hurd-specific.
makeFlags = ''vardbdir="$out/var/db"'';
}
else { }))

View File

@ -1,99 +0,0 @@
{ stdenv, fetchurl, kernelHeaders
, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
, mig ? null, fetchgit ? null
, installLocales ? true
, profilingLibraries ? false
, gccCross ? null
, debugSymbols ? false
}:
assert stdenv.gcc.gcc != null;
let
build = import ./common.nix;
cross = if gccCross != null then gccCross.target else null;
in
build cross ({
name = "glibc"
+ stdenv.lib.optionalString (hurdHeaders != null) "-hurd"
+ stdenv.lib.optionalString debugSymbols "-debug";
inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries
gccCross;
builder = ./builder.sh;
# When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
# any program we run, because the gcc will have been placed at a new
# store path than that determined when built (as a source for the
# bootstrap-tools tarball)
# Building from a proper gcc staying in the path where it was installed,
# libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without
# any special hack.
preInstall = ''
if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then
mkdir -p $out/lib
ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
fi
'';
meta.description = "The GNU C Library";
}
//
(if debugSymbols
then {
# Build with debugging symbols, but leave optimizations on and don't
# attempt to keep the build tree.
dontStrip = true;
dontCrossStrip = true;
NIX_STRIP_DEBUG = 0;
}
else {})
//
(if hurdHeaders != null
then rec {
inherit machHeaders hurdHeaders libpthreadHeaders mig fetchgit;
propagatedBuildInputs = [ machHeaders hurdHeaders libpthreadHeaders ];
passthru = {
# When building GCC itself `propagatedBuildInputs' above is not
# honored, so we pass it here so that the GCC builder can do the right
# thing.
inherit propagatedBuildInputs;
};
}
else { })
//
(if cross != null
then {
preConfigure = ''
sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
cat > config.cache << "EOF"
libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes
libc_cv_gnu89_inline=yes
# Only due to a problem in gcc configure scripts:
libc_cv_sparc64_tls=${if cross.withTLS then "yes" else "no"}
EOF
export BUILD_CC=gcc
export CC="$crossConfig-gcc"
export AR="$crossConfig-ar"
export RANLIB="$crossConfig-ranlib"
dontStrip=1
'';
# To avoid a dependency on the build system 'bash'.
preFixup = ''
rm $out/bin/{ldd,tzselect,catchsegv,xtrace}
'';
}
else {}))

View File

@ -1,43 +0,0 @@
diff -Naur glibc-2.13-orig/elf/ldconfig.c glibc-2.13/elf/ldconfig.c
--- glibc-2.13-orig/elf/ldconfig.c 2011-01-17 23:34:07.000000000 -0500
+++ glibc-2.13/elf/ldconfig.c 2012-04-10 23:28:45.957492340 -0400
@@ -51,7 +51,7 @@
#endif
#ifndef LD_SO_CONF
-# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
+# define LD_SO_CONF PREFIX "/etc/ld.so.conf"
#endif
/* Get libc version number. */
diff -Naur glibc-2.13-orig/elf/Makefile glibc-2.13/elf/Makefile
--- glibc-2.13-orig/elf/Makefile 2011-01-17 23:34:07.000000000 -0500
+++ glibc-2.13/elf/Makefile 2012-04-10 23:27:05.666477442 -0400
@@ -459,11 +459,11 @@
$(objpfx)sprof: $(libdl)
$(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
-SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
-CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
+PREFIX-FLAGS := -D'PREFIX="$(prefix)"'
+CFLAGS-ldconfig.c = $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \
-D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
-CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
-CFLAGS-cache.c = $(SYSCONF-FLAGS)
+CFLAGS-dl-cache.c = $(PREFIX-FLAGS)
+CFLAGS-cache.c = $(PREFIX-FLAGS)
CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
diff -Naur glibc-2.13-orig/sysdeps/generic/dl-cache.h glibc-2.13/sysdeps/generic/dl-cache.h
--- glibc-2.13-orig/sysdeps/generic/dl-cache.h 2011-01-17 23:34:07.000000000 -0500
+++ glibc-2.13/sysdeps/generic/dl-cache.h 2012-04-10 23:28:20.077488815 -0400
@@ -29,7 +29,7 @@
#endif
#ifndef LD_SO_CACHE
-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
+# define LD_SO_CACHE PREFIX "/etc/ld.so.cache"
#endif
#ifndef add_system_dir

View File

@ -1,82 +0,0 @@
diff -ru a/elf/dl-close.c b/elf/dl-close.c
--- a/elf/dl-close.c 2011-02-04 00:35:03.000000000 +0100
+++ b/elf/dl-close.c 2011-02-22 02:16:12.367883000 +0100
@@ -180,24 +186,28 @@
/* Signal the object is still needed. */
l->l_idx = IDX_STILL_USED;
+#define mark_used(dmap) \
+ do { \
+ if ((dmap)->l_idx != IDX_STILL_USED) \
+ { \
+ assert ((dmap)->l_idx >= 0 && (dmap)->l_idx < nloaded); \
+ \
+ if (!used[(dmap)->l_idx]) \
+ { \
+ used[(dmap)->l_idx] = 1; \
+ if ((dmap)->l_idx - 1 < done_index) \
+ done_index = (dmap)->l_idx - 1; \
+ } \
+ } \
+ } while (0)
+
/* Mark all dependencies as used. */
if (l->l_initfini != NULL)
{
struct link_map **lp = &l->l_initfini[1];
while (*lp != NULL)
{
- if ((*lp)->l_idx != IDX_STILL_USED)
- {
- assert ((*lp)->l_idx >= 0 && (*lp)->l_idx < nloaded);
-
- if (!used[(*lp)->l_idx])
- {
- used[(*lp)->l_idx] = 1;
- if ((*lp)->l_idx - 1 < done_index)
- done_index = (*lp)->l_idx - 1;
- }
- }
-
+ mark_used(*lp);
++lp;
}
}
@@ -206,19 +216,25 @@
for (unsigned int j = 0; j < l->l_reldeps->act; ++j)
{
struct link_map *jmap = l->l_reldeps->list[j];
-
- if (jmap->l_idx != IDX_STILL_USED)
- {
- assert (jmap->l_idx >= 0 && jmap->l_idx < nloaded);
-
- if (!used[jmap->l_idx])
- {
- used[jmap->l_idx] = 1;
- if (jmap->l_idx - 1 < done_index)
- done_index = jmap->l_idx - 1;
- }
- }
+ mark_used(jmap);
}
+ /* And the same for owners of our scopes; normally, our last
+ scope provider would render us unused, but this can be
+ prevented by the NODELETE flag. */
+ if (__builtin_expect(l->l_type == lt_loaded
+ && (l->l_flags_1 & DF_1_NODELETE), 0))
+ for (size_t cnt = 0; l->l_scope[cnt] != NULL; ++cnt)
+ /* This relies on l_scope[] entries being always set either
+ to its own l_symbolic_searchlist address, or some map's
+ l_searchlist address. */
+ if (l->l_scope[cnt] != &l->l_symbolic_searchlist)
+ {
+ struct link_map *ls = (struct link_map *)
+ ((char *) l->l_scope[cnt]
+ - offsetof (struct link_map, l_searchlist));
+ assert (ls->l_ns == nsid);
+ mark_used(ls);
+ }
}
/* Sort the entries. */

View File

@ -1,26 +0,0 @@
{ stdenv, fetchurl, texinfo, perl }:
let build = import ./common.nix;
in
/* null cross builder */
build null {
name = "glibc-info";
inherit fetchurl stdenv;
configureFlags = [ "--enable-add-ons" ];
buildInputs = [ texinfo perl ];
buildPhase = "make info";
# I don't know why the info is not generated in 'build'
# Somehow building the info still does not work, because the final
# libc.info hasn't a Top node.
installPhase = ''
mkdir -p "$out/share/info"
cp -v "../$sourceRoot/manual/"*.info* "$out/share/info"
'';
meta.description = "GNU Info manual of the GNU C Library";
}

View File

@ -1,47 +0,0 @@
/* This function builds just the `lib/locale/locale-archive' file from
Glibc and nothing else. If `allLocales' is true, all supported
locales are included; otherwise, just the locales listed in
`locales'. See localedata/SUPPORTED in the Glibc source tree for
the list of all supported locales:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc
*/
{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }:
let build = import ./common.nix;
in
build null {
name = "glibc-locales";
inherit fetchurl stdenv;
installLocales = true;
builder = ./locales-builder.sh;
# Awful hack: `localedef' doesn't allow the path to `locale-archive'
# to be overriden, but you *can* specify a prefix, i.e. it will use
# <prefix>/<path-to-glibc>/lib/locale/locale-archive. So we use
# $TMPDIR as a prefix, meaning that the locale-archive is placed in
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
buildPhase =
''
mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
# Hack to allow building of the locales (needed since glibc-2.12)
sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \
/library-path/d ../glibc-2*/localedata/Makefile
${if allLocales then "" else
"echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"}
make localedata/install-locales \
localedir=$out/lib/locale \
'';
installPhase =
''
mkdir -p "$out/lib/locale"
cp -v "$TMPDIR/nix/store/"*"/lib/locale/locale-archive" "$out/lib/locale"
'';
meta.description = "Locale information for the GNU C Library";
}

View File

@ -1,116 +0,0 @@
diff --git a/locale/loadarchive.c b/locale/loadarchive.c
index d545f17..0d8638a 100644
--- a/locale/loadarchive.c
+++ b/locale/loadarchive.c
@@ -124,6 +124,25 @@ calculate_head_size (const struct locarhead *h)
}
+static int
+open_locale_archive ()
+{
+ int fd = -1;
+ char *path = getenv ("LOCALE_ARCHIVE_2_11");
+ char *path2 = getenv ("LOCALE_ARCHIVE");
+ const char *usualpath = "/usr/lib/locale/locale-archive";
+ if (path)
+ fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
+ if (path2 && fd < 0)
+ fd = open_not_cancel_2 (path2, O_RDONLY|O_LARGEFILE);
+ if (fd < 0)
+ fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+ if (fd < 0)
+ fd = open_not_cancel_2 (usualpath, O_RDONLY|O_LARGEFILE);
+ return fd;
+}
+
+
/* Find the locale *NAMEP in the locale archive, and return the
internalized data structure for its CATEGORY data. If this locale has
already been loaded from the archive, just returns the existing data
@@ -203,7 +222,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
archmapped = &headmap;
/* The archive has never been opened. */
- fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+ fd = open_locale_archive ();
if (fd < 0)
/* Cannot open the archive, for whatever reason. */
return NULL;
@@ -394,7 +413,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
if (fd == -1)
{
struct stat64 st;
- fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+ fd = open_locale_archive ();
if (fd == -1)
/* Cannot open the archive, for whatever reason. */
return NULL;
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 77262b7..fddc00d 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -628,6 +628,20 @@ nameentcmp (const void *a, const void *b)
((const struct nameent *) b)->name);
}
+static int
+open_nix_locale_archive (const char * fname, int access)
+{
+ int fd = -1;
+ char *path = getenv ("LOCALE_ARCHIVE_2_11");
+ char *path2 = getenv ("LOCALE_ARCHIVE");
+ if (path)
+ fd = open64 (path, access);
+ if (path2 && fd < 0)
+ fd = open64 (path2, access);
+ if (fd < 0)
+ fd = open64 (fname, access);
+ return fd;
+}
static int
write_archive_locales (void **all_datap, char *linebuf)
@@ -641,7 +658,7 @@ write_archive_locales (void **all_datap, char *linebuf)
int fd, ret = 0;
uint32_t cnt;
- fd = open64 (ARCHIVE_NAME, O_RDONLY);
+ fd = open_nix_locale_archive (ARCHIVE_NAME, O_RDONLY);
if (fd < 0)
return 0;
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index 85ba77d..3ad2af8 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -512,6 +512,20 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
*ah = new_ah;
}
+static int
+open_nix_locale_archive (const char * fname, int access)
+{
+ int fd = -1;
+ char *path = getenv ("LOCALE_ARCHIVE_2_11");
+ char *path2 = getenv ("LOCALE_ARCHIVE");
+ if (path)
+ fd = open64 (path, access);
+ if (path2 && fd < 0)
+ fd = open64 (path2, access);
+ if (fd < 0)
+ fd = open64 (fname, access);
+ return fd;
+}
void
open_archive (struct locarhandle *ah, bool readonly)
@@ -531,7 +548,7 @@ open_archive (struct locarhandle *ah, bool readonly)
while (1)
{
/* Open the archive. We must have exclusive write access. */
- fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR);
+ fd = open_nix_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR);
if (fd == -1)
{
/* Maybe the file does not yet exist. */

View File

@ -1,21 +0,0 @@
diff -ru glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c glibc-2.11.2/sysdeps/posix/getaddrinfo.c
--- glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c 2010-05-19 22:38:20.000000000 +0200
+++ glibc-2.11.2/sysdeps/posix/getaddrinfo.c 2010-08-05 18:39:54.259556327 +0200
@@ -505,8 +505,6 @@
int no_data = 0;
int no_inet6_data = 0;
service_user *nip = NULL;
- enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
- enum nss_status status = NSS_STATUS_UNAVAIL;
int no_more;
int old_res_options;
@@ -702,6 +700,8 @@
while (!no_more)
{
+ enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
+ enum nss_status status = NSS_STATUS_UNAVAIL;
no_data = 0;
nss_gethostbyname4_r fct4
= __nss_lookup_function (nip, "gethostbyname4_r");

View File

@ -1,72 +0,0 @@
By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths
(`/lib/cpp', etc.), which may only be overrided with the `-Y' option. This
patch makes it run any `cpp' command found in $PATH.
--- glibc-2.7/sunrpc/rpc_main.c 2006-11-10 21:54:46.000000000 +0100
+++ glibc-2.7/sunrpc/rpc_main.c 2009-04-22 14:32:10.000000000 +0200
@@ -79,7 +79,7 @@ static const char *cmdname;
static const char *svcclosetime = "120";
static int cppDefined; /* explicit path for C preprocessor */
-static const char *CPP = SUNOS_CPP;
+static const char *CPP = "cpp";
static const char CPPFLAGS[] = "-C";
static char *pathbuf;
static int cpp_pid;
@@ -108,7 +108,6 @@ static char *extendfile (const char *fil
static void open_output (const char *infile, const char *outfile);
static void add_warning (void);
static void clear_args (void);
-static void find_cpp (void);
static void open_input (const char *infile, const char *define);
static int check_nettype (const char *name, const char *list_to_check[]);
static void c_output (const char *infile, const char *define,
@@ -327,31 +326,6 @@ clear_args (void)
argcount = FIXEDARGS;
}
-/* make sure that a CPP exists */
-static void
-find_cpp (void)
-{
- struct stat buf;
-
- if (stat (CPP, &buf) < 0)
- { /* /lib/cpp or explicit cpp does not exist */
- if (cppDefined)
- {
- fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
- crash ();
- }
- else
- { /* try the other one */
- CPP = SVR4_CPP;
- if (stat (CPP, &buf) < 0)
- { /* can't find any cpp */
- fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
- crash ();
- }
- }
- }
-}
-
/*
* Open input file with given define for C-preprocessor
*/
@@ -370,7 +344,6 @@ open_input (const char *infile, const ch
switch (cpp_pid)
{
case 0:
- find_cpp ();
putarg (0, CPP);
putarg (1, CPPFLAGS);
addarg (define);
@@ -380,7 +353,7 @@ open_input (const char *infile, const ch
close (1);
dup2 (pd[1], 1);
close (pd[0]);
- execv (arglist[0], (char **) arglist);
+ execvp (arglist[0], (char **) arglist);
perror ("execv");
exit (1);
case -1:

View File

@ -1,87 +0,0 @@
When extending regex buffers, make sure we allocate enough room for the
state log. Merely doubling the space may not be enough if the current
node has accepted a long run of characters. This part of the code only
triggers with multibyte characters.
Andreas.
[BZ #15078]
* posix/regexec.c (extend_buffers): Add parameter min_len.
(check_matching): Pass minimum needed length.
(clean_state_log_if_needed): Likewise.
(get_subexp): Likewise.
* posix/Makefile (tests): Add bug-regex34.
(bug-regex34-ENV): Define.
* posix/bug-regex34.c: New file.
diff --git a/posix/regexec.c b/posix/regexec.c
index 7f2de85..5ca2bf6 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -197,7 +197,7 @@ static int group_nodes_into_DFAstates (const re_dfa_t *dfa,
static int check_node_accept (const re_match_context_t *mctx,
const re_token_t *node, int idx)
internal_function;
-static reg_errcode_t extend_buffers (re_match_context_t *mctx)
+static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len)
internal_function;
/* Entry point for POSIX code. */
@@ -1160,7 +1160,7 @@ check_matching (re_match_context_t *mctx, int fl_longest_match,
|| (BE (next_char_idx >= mctx->input.valid_len, 0)
&& mctx->input.valid_len < mctx->input.len))
{
- err = extend_buffers (mctx);
+ err = extend_buffers (mctx, next_char_idx + 1);
if (BE (err != REG_NOERROR, 0))
{
assert (err == REG_ESPACE);
@@ -1738,7 +1738,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx)
&& mctx->input.valid_len < mctx->input.len))
{
reg_errcode_t err;
- err = extend_buffers (mctx);
+ err = extend_buffers (mctx, next_state_log_idx + 1);
if (BE (err != REG_NOERROR, 0))
return err;
}
@@ -2792,7 +2792,7 @@ get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx)
if (bkref_str_off >= mctx->input.len)
break;
- err = extend_buffers (mctx);
+ err = extend_buffers (mctx, bkref_str_off + 1);
if (BE (err != REG_NOERROR, 0))
return err;
@@ -4102,7 +4102,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
static reg_errcode_t
internal_function __attribute_warn_unused_result__
-extend_buffers (re_match_context_t *mctx)
+extend_buffers (re_match_context_t *mctx, int min_len)
{
reg_errcode_t ret;
re_string_t *pstr = &mctx->input;
@@ -4111,8 +4111,10 @@ extend_buffers (re_match_context_t *mctx)
if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0))
return REG_ESPACE;
- /* Double the lengthes of the buffers. */
- ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2));
+ /* Double the lengthes of the buffers, but allocate at least MIN_LEN. */
+ ret = re_string_realloc_buffers (pstr,
+ MAX (min_len,
+ MIN (pstr->len, pstr->bufs_len * 2)));
if (BE (ret != REG_NOERROR, 0))
return ret;
--
1.8.1.2
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

View File

@ -1,52 +0,0 @@
From: Andreas Schwab <schwab@suse.de>
Date: Thu, 21 Mar 2013 14:50:27 +0000 (+0100)
Subject: Fix stack overflow in getaddrinfo with many results
X-Git-Url: http://sourceware.org/git/?p=glibc.git;a=commitdiff_plain;h=1cef1b19089528db11f221e938f60b9b048945d7
Fix stack overflow in getaddrinfo with many results
---
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index d95c2d1..2309281 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -2489,11 +2489,27 @@ getaddrinfo (const char *name, const char *service,
__typeof (once) old_once = once;
__libc_once (once, gaiconf_init);
/* Sort results according to RFC 3484. */
- struct sort_result results[nresults];
- size_t order[nresults];
+ struct sort_result *results;
+ size_t *order;
struct addrinfo *q;
struct addrinfo *last = NULL;
char *canonname = NULL;
+ bool malloc_results;
+
+ malloc_results
+ = !__libc_use_alloca (nresults * (sizeof (*results) + sizeof (size_t)));
+ if (malloc_results)
+ {
+ results = malloc (nresults * (sizeof (*results) + sizeof (size_t)));
+ if (results == NULL)
+ {
+ __free_in6ai (in6ai);
+ return EAI_MEMORY;
+ }
+ }
+ else
+ results = alloca (nresults * (sizeof (*results) + sizeof (size_t)));
+ order = (size_t *) (results + nresults);
/* Now we definitely need the interface information. */
if (! check_pf_called)
@@ -2664,6 +2680,9 @@ getaddrinfo (const char *name, const char *service,
/* Fill in the canonical name into the new first entry. */
p->ai_canonname = canonname;
+
+ if (malloc_results)
+ free (results);
}
__free_in6ai (in6ai);

View File

@ -1,82 +0,0 @@
diff -ru a/elf/dl-close.c b/elf/dl-close.c
--- a/elf/dl-close.c 2011-02-04 00:35:03.000000000 +0100
+++ b/elf/dl-close.c 2011-02-22 02:16:12.367883000 +0100
@@ -180,24 +186,28 @@
/* Signal the object is still needed. */
l->l_idx = IDX_STILL_USED;
+#define mark_used(dmap) \
+ do { \
+ if ((dmap)->l_idx != IDX_STILL_USED) \
+ { \
+ assert ((dmap)->l_idx >= 0 && (dmap)->l_idx < nloaded); \
+ \
+ if (!used[(dmap)->l_idx]) \
+ { \
+ used[(dmap)->l_idx] = 1; \
+ if ((dmap)->l_idx - 1 < done_index) \
+ done_index = (dmap)->l_idx - 1; \
+ } \
+ } \
+ } while (0)
+
/* Mark all dependencies as used. */
if (l->l_initfini != NULL)
{
struct link_map **lp = &l->l_initfini[1];
while (*lp != NULL)
{
- if ((*lp)->l_idx != IDX_STILL_USED)
- {
- assert ((*lp)->l_idx >= 0 && (*lp)->l_idx < nloaded);
-
- if (!used[(*lp)->l_idx])
- {
- used[(*lp)->l_idx] = 1;
- if ((*lp)->l_idx - 1 < done_index)
- done_index = (*lp)->l_idx - 1;
- }
- }
-
+ mark_used(*lp);
++lp;
}
}
@@ -206,19 +216,25 @@
for (unsigned int j = 0; j < l->l_reldeps->act; ++j)
{
struct link_map *jmap = l->l_reldeps->list[j];
-
- if (jmap->l_idx != IDX_STILL_USED)
- {
- assert (jmap->l_idx >= 0 && jmap->l_idx < nloaded);
-
- if (!used[jmap->l_idx])
- {
- used[jmap->l_idx] = 1;
- if (jmap->l_idx - 1 < done_index)
- done_index = jmap->l_idx - 1;
- }
- }
+ mark_used(jmap);
}
+ /* And the same for owners of our scopes; normally, our last
+ scope provider would render us unused, but this can be
+ prevented by the NODELETE flag. */
+ if (__builtin_expect(l->l_type == lt_loaded
+ && (l->l_flags_1 & DF_1_NODELETE), 0))
+ for (size_t cnt = 0; l->l_scope[cnt] != NULL; ++cnt)
+ /* This relies on l_scope[] entries being always set either
+ to its own l_symbolic_searchlist address, or some map's
+ l_searchlist address. */
+ if (l->l_scope[cnt] != &l->l_symbolic_searchlist)
+ {
+ struct link_map *ls = (struct link_map *)
+ ((char *) l->l_scope[cnt]
+ - offsetof (struct link_map, l_searchlist));
+ assert (ls->l_ns == nsid);
+ mark_used(ls);
+ }
}
/* Sort the entries. */

View File

@ -1,17 +0,0 @@
# Glibc cannot have itself in its RPATH.
export NIX_NO_SELF_RPATH=1
source $stdenv/setup
postConfigure() {
# Hack: get rid of the `-static' flag set by the bootstrap stdenv.
# This has to be done *after* `configure' because it builds some
# test binaries.
export NIX_CFLAGS_LINK=
export NIX_LDFLAGS_BEFORE=
export NIX_DONT_SET_RPATH=1
unset CFLAGS
}
genericBuild

View File

@ -1,47 +0,0 @@
/* This function builds just the `lib/locale/locale-archive' file from
Glibc and nothing else. If `allLocales' is true, all supported
locales are included; otherwise, just the locales listed in
`locales'. See localedata/SUPPORTED in the Glibc source tree for
the list of all supported locales:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc
*/
{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }:
let build = import ./common.nix;
in
build null {
name = "glibc-locales";
inherit fetchurl stdenv;
installLocales = true;
builder = ./locales-builder.sh;
# Awful hack: `localedef' doesn't allow the path to `locale-archive'
# to be overriden, but you *can* specify a prefix, i.e. it will use
# <prefix>/<path-to-glibc>/lib/locale/locale-archive. So we use
# $TMPDIR as a prefix, meaning that the locale-archive is placed in
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
buildPhase =
''
mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
# Hack to allow building of the locales (needed since glibc-2.12)
sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \
/library-path/d ../glibc-2*/localedata/Makefile
${if allLocales then "" else
"echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"}
make localedata/install-locales \
localedir=$out/lib/locale \
'';
installPhase =
''
mkdir -p "$out/lib/locale"
cp -v "$TMPDIR/$NIX_STORE/"*"/lib/locale/locale-archive" "$out/lib/locale"
'';
meta.description = "Locale information for the GNU C Library";
}

View File

@ -19,7 +19,7 @@ postInstall() {
if test -n "$installLocales"; then
make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales
fi
test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
# FIXME: Use `test -n $linuxHeaders' when `kernelHeaders' has been
@ -27,19 +27,19 @@ postInstall() {
if test -z "$hurdHeaders"; then
# Include the Linux kernel headers in Glibc, except the `scsi'
# subdirectory, which Glibc provides itself.
(cd $out/include && \
ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .)
(cd $out/include && \
ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .)
fi
if test -f "$out/lib/libhurduser.so"; then
# libc.so, libhurduser.so, and libmachuser.so depend on each
# other, so add them to libc.so (a RUNPATH on libc.so.0.3
# would be ignored by the cross-linker.)
echo "adding \`libhurduser.so' and \`libmachuser.so' to the \`libc.so' linker script..."
sed -i "$out/lib/libc.so" \
-e"s|\(libc\.so\.[^ ]\+\>\)|\1 $out/lib/libhurduser.so $out/lib/libmachuser.so|g"
# libc.so, libhurduser.so, and libmachuser.so depend on each
# other, so add them to libc.so (a RUNPATH on libc.so.0.3
# would be ignored by the cross-linker.)
echo "adding \`libhurduser.so' and \`libmachuser.so' to the \`libc.so' linker script..."
sed -i "$out/lib/libc.so" \
-e"s|\(libc\.so\.[^ ]\+\>\)|\1 $out/lib/libhurduser.so $out/lib/libmachuser.so|g"
fi
# Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink
# "lib64" to "lib".
if test -n "$is64bit"; then
@ -49,6 +49,9 @@ postInstall() {
# This file, that should not remain in the glibc derivation,
# may have not been created during the preInstall
rm -f $out/lib/libgcc_s.so.1
# Get rid of more unnecessary stuff.
rm -rf $out/var $out/sbin/sln
}
genericBuild

View File

@ -13,7 +13,7 @@ cross:
let
version = "2.17";
version = "2.18";
in
@ -44,9 +44,6 @@ stdenv.mkDerivation ({
/* Don't use /etc/ld.so.cache, for non-NixOS systems. */
./dont-use-system-ld-so-cache.patch
/* Without this patch many KDE binaries crash. */
./glibc-elf-localscope.patch
/* Add blowfish password hashing support. This is needed for
compatibility with old NixOS installations (since NixOS used
to default to blowfish). */
@ -57,16 +54,19 @@ stdenv.mkDerivation ({
src->results[i].native == a2_native' failed." crashes. */
./glibc-rh739743.patch
./scanf.patch
/* The command "getconf CS_PATH" returns the default search path
"/bin:/usr/bin", which is inappropriate on NixOS machines. This
patch extends the search path by "/run/current-system/sw/bin". */
./fix_path_attribute_in_getconf.patch
/* Fix buffer overrun in regexp matcher. */
./cve-2013-0242.patch
/* Fix stack overflow in getaddrinfo with many results. */
./cve-2013-1914.patch
./cve-2012-4412+4424.patch
./cve-2013-4237.patch
./cve-2013-4332.patch
./cve-2013-4458.patch
./cve-2013-4788.patch
];
postPatch = ''
@ -150,7 +150,7 @@ stdenv.mkDerivation ({
}
else fetchurl {
url = "mirror://gnu/glibc/glibc-${version}.tar.gz";
sha256 = "0ym3zk9ii64279wgw7pw9xkbxczy2ci7ka6mnfs05rhlainhicm3";
sha256 = "0d3pnh6kg5r48ga5rg4lhwlc1062brr6fiqs4j23327gzssjgry8";
};
# Remove absolute paths from `configure' & co.; build out-of-tree.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,302 @@
commit 91ce40854d0b7f865cf5024ef95a8026b76096f3
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Aug 16 09:38:52 2013 +0200
CVE-2013-4237, BZ #14699: Buffer overflow in readdir_r
* sysdeps/posix/dirstream.h (struct __dirstream): Add errcode
member.
* sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode
member.
* sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member.
* sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit.
Return delayed error code. Remove GETDENTS_64BIT_ALIGNED
conditional.
* sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define
GETDENTS_64BIT_ALIGNED.
* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise.
* manual/filesys.texi (Reading/Closing Directory): Document
ENAMETOOLONG return value of readdir_r. Recommend readdir more
strongly.
* manual/conf.texi (Limits for Files): Add portability note to
NAME_MAX, PATH_MAX.
(Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX.
diff --git a/manual/conf.texi b/manual/conf.texi
index 7eb8b36..c720063 100644
--- a/manual/conf.texi
+++ b/manual/conf.texi
@@ -1149,6 +1149,9 @@ typed ahead as input. @xref{I/O Queues}.
@deftypevr Macro int NAME_MAX
The uniform system limit (if any) for the length of a file name component, not
including the terminating null character.
+
+@strong{Portability Note:} On some systems, @theglibc{} defines
+@code{NAME_MAX}, but does not actually enforce this limit.
@end deftypevr
@comment limits.h
@@ -1157,6 +1160,9 @@ including the terminating null character.
The uniform system limit (if any) for the length of an entire file name (that
is, the argument given to system calls such as @code{open}), including the
terminating null character.
+
+@strong{Portability Note:} @Theglibc{} does not enforce this limit
+even if @code{PATH_MAX} is defined.
@end deftypevr
@cindex limits, pipe buffer size
@@ -1476,6 +1482,9 @@ Inquire about the value of @code{POSIX_REC_MIN_XFER_SIZE}.
Inquire about the value of @code{POSIX_REC_XFER_ALIGN}.
@end table
+@strong{Portability Note:} On some systems, @theglibc{} does not
+enforce @code{_PC_NAME_MAX} or @code{_PC_PATH_MAX} limits.
+
@node Utility Limits
@section Utility Program Capacity Limits
diff --git a/manual/filesys.texi b/manual/filesys.texi
index 1df9cf2..814c210 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -444,9 +444,9 @@ symbols are declared in the header file @file{dirent.h}.
@comment POSIX.1
@deftypefun {struct dirent *} readdir (DIR *@var{dirstream})
This function reads the next entry from the directory. It normally
-returns a pointer to a structure containing information about the file.
-This structure is statically allocated and can be rewritten by a
-subsequent call.
+returns a pointer to a structure containing information about the
+file. This structure is associated with the @var{dirstream} handle
+and can be rewritten by a subsequent call.
@strong{Portability Note:} On some systems @code{readdir} may not
return entries for @file{.} and @file{..}, even though these are always
@@ -461,19 +461,61 @@ conditions are defined for this function:
The @var{dirstream} argument is not valid.
@end table
-@code{readdir} is not thread safe. Multiple threads using
-@code{readdir} on the same @var{dirstream} may overwrite the return
-value. Use @code{readdir_r} when this is critical.
+To distinguish between an end-of-directory condition or an error, you
+must set @code{errno} to zero before calling @code{readdir}. To avoid
+entering an infinite loop, you should stop reading from the directory
+after the first error.
+
+In POSIX.1-2008, @code{readdir} is not thread-safe. In @theglibc{}
+implementation, it is safe to call @code{readdir} concurrently on
+different @var{dirstream}s, but multiple threads accessing the same
+@var{dirstream} result in undefined behavior. @code{readdir_r} is a
+fully thread-safe alternative, but suffers from poor portability (see
+below). It is recommended that you use @code{readdir}, with external
+locking if multiple threads access the same @var{dirstream}.
@end deftypefun
@comment dirent.h
@comment GNU
@deftypefun int readdir_r (DIR *@var{dirstream}, struct dirent *@var{entry}, struct dirent **@var{result})
-This function is the reentrant version of @code{readdir}. Like
-@code{readdir} it returns the next entry from the directory. But to
-prevent conflicts between simultaneously running threads the result is
-not stored in statically allocated memory. Instead the argument
-@var{entry} points to a place to store the result.
+This function is a version of @code{readdir} which performs internal
+locking. Like @code{readdir} it returns the next entry from the
+directory. To prevent conflicts between simultaneously running
+threads the result is stored inside the @var{entry} object.
+
+@strong{Portability Note:} It is recommended to use @code{readdir}
+instead of @code{readdir_r} for the following reasons:
+
+@itemize @bullet
+@item
+On systems which do not define @code{NAME_MAX}, it may not be possible
+to use @code{readdir_r} safely because the caller does not specify the
+length of the buffer for the directory entry.
+
+@item
+On some systems, @code{readdir_r} cannot read directory entries with
+very long names. If such a name is encountered, @theglibc{}
+implementation of @code{readdir_r} returns with an error code of
+@code{ENAMETOOLONG} after the final directory entry has been read. On
+other systems, @code{readdir_r} may return successfully, but the
+@code{d_name} member may not be NUL-terminated or may be truncated.
+
+@item
+POSIX-1.2008 does not guarantee that @code{readdir} is thread-safe,
+even when access to the same @var{dirstream} is serialized. But in
+current implementations (including @theglibc{}), it is safe to call
+@code{readdir} concurrently on different @var{dirstream}s, so there is
+no need to use @code{readdir_r} in most multi-threaded programs. In
+the rare case that multiple threads need to read from the same
+@var{dirstream}, it is still better to use @code{readdir} and external
+synchronization.
+
+@item
+It is expected that future versions of POSIX will obsolete
+@code{readdir_r} and mandate the level of thread safety for
+@code{readdir} which is provided by @theglibc{} and other
+implementations today.
+@end itemize
Normally @code{readdir_r} returns zero and sets @code{*@var{result}}
to @var{entry}. If there are no more entries in the directory or an
@@ -481,15 +523,6 @@ error is detected, @code{readdir_r} sets @code{*@var{result}} to a
null pointer and returns a nonzero error code, also stored in
@code{errno}, as described for @code{readdir}.
-@strong{Portability Note:} On some systems @code{readdir_r} may not
-return a NUL terminated string for the file name, even when there is no
-@code{d_reclen} field in @code{struct dirent} and the file
-name is the maximum allowed size. Modern systems all have the
-@code{d_reclen} field, and on old systems multi-threading is not
-critical. In any case there is no such problem with the @code{readdir}
-function, so that even on systems without the @code{d_reclen} member one
-could use multiple threads by using external locking.
-
It is also important to look at the definition of the @code{struct
dirent} type. Simply passing a pointer to an object of this type for
the second parameter of @code{readdir_r} might not be enough. Some
diff --git a/sysdeps/posix/dirstream.h b/sysdeps/posix/dirstream.h
index a7a074d..8e8570d 100644
--- a/sysdeps/posix/dirstream.h
+++ b/sysdeps/posix/dirstream.h
@@ -39,6 +39,8 @@ struct __dirstream
off_t filepos; /* Position of next entry to read. */
+ int errcode; /* Delayed error code. */
+
/* Directory block. */
char data[0] __attribute__ ((aligned (__alignof__ (void*))));
};
diff --git a/sysdeps/posix/opendir.c b/sysdeps/posix/opendir.c
index ddfc3a7..fc05b0f 100644
--- a/sysdeps/posix/opendir.c
+++ b/sysdeps/posix/opendir.c
@@ -231,6 +231,7 @@ __alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp)
dirp->size = 0;
dirp->offset = 0;
dirp->filepos = 0;
+ dirp->errcode = 0;
return dirp;
}
diff --git a/sysdeps/posix/readdir_r.c b/sysdeps/posix/readdir_r.c
index b5a8e2e..8ed5c3f 100644
--- a/sysdeps/posix/readdir_r.c
+++ b/sysdeps/posix/readdir_r.c
@@ -40,6 +40,7 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
DIRENT_TYPE *dp;
size_t reclen;
const int saved_errno = errno;
+ int ret;
__libc_lock_lock (dirp->lock);
@@ -70,10 +71,10 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
bytes = 0;
__set_errno (saved_errno);
}
+ if (bytes < 0)
+ dirp->errcode = errno;
dp = NULL;
- /* Reclen != 0 signals that an error occurred. */
- reclen = bytes != 0;
break;
}
dirp->size = (size_t) bytes;
@@ -106,29 +107,46 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
dirp->filepos += reclen;
#endif
- /* Skip deleted files. */
+#ifdef NAME_MAX
+ if (reclen > offsetof (DIRENT_TYPE, d_name) + NAME_MAX + 1)
+ {
+ /* The record is very long. It could still fit into the
+ caller-supplied buffer if we can skip padding at the
+ end. */
+ size_t namelen = _D_EXACT_NAMLEN (dp);
+ if (namelen <= NAME_MAX)
+ reclen = offsetof (DIRENT_TYPE, d_name) + namelen + 1;
+ else
+ {
+ /* The name is too long. Ignore this file. */
+ dirp->errcode = ENAMETOOLONG;
+ dp->d_ino = 0;
+ continue;
+ }
+ }
+#endif
+
+ /* Skip deleted and ignored files. */
}
while (dp->d_ino == 0);
if (dp != NULL)
{
-#ifdef GETDENTS_64BIT_ALIGNED
- /* The d_reclen value might include padding which is not part of
- the DIRENT_TYPE data structure. */
- reclen = MIN (reclen,
- offsetof (DIRENT_TYPE, d_name) + sizeof (dp->d_name));
-#endif
*result = memcpy (entry, dp, reclen);
-#ifdef GETDENTS_64BIT_ALIGNED
+#ifdef _DIRENT_HAVE_D_RECLEN
entry->d_reclen = reclen;
#endif
+ ret = 0;
}
else
- *result = NULL;
+ {
+ *result = NULL;
+ ret = dirp->errcode;
+ }
__libc_lock_unlock (dirp->lock);
- return dp != NULL ? 0 : reclen ? errno : 0;
+ return ret;
}
#ifdef __READDIR_R_ALIAS
diff --git a/sysdeps/posix/rewinddir.c b/sysdeps/posix/rewinddir.c
index 2935a8e..d4991ad 100644
--- a/sysdeps/posix/rewinddir.c
+++ b/sysdeps/posix/rewinddir.c
@@ -33,6 +33,7 @@ rewinddir (dirp)
dirp->filepos = 0;
dirp->offset = 0;
dirp->size = 0;
+ dirp->errcode = 0;
#ifndef NOT_IN_libc
__libc_lock_unlock (dirp->lock);
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/readdir64_r.c b/sysdeps/unix/sysv/linux/i386/readdir64_r.c
index 8ebbcfd..a7d114e 100644
--- a/sysdeps/unix/sysv/linux/i386/readdir64_r.c
+++ b/sysdeps/unix/sysv/linux/i386/readdir64_r.c
@@ -18,7 +18,6 @@
#define __READDIR_R __readdir64_r
#define __GETDENTS __getdents64
#define DIRENT_TYPE struct dirent64
-#define GETDENTS_64BIT_ALIGNED 1
#include <sysdeps/posix/readdir_r.c>
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
index 5ed8e95..290f2c8 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
+++ b/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
@@ -1,5 +1,4 @@
#define readdir64_r __no_readdir64_r_decl
-#define GETDENTS_64BIT_ALIGNED 1
#include <sysdeps/posix/readdir_r.c>
#undef readdir64_r
weak_alias (__readdir_r, readdir64_r)

View File

@ -0,0 +1,56 @@
https://projects.archlinux.org/svntogit/packages.git/tree/trunk/glibc-2.18-malloc-corrupt-CVE-2013-4332.patch?h=packages/glibc
diff --git a/malloc/malloc.c b/malloc/malloc.c
index dd295f5..7f43ba3 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3082,6 +3082,13 @@ __libc_pvalloc(size_t bytes)
size_t page_mask = GLRO(dl_pagesize) - 1;
size_t rounded_bytes = (bytes + page_mask) & ~(page_mask);
+ /* Check for overflow. */
+ if (bytes > SIZE_MAX - 2*pagesz - MINSIZE)
+ {
+ __set_errno (ENOMEM);
+ return 0;
+ }
+
void *(*hook) (size_t, size_t, const void *) =
force_reg (__memalign_hook);
if (__builtin_expect (hook != NULL, 0))
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 7f43ba3..3148c5f 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3046,6 +3046,13 @@ __libc_valloc(size_t bytes)
size_t pagesz = GLRO(dl_pagesize);
+ /* Check for overflow. */
+ if (bytes > SIZE_MAX - pagesz - MINSIZE)
+ {
+ __set_errno (ENOMEM);
+ return 0;
+ }
+
void *(*hook) (size_t, size_t, const void *) =
force_reg (__memalign_hook);
if (__builtin_expect (hook != NULL, 0))
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 3148c5f..f7718a9 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3015,6 +3015,13 @@ __libc_memalign(size_t alignment, size_t bytes)
/* Otherwise, ensure that it is at least a minimum chunk size */
if (alignment < MINSIZE) alignment = MINSIZE;
+ /* Check for overflow. */
+ if (bytes > SIZE_MAX - alignment - MINSIZE)
+ {
+ __set_errno (ENOMEM);
+ return 0;
+ }
+
arena_get(ar_ptr, bytes + alignment + MINSIZE);
if(!ar_ptr)
return 0;

View File

@ -0,0 +1,50 @@
commit 7cbcdb3699584db8913ca90f705d6337633ee10f
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Fri Oct 25 10:22:12 2013 +0530
Fix stack overflow due to large AF_INET6 requests
Resolves #16072 (CVE-2013-4458).
This patch fixes another stack overflow in getaddrinfo when it is
called with AF_INET6. The AF_UNSPEC case was fixed as CVE-2013-1914,
but the AF_INET6 case went undetected back then.
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index e6ce4cf..8ff74b4 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -197,7 +197,22 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
&rc, &herrno, NULL, &localcanon)); \
if (rc != ERANGE || herrno != NETDB_INTERNAL) \
break; \
- tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen); \
+ if (!malloc_tmpbuf && __libc_use_alloca (alloca_used + 2 * tmpbuflen)) \
+ tmpbuf = extend_alloca_account (tmpbuf, tmpbuflen, 2 * tmpbuflen, \
+ alloca_used); \
+ else \
+ { \
+ char *newp = realloc (malloc_tmpbuf ? tmpbuf : NULL, \
+ 2 * tmpbuflen); \
+ if (newp == NULL) \
+ { \
+ result = -EAI_MEMORY; \
+ goto free_and_return; \
+ } \
+ tmpbuf = newp; \
+ malloc_tmpbuf = true; \
+ tmpbuflen = 2 * tmpbuflen; \
+ } \
} \
if (status == NSS_STATUS_SUCCESS && rc == 0) \
h = &th; \
@@ -209,7 +224,8 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
{ \
__set_h_errno (herrno); \
_res.options |= old_res_options & RES_USE_INET6; \
- return -EAI_SYSTEM; \
+ result = -EAI_SYSTEM; \
+ goto free_and_return; \
} \
if (herrno == TRY_AGAIN) \
no_data = EAI_AGAIN; \

View File

@ -0,0 +1,222 @@
commit c61b4d41c9647a54a329aa021341c0eb032b793e
Author: Carlos O'Donell <carlos@redhat.com>
Date: Mon Sep 23 00:52:09 2013 -0400
BZ #15754: CVE-2013-4788
The pointer guard used for pointer mangling was not initialized for
static applications resulting in the security feature being disabled.
The pointer guard is now correctly initialized to a random value for
static applications. Existing static applications need to be
recompiled to take advantage of the fix.
The test tst-ptrguard1-static and tst-ptrguard1 add regression
coverage to ensure the pointer guards are sufficiently random
and initialized to a default value.
diff --git a/csu/libc-start.c b/csu/libc-start.c
index e5da3ef..c898d06 100644
--- a/csu/libc-start.c
+++ b/csu/libc-start.c
@@ -37,6 +37,12 @@ extern void __pthread_initialize_minimal (void);
in thread local area. */
uintptr_t __stack_chk_guard attribute_relro;
# endif
+# ifndef THREAD_SET_POINTER_GUARD
+/* Only exported for architectures that don't store the pointer guard
+ value in thread local area. */
+uintptr_t __pointer_chk_guard_local
+ attribute_relro attribute_hidden __attribute__ ((nocommon));
+# endif
#endif
#ifdef HAVE_PTR_NTHREADS
@@ -195,6 +201,16 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
# else
__stack_chk_guard = stack_chk_guard;
# endif
+
+ /* Set up the pointer guard value. */
+ uintptr_t pointer_chk_guard = _dl_setup_pointer_guard (_dl_random,
+ stack_chk_guard);
+# ifdef THREAD_SET_POINTER_GUARD
+ THREAD_SET_POINTER_GUARD (pointer_chk_guard);
+# else
+ __pointer_chk_guard_local = pointer_chk_guard;
+# endif
+
#endif
/* Register the destructor of the dynamic linker if there is any. */
diff --git a/ports/sysdeps/ia64/stackguard-macros.h b/ports/sysdeps/ia64/stackguard-macros.h
index dc683c2..3907293 100644
--- a/ports/sysdeps/ia64/stackguard-macros.h
+++ b/ports/sysdeps/ia64/stackguard-macros.h
@@ -2,3 +2,6 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("adds %0 = -8, r13;; ld8 %0 = [%0]" : "=r" (x)); x; })
+
+#define POINTER_CHK_GUARD \
+ ({ uintptr_t x; asm ("adds %0 = -16, r13;; ld8 %0 = [%0]" : "=r" (x)); x; })
diff --git a/ports/sysdeps/tile/stackguard-macros.h b/ports/sysdeps/tile/stackguard-macros.h
index 589ea2b..f2e041b 100644
--- a/ports/sysdeps/tile/stackguard-macros.h
+++ b/ports/sysdeps/tile/stackguard-macros.h
@@ -4,11 +4,17 @@
# if __WORDSIZE == 64
# define STACK_CHK_GUARD \
({ uintptr_t x; asm ("addi %0, tp, -16; ld %0, %0" : "=r" (x)); x; })
+# define POINTER_CHK_GUARD \
+ ({ uintptr_t x; asm ("addi %0, tp, -24; ld %0, %0" : "=r" (x)); x; })
# else
# define STACK_CHK_GUARD \
({ uintptr_t x; asm ("addi %0, tp, -8; ld4s %0, %0" : "=r" (x)); x; })
+# define POINTER_CHK_GUARD \
+ ({ uintptr_t x; asm ("addi %0, tp, -12; ld4s %0, %0" : "=r" (x)); x; })
# endif
#else
# define STACK_CHK_GUARD \
({ uintptr_t x; asm ("addi %0, tp, -8; lw %0, %0" : "=r" (x)); x; })
+# define POINTER_CHK_GUARD \
+ ({ uintptr_t x; asm ("addi %0, tp, -12; lw %0, %0" : "=r" (x)); x; })
#endif
diff --git a/sysdeps/generic/stackguard-macros.h b/sysdeps/generic/stackguard-macros.h
index ababf65..4fa3d96 100644
--- a/sysdeps/generic/stackguard-macros.h
+++ b/sysdeps/generic/stackguard-macros.h
@@ -2,3 +2,6 @@
extern uintptr_t __stack_chk_guard;
#define STACK_CHK_GUARD __stack_chk_guard
+
+extern uintptr_t __pointer_chk_guard_local;
+#define POINTER_CHK_GUARD __pointer_chk_guard_local
diff --git a/sysdeps/i386/stackguard-macros.h b/sysdeps/i386/stackguard-macros.h
index 8c31e19..0397629 100644
--- a/sysdeps/i386/stackguard-macros.h
+++ b/sysdeps/i386/stackguard-macros.h
@@ -2,3 +2,11 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("movl %%gs:0x14, %0" : "=r" (x)); x; })
+
+#define POINTER_CHK_GUARD \
+ ({ \
+ uintptr_t x; \
+ asm ("movl %%gs:%c1, %0" : "=r" (x) \
+ : "i" (offsetof (tcbhead_t, pointer_guard))); \
+ x; \
+ })
diff --git a/sysdeps/powerpc/powerpc32/stackguard-macros.h b/sysdeps/powerpc/powerpc32/stackguard-macros.h
index 839f6a4..b3d0af8 100644
--- a/sysdeps/powerpc/powerpc32/stackguard-macros.h
+++ b/sysdeps/powerpc/powerpc32/stackguard-macros.h
@@ -2,3 +2,13 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("lwz %0,-28680(2)" : "=r" (x)); x; })
+
+#define POINTER_CHK_GUARD \
+ ({ \
+ uintptr_t x; \
+ asm ("lwz %0,%1(2)" \
+ : "=r" (x) \
+ : "i" (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t)) \
+ ); \
+ x; \
+ })
diff --git a/sysdeps/powerpc/powerpc64/stackguard-macros.h b/sysdeps/powerpc/powerpc64/stackguard-macros.h
index 9da879c..4620f96 100644
--- a/sysdeps/powerpc/powerpc64/stackguard-macros.h
+++ b/sysdeps/powerpc/powerpc64/stackguard-macros.h
@@ -2,3 +2,13 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("ld %0,-28688(13)" : "=r" (x)); x; })
+
+#define POINTER_CHK_GUARD \
+ ({ \
+ uintptr_t x; \
+ asm ("ld %0,%1(2)" \
+ : "=r" (x) \
+ : "i" (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t)) \
+ ); \
+ x; \
+ })
diff --git a/sysdeps/s390/s390-32/stackguard-macros.h b/sysdeps/s390/s390-32/stackguard-macros.h
index b74c579..449e8d4 100644
--- a/sysdeps/s390/s390-32/stackguard-macros.h
+++ b/sysdeps/s390/s390-32/stackguard-macros.h
@@ -2,3 +2,14 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("ear %0,%%a0; l %0,0x14(%0)" : "=a" (x)); x; })
+
+/* On s390/s390x there is no unique pointer guard, instead we use the
+ same value as the stack guard. */
+#define POINTER_CHK_GUARD \
+ ({ \
+ uintptr_t x; \
+ asm ("ear %0,%%a0; l %0,%1(%0)" \
+ : "=a" (x) \
+ : "i" (offsetof (tcbhead_t, stack_guard))); \
+ x; \
+ })
diff --git a/sysdeps/s390/s390-64/stackguard-macros.h b/sysdeps/s390/s390-64/stackguard-macros.h
index 0cebb5f..c8270fb 100644
--- a/sysdeps/s390/s390-64/stackguard-macros.h
+++ b/sysdeps/s390/s390-64/stackguard-macros.h
@@ -2,3 +2,17 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("ear %0,%%a0; sllg %0,%0,32; ear %0,%%a1; lg %0,0x28(%0)" : "=a" (x)); x; })
+
+/* On s390/s390x there is no unique pointer guard, instead we use the
+ same value as the stack guard. */
+#define POINTER_CHK_GUARD \
+ ({ \
+ uintptr_t x; \
+ asm ("ear %0,%%a0;" \
+ "sllg %0,%0,32;" \
+ "ear %0,%%a1;" \
+ "lg %0,%1(%0)" \
+ : "=a" (x) \
+ : "i" (offsetof (tcbhead_t, stack_guard))); \
+ x; \
+ })
diff --git a/sysdeps/sparc/sparc32/stackguard-macros.h b/sysdeps/sparc/sparc32/stackguard-macros.h
index c0b02b0..1eef0f1 100644
--- a/sysdeps/sparc/sparc32/stackguard-macros.h
+++ b/sysdeps/sparc/sparc32/stackguard-macros.h
@@ -2,3 +2,6 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("ld [%%g7+0x14], %0" : "=r" (x)); x; })
+
+#define POINTER_CHK_GUARD \
+ ({ uintptr_t x; asm ("ld [%%g7+0x18], %0" : "=r" (x)); x; })
diff --git a/sysdeps/sparc/sparc64/stackguard-macros.h b/sysdeps/sparc/sparc64/stackguard-macros.h
index 80f0635..cc0c12c 100644
--- a/sysdeps/sparc/sparc64/stackguard-macros.h
+++ b/sysdeps/sparc/sparc64/stackguard-macros.h
@@ -2,3 +2,6 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("ldx [%%g7+0x28], %0" : "=r" (x)); x; })
+
+#define POINTER_CHK_GUARD \
+ ({ uintptr_t x; asm ("ldx [%%g7+0x30], %0" : "=r" (x)); x; })
diff --git a/sysdeps/x86_64/stackguard-macros.h b/sysdeps/x86_64/stackguard-macros.h
index d7fedb3..1948800 100644
--- a/sysdeps/x86_64/stackguard-macros.h
+++ b/sysdeps/x86_64/stackguard-macros.h
@@ -4,3 +4,8 @@
({ uintptr_t x; \
asm ("mov %%fs:%c1, %0" : "=r" (x) \
: "i" (offsetof (tcbhead_t, stack_guard))); x; })
+
+#define POINTER_CHK_GUARD \
+ ({ uintptr_t x; \
+ asm ("mov %%fs:%c1, %0" : "=r" (x) \
+ : "i" (offsetof (tcbhead_t, pointer_guard))); x; })

View File

@ -0,0 +1,47 @@
/* This function builds just the `lib/locale/locale-archive' file from
Glibc and nothing else. If `allLocales' is true, all supported
locales are included; otherwise, just the locales listed in
`locales'. See localedata/SUPPORTED in the Glibc source tree for
the list of all supported locales:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc
*/
{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }:
let build = import ./common.nix; in
build null {
name = "glibc-locales";
inherit fetchurl stdenv;
installLocales = true;
builder = ./locales-builder.sh;
# Awful hack: `localedef' doesn't allow the path to `locale-archive'
# to be overriden, but you *can* specify a prefix, i.e. it will use
# <prefix>/<path-to-glibc>/lib/locale/locale-archive. So we use
# $TMPDIR as a prefix, meaning that the locale-archive is placed in
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
buildPhase =
''
mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
# Hack to allow building of the locales (needed since glibc-2.12)
sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \
/library-path/d ../glibc-2*/localedata/Makefile
${if allLocales then "" else
"echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"}
make localedata/install-locales \
localedir=$out/lib/locale \
'';
installPhase =
''
mkdir -p "$out/lib/locale"
cp -v "$TMPDIR/$NIX_STORE/"*"/lib/locale/locale-archive" "$out/lib/locale"
'';
meta.description = "Locale information for the GNU C Library";
}

View File

@ -1,7 +1,7 @@
diff -ru glibc-2.17-orig/sunrpc/rpc_main.c glibc-2.17/sunrpc/rpc_main.c
--- glibc-2.17-orig/sunrpc/rpc_main.c 2012-12-25 04:02:13.000000000 +0100
+++ glibc-2.17/sunrpc/rpc_main.c 2012-12-29 00:21:04.124698455 +0100
@@ -77,7 +77,7 @@
diff -ru glibc-2.18-orig/sunrpc/rpc_main.c glibc-2.18/sunrpc/rpc_main.c
--- glibc-2.18-orig/sunrpc/rpc_main.c 2013-08-11 00:52:55.000000000 +0200
+++ glibc-2.18/sunrpc/rpc_main.c 2013-11-15 12:04:48.041006977 +0100
@@ -78,7 +78,7 @@
static const char *svcclosetime = "120";
static int cppDefined; /* explicit path for C preprocessor */
@ -10,7 +10,7 @@ diff -ru glibc-2.17-orig/sunrpc/rpc_main.c glibc-2.17/sunrpc/rpc_main.c
static const char CPPFLAGS[] = "-C";
static char *pathbuf;
static int cpp_pid;
@@ -106,7 +106,6 @@
@@ -107,7 +107,6 @@
static void open_output (const char *infile, const char *outfile);
static void add_warning (void);
static void clear_args (void);
@ -18,7 +18,7 @@ diff -ru glibc-2.17-orig/sunrpc/rpc_main.c glibc-2.17/sunrpc/rpc_main.c
static void open_input (const char *infile, const char *define);
static int check_nettype (const char *name, const char *list_to_check[]);
static void c_output (const char *infile, const char *define,
@@ -318,25 +317,6 @@
@@ -322,25 +321,6 @@
argcount = FIXEDARGS;
}
@ -26,9 +26,9 @@ diff -ru glibc-2.17-orig/sunrpc/rpc_main.c glibc-2.17/sunrpc/rpc_main.c
-static void
-find_cpp (void)
-{
- struct stat buf;
- struct stat64 buf;
-
- if (stat (CPP, &buf) == 0)
- if (stat64 (CPP, &buf) == 0)
- return;
-
- if (cppDefined) /* user specified cpp but it does not exist */
@ -44,7 +44,7 @@ diff -ru glibc-2.17-orig/sunrpc/rpc_main.c glibc-2.17/sunrpc/rpc_main.c
/*
* Open input file with given define for C-preprocessor
*/
@@ -355,7 +335,6 @@
@@ -359,7 +339,6 @@
switch (cpp_pid)
{
case 0:

View File

@ -0,0 +1,21 @@
https://sourceware.org/bugzilla/show_bug.cgi?id=15917
commit a4966c6104918ac884ee1131a4ed23c5ad6b4c5a
Author: Andreas Schwab <schwab@suse.de>
Date: Thu Oct 31 12:51:03 2013 +0100
Fix parsing of 0e+0 as float
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index 78dc2fc..e6fa8f3 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -1966,6 +1966,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (width > 0)
--width;
}
+ else
+ got_digit = 1;
}
while (1)

View File

@ -1,11 +1,11 @@
{ fetchurl, stdenv }:
stdenv.mkDerivation rec {
name = "gsl-1.16";
name = "gsl-1.15";
src = fetchurl {
url = "mirror://gnu/gsl/${name}.tar.gz";
sha256 = "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k";
sha256 = "18qf6jzz1r3mzb5qynywv4xx3z9g61hgkbpkdrhbgqh2g7jhgfc5";
};
# ToDo: there might be more impurities than FMA support check

View File

@ -1,18 +1,18 @@
{ cabal, caseInsensitive, httpClient, httpClientTls, httpTypes
, lens, liftedBase, mtl, network, optparseApplicative, resourcet
, transformers, xmlConduit, xmlHamlet
, lens, liftedBase, monadControl, mtl, network, optparseApplicative
, transformers, transformersBase, xmlConduit, xmlHamlet
}:
cabal.mkDerivation (self: {
pname = "DAV";
version = "0.5.1";
sha256 = "12r5hy6g5k5bdf3n84hpq9b90nz6v2v3xwy7prxkvv99iaxf2lsj";
version = "0.6";
sha256 = "1lqc1w40mzj5gvpd3gc4qwgz3zrivwkz6ssa5592dsnwz81k1dxk";
isLibrary = true;
isExecutable = true;
buildDepends = [
caseInsensitive httpClient httpClientTls httpTypes lens liftedBase
mtl network optparseApplicative resourcet transformers xmlConduit
xmlHamlet
monadControl mtl network optparseApplicative transformers
transformersBase xmlConduit xmlHamlet
];
meta = {
homepage = "http://floss.scru.org/hDAV";

View File

@ -0,0 +1,17 @@
{ cabal, HUnit, stm, testFramework, testFrameworkHunit }:
cabal.mkDerivation (self: {
pname = "async";
version = "2.0.1.5";
sha256 = "0g587b64zgn971qb2lh846ihg4z89037f18821kyaqsgixasq4yd";
buildDepends = [ stm ];
testDepends = [ HUnit testFramework testFrameworkHunit ];
jailbreak = true;
meta = {
homepage = "https://github.com/simonmar/async";
description = "Run IO operations asynchronously and wait for their results";
license = self.stdenv.lib.licenses.bsd3;
platforms = self.ghc.meta.platforms;
maintainers = [ self.stdenv.lib.maintainers.andres ];
};
})

View File

@ -5,8 +5,8 @@
cabal.mkDerivation (self: {
pname = "language-c-quote";
version = "0.7.5";
sha256 = "1ms6bjcqm0mfv0kqznn68svclbpvbwy5rlni0b8i0axhwfgq1l73";
version = "0.7.6";
sha256 = "15sfasbrr9wzqkwv9xg9nvb3gnn4drkll3b3cappiyzkmawp2hkr";
buildDepends = [
exceptionMtl exceptionTransformers filepath haskellSrcMeta
mainlandPretty mtl srcloc syb symbol

View File

@ -2,8 +2,8 @@
cabal.mkDerivation (self: {
pname = "mainland-pretty";
version = "0.2.6";
sha256 = "1mjw79jg0vq8qvgvjdinidw1pvfj3mych3z0f6g031vmqz7fqvzy";
version = "0.2.7";
sha256 = "1g4s2xscj6dpkcghs5lws658ki0rhriivpdr5ilcycvr28k3l35q";
buildDepends = [ srcloc text ];
meta = {
homepage = "http://www.eecs.harvard.edu/~mainland/";

View File

@ -4,8 +4,8 @@
cabal.mkDerivation (self: {
pname = "scientific";
version = "0.1.0.0";
sha256 = "1x3c8z1d7nhr1z5dlbs60pxfrgclfbwjhrkpvr0jnz0fpy2m9x5r";
version = "0.1.0.1";
sha256 = "0s401gxwap4xwz9rxypc76rs5w344s3an45295ybf3id6yal5140";
buildDepends = [ deepseq hashable text ];
testDepends = [ smallcheck tasty tastySmallcheck text ];
doCheck = false;

View File

@ -2,8 +2,8 @@
cabal.mkDerivation (self: {
pname = "smallcheck";
version = "1.1.0.1";
sha256 = "02yv4pa6hilxl7fwskayd5nzs4hq46k91wh04sqj4yfk2s3pgb0m";
version = "1.1.1";
sha256 = "1ygrabxh40bym3grnzqyfqn96lirnxspb8cmwkkr213239y605sd";
buildDepends = [ logict mtl ];
meta = {
homepage = "https://github.com/feuerbach/smallcheck";

View File

@ -1,79 +0,0 @@
{stdenv, fetchurl, unicode ? true}:
let
/* C++ bindings fail to build on `i386-pc-solaris2.11' with GCC 3.4.3:
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6395191>.
It seems that it could be worked around by #including <wchar.h> in the
right place, according to
<http://mail.python.org/pipermail/python-bugs-list/2006-September/035362.html>,
but this is left as an exercise to the reader.
So disable them for now. */
cxx = stdenv.system != "i686-solaris";
in
stdenv.mkDerivation (rec {
name = "ncurses-5.4";
src = fetchurl {
url = "mirror://gnu/ncurses/${name}.tar.gz";
sha256 = "0div11f5flig67v702fd3sj362zagrnaj0d8wvs905s3rxiy1g2s";
};
configureFlags = ''
--with-shared --without-debug
${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"}
'';
preConfigure = ''
export configureFlags="$configureFlags --includedir=$out/include"
'';
selfNativeBuildInput = true;
enableParallelBuilding = true;
preBuild =
# On Darwin, we end up using the native `sed' during bootstrap, and it
# fails to run this command, which isn't needed anyway.
stdenv.lib.optionalString (!stdenv.isDarwin)
''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile'';
# When building a wide-character (Unicode) build, create backward
# compatibility links from the the "normal" libraries to the
# wide-character libraries (e.g. libncurses.so to libncursesw.so).
postInstall = if unicode then ''
${if cxx then "chmod 644 $out/lib/libncurses++w.a" else ""}
for lib in curses ncurses form panel menu; do
if test -e $out/lib/lib''${lib}w.a; then
rm -f $out/lib/lib$lib.so
echo "INPUT(-l''${lib}w)" > $out/lib/lib$lib.so
ln -svf lib''${lib}w.a $out/lib/lib$lib.a
ln -svf lib''${lib}w.so.5 $out/lib/lib$lib.so.5
fi
done;
'' else "";
meta = {
description = "GNU Ncurses, a free software emulation of curses in SVR4 and more";
longDescription = ''
The Ncurses (new curses) library is a free software emulation of
curses in System V Release 4.0, and more. It uses Terminfo
format, supports pads and color and multiple highlights and
forms characters and function-key mapping, and has all the other
SYSV-curses enhancements over BSD Curses.
The ncurses code was developed under GNU/Linux. It has been in
use for some time with OpenBSD as the system curses library, and
on FreeBSD and NetBSD as an external package. It should port
easily to any ANSI/POSIX-conforming UNIX. It has even been
ported to OS/2 Warp!
'';
homepage = http://www.gnu.org/software/ncurses/;
license = "X11";
maintainers = [ stdenv.lib.maintainers.ludo ];
platforms = stdenv.lib.platforms.all;
};
} // ( if stdenv.isDarwin then { postFixup = "rm $out/lib/*.so"; } else { } ) )

View File

@ -52,6 +52,6 @@ in stdenv.mkDerivation {
homepage = http://nodejs.org;
license = licenses.mit;
maintainers = [ maintainers.goibhniu maintainers.shlevy ];
platforms = platforms.linux;
platforms = platforms.linux ++ platforms.darwin;
};
}

View File

@ -1,23 +1,9 @@
diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
index 806f92b..5256856 100644
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py
@@ -224,8 +224,7 @@ class XcodeSettings(object):
def _GetSdkVersionInfoItem(self, sdk, infoitem):
job = subprocess.Popen(['xcodebuild', '-version', '-sdk', sdk, infoitem],
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
+ stdout=subprocess.PIPE)
out = job.communicate()[0]
if job.returncode != 0:
sys.stderr.write(out + '\n')
@@ -234,9 +233,17 @@ class XcodeSettings(object):
def _SdkPath(self):
sdk_root = self.GetPerTargetSetting('SDKROOT', default='macosx')
+ if sdk_root.startswith('/'):
+ return sdk_root
diff -Naur a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
--- a/tools/gyp/pylib/gyp/xcode_emulation.py 2013-11-12 21:22:12.000000000 +0100
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py 2013-12-17 11:07:11.000000000 +0100
@@ -285,8 +285,15 @@
if sdk_root.startswith('/'):
return sdk_root
if sdk_root not in XcodeSettings._sdk_path_cache:
- XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem(
- sdk_root, 'Path')
@ -29,10 +15,11 @@ index 806f92b..5256856 100644
+ # the user is probably on a CLT-only system, where there
+ # is no valid SDK root
+ XcodeSettings._sdk_path_cache[sdk_root] = None
+
return XcodeSettings._sdk_path_cache[sdk_root]
def _AppendPlatformVersionMinFlags(self, lst):
@@ -339,10 +346,11 @@ class XcodeSettings(object):
@@ -397,10 +404,11 @@
cflags += self._Settings().get('WARNING_CFLAGS', [])
@ -48,7 +35,7 @@ index 806f92b..5256856 100644
self.configname = None
return cflags
@@ -572,10 +580,11 @@ class XcodeSettings(object):
@@ -647,10 +655,11 @@
for rpath in self._Settings().get('LD_RUNPATH_SEARCH_PATHS', []):
ldflags.append('-Wl,-rpath,' + rpath)
@ -64,15 +51,15 @@ index 806f92b..5256856 100644
self.configname = None
return ldflags
@@ -700,7 +709,10 @@ class XcodeSettings(object):
@@ -826,7 +835,10 @@
l = '-l' + m.group(1)
else:
l = library
- return l.replace('$(SDKROOT)', self._SdkPath())
- return l.replace('$(SDKROOT)', self._SdkPath(config_name))
+ if self._SdkPath():
+ return l.replace('$(SDKROOT)', self._SdkPath())
+ return l.replace('$(SDKROOT)', self._SdkPath(config_name))
+ else:
+ return l
def AdjustLibraries(self, libraries):
def AdjustLibraries(self, libraries, config_name=None):
"""Transforms entries like 'Cocoa.framework' in libraries into entries like

View File

@ -5,7 +5,7 @@ import ./generic.nix (args // rec {
src = fetchurl {
url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
sha256 = "0nkiy2hxwam91707vccprmap28wiwxar2v2ishj1bb2xzkbnxwpd";
sha256 = "189b7391shzsf0383c3yqf8wy9w82wkzfqmqzxkm77312px1b2yb";
};
features.iwlwifi = true;

View File

@ -8,7 +8,7 @@
with stdenv.lib;
let versionNumber = "304.84"; in
let versionNumber = "304.117"; in
stdenv.mkDerivation {
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernelDev.version}"}";
@ -19,12 +19,12 @@ stdenv.mkDerivation {
if stdenv.system == "i686-linux" then
fetchurl {
url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run";
sha256 = "14hfx3rhf3vf3x3klkhz5qkjrg51r22nqqdzffilcwkxdjfg10j1";
sha256 = "16a09iinz3zgrvj8cywyxsy7i8kpan28b814xhfbl88zadyj0hy3";
}
else if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run";
sha256 = "1ixxkykl78g874g537apvxalggp3kw0mm5q69rl99jlw6jibbm80";
sha256 = "0kzcxfwnp4aw4q53vl57ypc9yck4yj1hfhy8v9wfjlxvi6w6cp0v";
}
else throw "nvidia-x11 does not support platform ${stdenv.system}";

View File

@ -1,8 +1,8 @@
{ stdenv, fetchurl, boost }:
stdenv.mkDerivation {
name = "jfsrec-pre-svn-7";
name = "jfsrec-0-pre-svn-7";
src = fetchurl {
url = mirror://sourceforge/jfsrec/jfsrec-svn-7.tar.gz;
sha256 = "163z6ljr05vw2k5mj4fim2nlg4khjyibrii95370pvn474mg28vg";
@ -14,10 +14,10 @@ stdenv.mkDerivation {
preConfigure =
''
sed -e '/[#]include [<]config.h[>]/a\#include <string.h>' -i src/unicode_to_utf8.cpp
cat src/unicode_to_utf8.cpp
'';
meta = {
description = "JFS recovery tool";
homepage = http://jfsrec.sourceforge.net/;
};
}

View File

@ -8,21 +8,23 @@ stdenv.mkDerivation {
name = "${name}-${version}";
src = fetchurl {
url = "mirror://gnu/src-highlite/${name}-${version}.tar.gz";
sha256 = "1s49ld8cnpzhhwq0r7s0sfm3cg3nhhm0wla27lwraifrrl3y1cp1";
};
url = "mirror://gnu/src-highlite/${name}-${version}.tar.gz";
sha256 = "1s49ld8cnpzhhwq0r7s0sfm3cg3nhhm0wla27lwraifrrl3y1cp1";
};
configureFlags = [ "--with-boost=${boost}" ];
buildInputs = [boost];
buildInputs = [ boost ];
enableParallelBuilding = false;
doCheck = true;
meta = {
description = "source code renderer with syntax highlighting";
homepage = "http://www.gnu.org/software/src-highlite/";
description = "Source code renderer with syntax highlighting";
homepage = http://www.gnu.org/software/src-highlite/;
license = "GPLv3+";
maintainers = [ ];
platforms = stdenv.lib.platforms.all;
platforms = stdenv.lib.platforms.linux;
longDescription =
''
GNU Source-highlight, given a source file, produces a document

View File

@ -1826,7 +1826,7 @@ let
sourceHighlight = callPackage ../tools/text/source-highlight {
# Boost 1.54 causes the "test_regexranges" test to fail
boost = boost153;
boost = boost149;
};
squashfsTools = callPackage ../tools/filesystems/squashfs { };
@ -2366,7 +2366,7 @@ let
# bootstrapping a profiled compiler does not work in the sheevaplug:
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
profiledCompiler = !stdenv.isArm;
profiledCompiler = false;
# When building `gcc.crossDrv' (a "Canadian cross", with host == target
# and host != build), `cross' must be null but the cross-libc must still
@ -2501,7 +2501,7 @@ let
# bootstrapping a profiled compiler does not work in the sheevaplug:
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
profiledCompiler = !stdenv.isArm;
profiledCompiler = false;
# When building `gcc.crossDrv' (a "Canadian cross", with host == target
# and host != build), `cross' must be null but the cross-libc must still
@ -3931,8 +3931,6 @@ let
boost144 = callPackage ../development/libraries/boost/1.44.nix { };
boost149 = callPackage ../development/libraries/boost/1.49.nix { };
boost153 = callPackage ../development/libraries/boost/1.53.nix { };
boost154 = callPackage ../development/libraries/boost/1.54.nix { };
boost155 = callPackage ../development/libraries/boost/1.55.nix { };
boost = boost155;
@ -4238,30 +4236,7 @@ let
glfw = callPackage ../development/libraries/glfw { };
glibcCross = glibc217Cross;
glibc213 = (callPackage ../development/libraries/glibc/2.13 {
kernelHeaders = linuxHeaders;
installLocales = config.glibc.locales or false;
machHeaders = null;
hurdHeaders = null;
gccCross = null;
}) // (if crossSystem != null then { crossDrv = glibc213Cross; } else {});
glibc213Cross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.13)
(let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
in {
inherit stdenv fetchurl;
gccCross = gccCrossStageStatic;
kernelHeaders = if crossGNU then gnu.hurdHeaders else linuxHeadersCross;
installLocales = config.glibc.locales or false;
}
// lib.optionalAttrs crossGNU {
inherit (gnu) machHeaders hurdHeaders libpthreadHeaders mig;
inherit fetchgit;
}));
glibc = callPackage ../development/libraries/glibc/2.17 {
glibc = callPackage ../development/libraries/glibc/2.18 {
kernelHeaders = linuxHeaders;
installLocales = config.glibc.locales or false;
machHeaders = null;
@ -4269,13 +4244,13 @@ let
gccCross = null;
};
glibc_memusage = callPackage ../development/libraries/glibc/2.17 {
glibc_memusage = callPackage ../development/libraries/glibc/2.18 {
kernelHeaders = linuxHeaders;
installLocales = false;
withGd = true;
};
glibc217Cross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.17)
glibcCross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.18)
(let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
in {
inherit stdenv fetchurl;
@ -4304,9 +4279,9 @@ let
installLocales = config.glibc.locales or false;
};
glibcLocales = callPackage ../development/libraries/glibc/2.17/locales.nix { };
glibcLocales = callPackage ../development/libraries/glibc/2.18/locales.nix { };
glibcInfo = callPackage ../development/libraries/glibc/2.17/info.nix { };
glibcInfo = callPackage ../development/libraries/glibc/2.18/info.nix { };
glibc_multi =
runCommand "${glibc.name}-multi"
@ -5308,15 +5283,7 @@ let
nanomsg = callPackage ../development/libraries/nanomsg { };
ncurses_5_4 = makeOverridable (import ../development/libraries/ncurses/5_4.nix) {
inherit fetchurl;
unicode = system != "i686-cygwin";
stdenv = if stdenv.isDarwin
then allStdenvs.stdenvNative
else stdenv;
};
ncurses_5_9 = makeOverridable (import ../development/libraries/ncurses) {
inherit fetchurl;
ncurses = callPackage ../development/libraries/ncurses {
unicode = system != "i686-cygwin";
stdenv =
# On Darwin, NCurses uses `-no-cpp-precomp', which is specific to
@ -5326,7 +5293,6 @@ let
then allStdenvs.stdenvNative
else stdenv;
};
ncurses = ncurses_5_9;
neon = callPackage ../development/libraries/neon {
compressionSupport = true;
@ -7696,6 +7662,8 @@ let
patches = config.dwm.patches or [];
};
dzen2 = callPackage ../applications/window-managers/dzen2 { };
eaglemode = callPackage ../applications/misc/eaglemode { };
eclipses = recurseIntoAttrs (callPackage ../applications/editors/eclipse { });

View File

@ -141,7 +141,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.finalReturn x
haskellPlatformArgs_future = self : {
inherit (self) cabal ghc;
async = self.async_2_0_1_4;
async = self.async_2_0_1_5;
attoparsec = self.attoparsec_0_10_4_0;
caseInsensitive = self.caseInsensitive_1_1_0_2;
cgi = self.cgi_3001_1_8_4;
@ -558,7 +558,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.finalReturn x
async_2_0_1_3 = callPackage ../development/libraries/haskell/async/2.0.1.3.nix {};
async_2_0_1_4 = callPackage ../development/libraries/haskell/async/2.0.1.4.nix {};
async = self.async_2_0_1_4;
async_2_0_1_5 = callPackage ../development/libraries/haskell/async/2.0.1.5.nix {};
async = self.async_2_0_1_5;
atomicPrimops = callPackage ../development/libraries/haskell/atomic-primops {};

View File

@ -439,6 +439,7 @@ rec {
sha256 = "1zykapgl9lxnlx79xfghzb26qimhry94xfxfyswwfhra1ywd9yyg";
};
propagatedBuildInputs = [ TimeDate DBFile DigestSHA1 FileNFSLock HeapFibonacci IOString ];
doCheck = false; # can time out
meta = {
maintainers = with maintainers; [ ocharles ];
platforms = stdenv.lib.platforms.unix;