3
0
Fork 0
forked from mirrors/nixpkgs

Add tentative glibc 2.11 expression, based on that of glibc 2.9.

svn path=/nixpkgs/branches/stdenv-updates/; revision=18478
This commit is contained in:
Ludovic Courtès 2009-11-19 23:28:45 +00:00
parent 6f3630e128
commit e1af625517
11 changed files with 606 additions and 0 deletions

View file

@ -0,0 +1,42 @@
Support GNU Binutils 2.20 and beyond. Patch from
http://sourceware.org/ml/libc-alpha/2009-09/msg00009.html .
diff --git a/configure b/configure
index 48e6952..b1d84d7 100755
--- a/configure
+++ b/configure
@@ -4841,7 +4841,7 @@ $as_echo_n "checking version of $AS... " >&6; }
ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 2.1[3-9]*)
+ 2.1[3-9]*|[2-9].[2-9]*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
@@ -4904,7 +4904,7 @@ $as_echo_n "checking version of $LD... " >&6; }
ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 2.1[3-9]*)
+ 2.1[3-9]*|[2-9].[2-9]*)
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
diff --git a/configure.in b/configure.in
index 4584afe..7c4f71f 100644
--- a/configure.in
+++ b/configure.in
@@ -897,10 +897,10 @@ AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
# Accept binutils 2.13 or newer.
AC_CHECK_PROG_VER(AS, $AS, --version,
[GNU assembler.* \([0-9]*\.[0-9.]*\)],
- [2.1[3-9]*], AS=: critic_missing="$critic_missing as")
+ [2.1[3-9]*|[2-9].[2-9]*], AS=: critic_missing="$critic_missing as")
AC_CHECK_PROG_VER(LD, $LD, --version,
[GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
- [2.1[3-9]*], LD=: critic_missing="$critic_missing ld")
+ [2.1[3-9]*|[2-9].[2-9]*], LD=: critic_missing="$critic_missing ld")
# We need the physical current working directory. We cannot use the
# "pwd -P" shell builtin since that's not portable. Instead we try to

View file

@ -0,0 +1,33 @@
From 7c8a67320e26b8c11108bf0a3410d3aef9cf3486 Mon Sep 17 00:00:00 2001
From: Ulrich Drepper <drepper@redhat.com>
Date: Sat, 31 Jan 2009 00:21:15 +0000
Subject: [PATCH] * elf/Makefile (ld.so): Adjust the sed script to insert _begin in to
newer linker scripts.
---
ChangeLog | 5 +++++
elf/Makefile | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/elf/Makefile b/elf/Makefile
index 8079fe9..e44ff1d 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1995-2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -304,7 +304,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
$(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
LC_ALL=C \
sed -e '/^=========/,/^=========/!d;/^=========/d' \
- -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
+ -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
> $@.lds
$(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
$(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
--
1.6.4

View file

@ -0,0 +1,83 @@
# Glibc cannot have itself in its RPATH.
export NIX_NO_SELF_RPATH=1
source $stdenv/setup
# Explicitly tell glibc to use our pwd, not /bin/pwd.
export PWD_P=$(type -tP pwd)
# 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.
export BASH_SHELL=/bin/sh
preConfigure() {
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
# In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
# than C-translit.h.in, forcing Make to rebuild it unnecessarily.
# This wouldn't be problem except that it requires Perl, which we
# don't want as a dependency in the Nixpkgs bootstrap. So force
# the output file to be newer.
touch locale/C-translit.h
if test -n "$crossConfig"; then
sed -i s/-lgcc_eh//g Makeconfig
fi
mkdir build
cd build
configureScript=../configure
if test -n "$crossConfig"; then
cat > config.cache << "EOF"
libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes
libc_cv_gnu89_inline=yes
EOF
export BUILD_CC=gcc
export CC="${crossConfig}-gcc"
export AR="${crossConfig}-ar"
export RANLIB="${crossConfig}-ranlib"
configureFlags="${configureFlags} --cache-file=config.cache"
# The host stripp will destroy everything in the target binaries otherwise
dontStrip=1
fi
}
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 localedata/install-locales
fi
test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
(cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
# 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
}
genericBuild

View file

@ -0,0 +1,110 @@
{ stdenv, fetchurl, kernelHeaders
, installLocales ? true
, profilingLibraries ? false
, cross ? null
, binutilsCross ? null
, gccCross ? null
}:
/* FIXME: Update `locales.nix' and `info.nix'. */
let version = "2.11"; in
stdenv.mkDerivation rec {
name = "glibc-${version}" +
stdenv.lib.optionalString (cross != null) "-${cross.config}";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://gnu/glibc/${name}.tar.bz2";
sha256 = "0b6nbr89qmqcvzz26ggnw7gcxhvnzbc8z299h12wqjmcix4hxwcy";
};
inherit kernelHeaders installLocales;
crossConfig = if (cross != null) then cross.config else null;
inherit (stdenv) is64bit;
patches = [
/* 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
/* Make it possible to override the locale-archive in NixOS. */
./locale-override.patch
/* Have rpcgen(1) look for cpp(1) in $PATH. */
./rpcgen-path.patch
/* Support GNU Binutils 2.20 and above. */
./binutils-2.20.patch
./binutils-ld.patch
];
configureFlags = [
"--enable-add-ons"
"--with-headers=${kernelHeaders}/include"
(if profilingLibraries then "--enable-profile" else "--disable-profile")
] ++ stdenv.lib.optionals (cross != null) [
"--host=${cross.config}"
"--build=${stdenv.system}"
"--with-tls"
"--enable-kernel=2.6.0"
"--without-fp"
"--with-__thread"
] ++ (if (stdenv.system == "armv5tel-linux") then [
"--host=arm-linux-gnueabi"
"--build=arm-linux-gnueabi"
"--without-fp"
] else []);
buildInputs = stdenv.lib.optionals (cross != null) [ binutilsCross gccCross ];
preInstall = ''
ensureDir $out/lib
ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
'';
postInstall = ''
rm $out/lib/libgcc_s.so.1
'';
meta = {
homepage = http://www.gnu.org/software/libc/;
description = "The GNU C Library";
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 = [ stdenv.lib.maintainers.ludo ];
platforms = stdenv.lib.platforms.linux;
};
}

View file

@ -0,0 +1,47 @@
{ stdenv, fetchurl, texinfo, perl }:
stdenv.mkDerivation rec {
name = "glibc-info-2.9";
src = fetchurl {
url = http://nixos.org/tarballs/glibc-2.9-20081208.tar.bz2;
sha256 = "0zhxbgcsl97pf349m0lz8d5ljvvzrcqc23yf08d888xlk4ms8m3h";
};
patches = [
/* Support GNU Binutils 2.20 and above. */
./binutils-2.20.patch
];
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
mkdir ../build
cd ../build
configureScript=../$sourceRoot/configure
'';
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 = ''
ensureDir $out/share/info
cp ../$sourceRoot/manual/*.info $out/share/info
'';
meta = {
homepage = http://www.gnu.org/software/libc/;
description = "GNU Info manual of the GNU C Library";
};
}

View file

@ -0,0 +1,72 @@
diff -rc glibc-2.9-20081208-orig/locale/loadarchive.c glibc-2.9-20081208/locale/loadarchive.c
*** glibc-2.9-20081208-orig/locale/loadarchive.c 2005-09-09 18:56:52.000000000 +0200
--- glibc-2.9-20081208/locale/loadarchive.c 2009-04-19 13:54:26.000000000 +0200
***************
*** 124,129 ****
--- 124,142 ----
}
+ static int
+ open_locale_archive ()
+ {
+ int fd = -1;
+ char *path = getenv ("LOCALE_ARCHIVE");
+ if (path)
+ fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
+ if (fd < 0)
+ fd = open_not_cancel_2 (archfname, 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,209 ****
archmapped = &headmap;
/* The archive has never been opened. */
! fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
if (fd < 0)
/* Cannot open the archive, for whatever reason. */
return NULL;
--- 216,222 ----
archmapped = &headmap;
/* The archive has never been opened. */
! fd = open_locale_archive ();
if (fd < 0)
/* Cannot open the archive, for whatever reason. */
return NULL;
***************
*** 394,400 ****
if (fd == -1)
{
struct stat64 st;
! fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
if (fd == -1)
/* Cannot open the archive, for whatever reason. */
return NULL;
--- 407,413 ----
if (fd == -1)
{
struct stat64 st;
! fd = open_locale_archive ();
if (fd == -1)
/* Cannot open the archive, for whatever reason. */
return NULL;
diff -rc glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h glibc-2.9-20081208/sysdeps/generic/unsecvars.h
*** glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h 2006-10-11 18:24:05.000000000 +0200
--- glibc-2.9-20081208/sysdeps/generic/unsecvars.h 2009-04-19 13:55:34.000000000 +0200
***************
*** 16,21 ****
--- 16,22 ----
"LD_SHOW_AUXV\0" \
"LD_USE_LOAD_BIAS\0" \
"LOCALDOMAIN\0" \
+ "LOCALE_ARCHIVE\0" \
"LOCPATH\0" \
"MALLOC_TRACE\0" \
"NIS_PATH\0" \

View file

@ -0,0 +1,67 @@
/* 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"] }:
stdenv.mkDerivation rec {
name = "glibc-locales-2.9";
builder = ./localesbuilder.sh;
src = fetchurl {
url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2;
sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9";
};
srcPorts = fetchurl {
url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2;
sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42";
};
inherit (stdenv) is64bit;
configureFlags = [
"--enable-add-ons"
"--without-headers"
"--disable-profile"
] ++ (if (stdenv.system == "armv5tel-linux") then [
"--host=arm-linux-gnueabi"
"--build=arm-linux-gnueabi"
"--without-fp"
] else []);
patches = [
/* Support GNU Binutils 2.20 and above. */
./binutils-2.20.patch
];
# 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"
make localedata/install-locales \
LOCALEDEF="localedef --prefix=$TMPDIR" \
localedir=$out/lib/locale \
${if allLocales then "" else "SUPPORTED-LOCALES=\"${toString locales}\""}
'';
installPhase =
''
ensureDir $out/lib/locale
cp $TMPDIR/nix/store/*/lib/locale/locale-archive $out/lib/locale/
'';
meta = {
homepage = http://www.gnu.org/software/libc/;
description = "Locale information for the GNU C Library";
};
}

View file

@ -0,0 +1,50 @@
# Glibc cannot have itself in its RPATH.
export NIX_NO_SELF_RPATH=1
source $stdenv/setup
# Explicitly tell glibc to use our pwd, not /bin/pwd.
export PWD_P=$(type -tP pwd)
# 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.
export BASH_SHELL=/bin/sh
preConfigure() {
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
# In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
# than C-translit.h.in, forcing Make to rebuild it unnecessarily.
# This wouldn't be problem except that it requires Perl, which we
# don't want as a dependency in the Nixpkgs bootstrap. So force
# the output file to be newer.
touch locale/C-translit.h
tar xvjf "$srcPorts"
mkdir build
cd build
configureScript=../configure
}
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

@ -0,0 +1,25 @@
diff -rc glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c
*** glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c 2008-07-30 21:14:22.000000000 +0200
--- glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c 2008-12-10 11:39:32.000000000 +0100
***************
*** 505,512 ****
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;
--- 505,510 ----
***************
*** 702,707 ****
--- 700,707 ----
while (!no_more)
{
+ enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
+ enum nss_status status = NSS_STATUS_UNAVAIL;
nss_gethostbyname4_r fct4
= __nss_lookup_function (nip, "gethostbyname4_r");
if (fct4 != NULL)

View file

@ -0,0 +1,72 @@
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

@ -3420,6 +3420,11 @@ let
installLocales = getPkgConfig "glibc" "locales" false;
};
glibc211 = makeOverridable (import ../development/libraries/glibc-2.11) {
inherit fetchurl stdenv kernelHeaders;
installLocales = getPkgConfig "glibc" "locales" false;
};
glibcCross = cross: glibc29Cross cross;
eglibc = import ../development/libraries/eglibc {