toolchain to gcc 4.6.1, glibc 2.14, binutils 2.21.1

This commit is contained in:
Kevin Mihelich 2011-07-04 12:27:22 -04:00
parent ecff8fae57
commit 13423afacc
11 changed files with 334 additions and 129 deletions

View file

@ -1,30 +1,30 @@
# $Id: PKGBUILD 121290 2011-04-30 08:22:29Z allan $
# $Id: PKGBUILD 129398 2011-06-27 11:06:48Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# PlugApps: Kevin Mihelich <kevin@plugapps.com>
# - Added a CONFIGFLAG for arm, defining our build host
# - Disabled make check, too processor/ram intensive, blows up
# ALARM: Kevin Mihelich <kevin@plugapps.com>
# - Added a CONFIGFLAG for arm, defining our build host
# - Disabled make check, too processor/ram intensive, blows up
plugrel=1
noautobuild=1
pkgname=binutils
pkgver=2.21
pkgrel=7
_date=20110430
pkgver=2.21.1
pkgrel=1
_date=20110627
pkgdesc="A set of programs to assemble and manipulate binary and object files"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/binutils/"
license=('GPL')
groups=('base')
depends=('glibc>=2.13' 'zlib')
makedepends=('dejagnu')
depends=('glibc>=2.14' 'zlib')
checkdepends=('dejagnu')
options=('!libtool' '!distcc' '!ccache')
install=binutils.install
source=(ftp://ftp.archlinux.org/other/${pkgname}/${pkgname}-${pkgver}_${_date}.tar.bz2)
md5sums=('7b3e28fb35cb8bb371cc47291e1c6dec')
md5sums=('2face559e80d649ba148e42bb2d1fb0f')
mksource() {
mkdir ${pkgname}-${_date}
@ -41,18 +41,18 @@ build() {
mkdir binutils-build && cd binutils-build
# ALARM: Specify build host types
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=arm-unknown-linux-gnueabi --build=arm-unknown-linux-gnueabi"
[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabi --build=armv7l-unknown-linux-gnueabi"
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=arm-unknown-linux-gnueabi --build=arm-unknown-linux-gnueabi" && MAKEFLAG="-j1"
[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabi --build=armv7l-unknown-linux-gnueabi" && MAKEFLAG="-j2"
${srcdir}/binutils/configure --prefix=/usr \
--enable-ld=default --enable-gold \
--enable-plugins --enable-threads \
--enable-shared $CONFIGFLAG
# This checks the host environment and makes sure all the necessary tools are available to compile Binutils.
# check the host environment and makes sure all the necessary tools are available
make configure-host
make tooldir=${pkgdir}/usr
make $MAKEFLAG tooldir=${pkgdir}/usr
}
check() {

View file

@ -1,41 +1,36 @@
# $Id: PKGBUILD 121304 2011-04-30 13:23:58Z allan $
# $Id: PKGBUILD 129471 2011-06-28 04:17:45Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# NOTE: libtool requires rebuilt with each new gcc version
# ALARM: Kevin Mihelich <kevin@plugapps.com>
# - removed ada, go languages
# - removed ada, go packages
# - removed gnat (ada stuff) from gcc packaging
# - removed ada and go packages
# - disabled make check, too much stress, kills plugs :(
# - specifid build host, disabled distcc and ccache, make -j1
# - specifid build host, disabled distcc and ccache, make -j1 (v5), -j2 (v7)
plugrel=1
noautobuild=1
pkgname=('gcc' 'gcc-libs' 'gcc-fortran' 'gcc-objc')
pkgver=4.6.0
pkgrel=4
_snapshot=4.6-20110429
pkgver=4.6.1
pkgrel=1
#_snapshot=4.6-20110603
_libstdcppmanver=20110201 # Note: check source directory name when updating this
pkgdesc="The GNU Compiler Collection"
arch=('i686' 'x86_64')
license=('GPL' 'LGPL' 'FDL' 'custom')
url="http://gcc.gnu.org"
makedepends=('binutils>=2.21' 'libmpc' 'cloog' 'ppl' 'dejagnu')
makedepends=('binutils>=2.21-9' 'libmpc' 'cloog' 'ppl')
checkdepends=('dejagnu')
options=('!libtool' '!emptydirs' '!distcc' '!ccache')
source=(#ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-{core,g++,fortran,objc,go,testsuite}-${pkgver}.tar.bz2
ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-{core,g++,fortran,objc,go,testsuite}-${_snapshot}.tar.bz2
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2
#ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2
ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen/libstdc++-api.${_libstdcppmanver}.man.tar.bz2
gcc_pure64.patch
gcc-hash-style-both.patch)
md5sums=('fa586a5634ae3b462c5fb2d55160b14f'
'2591b1fad977f7bd6136c9ac1298ef04'
'366f93c1867f35c8860b42965efde955'
'21779792ef7e0ed7abef611160b0099c'
'f66ef8597b99961eda7573df505ea354'
'3d89dd233ceb6a837d14ee6b940a43ed'
md5sums=('c57a9170c677bf795bdc04ed796ca491'
'1e9fd2eaf0ee47ea64e82c48998f1999'
'4030ee1c08dd1e843c0225b772360e76'
'4df25b623799b148a0703eaeec8fdf3f')
@ -62,13 +57,13 @@ build() {
echo ${pkgver} > gcc/BASE-VER
# ALARM: Specify build host types
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=arm-unknown-linux-gnueabi --build=arm-unknown-linux-gnueabi" && MAKEFLAG="-j1"
[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabi --build=armv7l-unknown-linux-gnueabi --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16" && MAKEFLAG="-j2"
cd ${srcdir}
mkdir gcc-build && cd gcc-build
# ALARM: Specify build host types
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=arm-unknown-linux-gnueabi --build=arm-unknown-linux-gnueabi"
[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabi --build=armv7l-unknown-linux-gnueabi"
${_basedir}/configure --prefix=/usr \
--libdir=/usr/lib --libexecdir=/usr/lib \
--mandir=/usr/share/man --infodir=/usr/share/info \
@ -83,7 +78,7 @@ build() {
--enable-plugin --with-plugin-ld=ld.gold \
--disable-multilib --disable-libstdcxx-pch \
--enable-checking=release $CONFIGFLAG
make -j1
make $MAKEFLAG
}
check() {
@ -91,7 +86,7 @@ check() {
# increase stack size to prevent test failures
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827
ulimit -s 32768
#ulimit -s 32768
# do not abort on error as some are "expected"
#make -k check || true
@ -102,7 +97,7 @@ package_gcc-libs()
{
pkgdesc="Runtime libraries shipped by GCC"
groups=('base')
depends=('glibc>=2.11.1-2')
depends=('glibc>=2.14')
install=gcc-libs.install
cd gcc-build
@ -131,7 +126,7 @@ package_gcc-libs()
package_gcc()
{
pkgdesc="The GNU Compiler Collection - C and C++ frontends"
depends=('binutils>=2.20.1' 'libmpc>=0.8.1-2' 'cloog' 'ppl')
depends=("gcc-libs=$pkgver-$pkgrel" 'binutils>=2.21.1' 'libmpc' 'cloog' 'ppl')
groups=('base-devel')
install=gcc.install
@ -139,17 +134,16 @@ package_gcc()
# unfortunately it is much, much easier to install the lot and clean-up the mess...
make -j1 DESTDIR=${pkgdir} install
rm -f $pkgdir/usr/bin/{{$CHOST-,}gfortran,{$CHOST-,}gccgo}
rm -f $pkgdir/usr/bin/{$CHOST-,}gfortran
rm -f $pkgdir/usr/lib/*.so*
rm -f $pkgdir/usr/lib/lib{ffi,gfortran,go{,begin},objc,quadmath}.a
rm -f $pkgdir/usr/lib/lib{ffi,gfortran,objc,quadmath}.a
rm -f $pkgdir/usr/lib/libgfortran.spec
rm -rf $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/{finclude,include/objc}
rm -f -r $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/{finclude,include/objc}
rm -f $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/include/{ffi{,target}.h,quadmath{,_weak}.h}
rm -f $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/{cc1obj{,plus},f951,go1,libgfortranbegin.a}
rm -rf $pkgdir/usr/lib/go
rm -f $pkgdir/usr/share/info/{gccgo,gfortran,libgomp,libquadmath}.info
rm -f $pkgdir/usr/lib/gcc/$CHOST/${pkgver}/{cc1obj{,plus},f951,libgfortranbegin.a}
rm -f $pkgdir/usr/share/info/{gfortran,libgomp,libquadmath}.info
rm -f $pkgdir/usr/share/locale/{de,fr}/LC_MESSAGES/libstdc++.mo
rm -f $pkgdir/usr/share/man/man1/{gccgo,gfortran}.1
rm -f $pkgdir/usr/share/man/man1/gfortran.1
rm -f $pkgdir/usr/share/man/man3/ffi*
# many packages require these symlinks

View file

@ -1,20 +0,0 @@
infodir=usr/share/info
filelist=(gnat-style.info gnat_rm.info gnat_ugn.info)
post_install() {
[ -x usr/bin/install-info ] || return 0
for file in ${filelist[@]}; do
install-info $infodir/$file.gz $infodir/dir 2> /dev/null
done
}
post_upgrade() {
post_install $1
}
pre_remove() {
[ -x usr/bin/install-info ] || return 0
for file in ${filelist[@]}; do
install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
done
}

View file

@ -1,16 +1,3 @@
infodir=usr/share/info
filelist=(libgomp.info libquadmath.info)
post_upgrade() {
[ -x usr/bin/install-info ] || return 0
for file in ${filelist[@]}; do
install-info $infodir/$file.gz $infodir/dir 2> /dev/null
done
}
pre_remove() {
[ -x usr/bin/install-info ] || return 0
for file in ${filelist[@]}; do
install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
done
}

View file

@ -1,28 +1,28 @@
# $Id: PKGBUILD 116984 2011-03-27 06:35:25Z allan $
# $Id: PKGBUILD 128661 2011-06-25 11:56:19Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# NOTE: valgrind requires rebuilt with each new glibc version
# ALARM: Kevin Mihelich <kevin@plugapps.com>
# - Added source file for glibc-ports-2.13, needed for building on ARM
# - Symlink glibc-ports-2.13 source dir to ports dir in glibc directory
# - Changed configure to enable ports add-on, specify our build host type
# - Disable distcc and ccache, make -j1
# - Added source file for glibc-ports-2.14, needed for building on ARM
# - Symlink glibc-ports-2.14 source dir to ports dir in glibc directory
# - Changed configure to enable ports add-on, specify our build host type
# - Disabled distcc and ccache, make -j1 for v5, -j2 for v7
plugrel=1
noautobuild=1
pkgname=glibc
pkgver=2.13
pkgrel=5
_glibcdate=20110117
pkgver=2.14
pkgrel=4
_glibcdate=20110617
pkgdesc="GNU C Library"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/libc"
license=('GPL' 'LGPL')
groups=('base')
depends=('linux-api-headers>=2.6.37' 'tzdata')
depends=('linux-api-headers>=2.6.39' 'tzdata')
makedepends=('gcc>=4.4')
backup=(etc/locale.gen
etc/nscd.conf)
@ -35,28 +35,36 @@ source=(ftp://ftp.archlinux.org/other/glibc/${pkgname}-${pkgver}_${_glibcdate}.t
glibc-__i686.patch
glibc-2.12.1-static-shared-getpagesize.patch
glibc-2.12.2-ignore-origin-of-privileged-program.patch
glibc-2.13-prelink.patch
glibc-2.13-futex.patch
glibc-2.14-libdl-crash.patch
#glibc-2.14-fix-resolver-crash-typo.patch
glibc-2.14-revert-4462fad3.patch
glibc-2.14-reexport-rpc-interface.patch
glibc-2.14-reinstall-nis-rpc-headers.patch
nscd
locale.gen.txt
locale-gen)
md5sums=('b7b17d9c6b5b71b5e5322e04ca63c190'
'094e3c9b57da605917a780ab24575187'
md5sums=('e441d745609d93c907b72548ba646dad'
'ee80ed9e723a085099218f959a7e344b'
'4dadb9203b69a3210d53514bb46f41c3'
'0c5540efc51c0b93996c51b57a8540ae'
'40cd342e21f71f5e49e32622b25acc52'
'a3ac6f318d680347bb6e2805d42b73b2'
'b042647ea7d6f22ad319e12e796bd13e'
'24dfab6fd244f3773523412588ecc52c'
'7d0154b7e17ea218c9fa953599d24cc4'
'cea62cc6b903d222c5f26e05a3c0e0e6'
'46e56492cccb1c9172ed3a235cf43c6c'
'c5de2a946215d647c8af5432ec4b0da0'
'55febbb72139ac7b65757df085024b83'
'b587ee3a70c9b3713099295609afde49'
'07ac979b6ab5eeb778d55f041529d623'
'476e9113489f93b348b21e144b6a8fcf')
mksource() {
git clone git://sourceware.org/git/glibc.git
pushd glibc
git checkout -b glibc-2.13-arch origin/release/2.13/master
git checkout -b glibc-2.14-arch origin/release/2.14/master
popd
tar -cvJf glibc-${pkgver}_${_glibcdate}.tar.xz glibc/*
}
@ -85,13 +93,25 @@ build() {
# http://sourceware.org/git/?p=glibc.git;a=patch;h=d14e6b09 (only fedora branch...)
patch -Np1 -i ${srcdir}/glibc-2.12.2-ignore-origin-of-privileged-program.patch
# http://sourceware.org/bugzilla/show_bug.cgi?id=12489
# http://sourceware.org/git/?p=glibc.git;a=commit;h=25b3aada (only fedora branch...)
patch -Np1 -i ${srcdir}/glibc-2.13-prelink.patch
# http://sourceware.org/bugzilla/show_bug.cgi?id=12403
patch -Np1 -i ${srcdir}/glibc-2.13-futex.patch
# http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=675155e9 (only fedora branch...)
# http://sourceware.org/ml/libc-alpha/2011-06/msg00006.html
patch -Np1 -i ${srcdir}/glibc-2.14-libdl-crash.patch
# This fixes the main segfault but not the assert fail (FS#24615)
# http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=57912a71
#patch -Np1 -i ${srcdir}/glibc-2.14-fix-resolver-crash-typo.patch
# resort to reverting the bad commit completely for the moment
patch -Np1 -i ${srcdir}/glibc-2.14-revert-4462fad3.patch
# re-export RPC interface until libtirpc is ready as a replacement
# http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=acee4873 (only fedora branch...)
patch -Np1 -i ${srcdir}/glibc-2.14-reexport-rpc-interface.patch
# http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdd816a3 (only fedora branch...)
patch -Np1 -i ${srcdir}/glibc-2.14-reinstall-nis-rpc-headers.patch
install -dm755 ${pkgdir}/etc
touch ${pkgdir}/etc/ld.so.conf
@ -99,9 +119,14 @@ build() {
mkdir glibc-build
cd glibc-build
if [[ ${CARCH} = "i686" ]]; then
# Hack to fix NPTL issues with Xen, only required on 32bit platforms
export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
fi
# ALARM: Specify build host types
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=arm-unknown-linux-gnueabi --build=arm-unknown-linux-gnueabi"
[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabi --build=armv7l-unknown-linux-gnueabi"
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=arm-unknown-linux-gnueabi --build=arm-unknown-linux-gnueabi" && MAKEFLAG="-j1"
[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabi --build=armv7l-unknown-linux-gnueabi" && MAKEFLAG="-j2"
echo "slibdir=/lib" >> configparms
@ -115,21 +140,21 @@ build() {
--without-cvs --disable-profile \
--disable-multi-arch $CONFIGFLAG
make -j1
make $MAKEFLAG
}
check() {
cd ${srcdir}/glibc-build
# some errors are expected - manually check log files
make -k check || true
#make -k check || true
}
package() {
cd ${srcdir}/glibc-build
make install_root=${pkgdir} install
rm ${pkgdir}/etc/ld.so.{cache,conf}
rm -f ${pkgdir}/etc/ld.so.{cache,conf}
install -dm755 ${pkgdir}/etc/rc.d
install -dm755 ${pkgdir}/usr/sbin
@ -167,7 +192,7 @@ package() {
usr/bin/{gencat,getconf,getent,iconv,locale} \
usr/bin/{localedef,pcprofiledump,rpcgen,sprof} \
usr/lib/getconf/* \
usr/sbin/{iconvconfig,nscd,rpcinfo}
usr/sbin/{iconvconfig,nscd}
[[ $CARCH = "i686" ]] && strip $STRIP_BINARIES usr/bin/lddlibc4
strip $STRIP_STATIC usr/lib/*.a \
@ -177,5 +202,5 @@ package() {
lib/libnss_{compat,dns,files,hesiod,nis,nisplus}-${pkgver}.so \
lib/{libdl,libm,libnsl,libresolv,librt,libutil}-${pkgver}.so \
lib/{libmemusage,libpcprofile,libSegFault}.so \
usr/lib/{pt_chown,gconv/*.so}
usr/lib/{pt_chown,{audit,gconv}/*.so}
}

View file

@ -1,26 +0,0 @@
diff --git a/elf/rtld.c b/elf/rtld.c
index 9a560b3..201c9cf 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2168,6 +2168,10 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
we need it in the memory handling later. */
GLRO(dl_initial_searchlist) = *GL(dl_ns)[LM_ID_BASE]._ns_main_searchlist;
+ /* Remember the last search directory added at startup, now that
+ malloc will no longer be the one from dl-minimal.c. */
+ GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
+
if (prelinked)
{
if (main_map->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL)
@@ -2288,10 +2292,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
lossage);
}
- /* Remember the last search directory added at startup, now that
- malloc will no longer be the one from dl-minimal.c. */
- GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
-
if (! prelinked && rtld_multiple_ref)
{
/* There was an explicit ref to the dynamic linker as a shared lib.

View file

@ -0,0 +1,22 @@
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 97142b7..a001c1e 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -549,7 +549,7 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
ns, ansp, ansp2, nansp2, resplen2);
if (n < 0)
return (-1);
- if (n == 0 && (buf2 == NULL || resplen2 == 0))
+ if (n == 0 && (buf2 == NULL || *resplen2 == 0))
goto next_ns;
} else {
/* Use datagrams. */
@@ -559,7 +559,7 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
ansp2, nansp2, resplen2);
if (n < 0)
return (-1);
- if (n == 0 && (buf2 == NULL || resplen2 == 0))
+ if (n == 0 && (buf2 == NULL || *resplen2 == 0))
goto next_ns;
if (v_circuit)
// XXX Check whether both requests failed or

View file

@ -0,0 +1,132 @@
diff --git a/elf/dl-close.c b/elf/dl-close.c
index 73b2a2f..9bd91e3 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -1,5 +1,5 @@
/* Close a shared object opened by `_dl_open'.
- Copyright (C) 1996-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1996-2007, 2009, 2010 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
@@ -119,17 +119,8 @@ _dl_close_worker (struct link_map *map)
if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
|| dl_close_state != not_pending)
{
- if (map->l_direct_opencount == 0)
- {
- if (map->l_type == lt_loaded)
- dl_close_state = rerun;
- else if (map->l_type == lt_library)
- {
- struct link_map **oldp = map->l_initfini;
- map->l_initfini = map->l_orig_initfini;
- _dl_scope_free (oldp);
- }
- }
+ if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
+ dl_close_state = rerun;
/* There are still references to this object. Do nothing more. */
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index 9e30594..3890d00 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -478,6 +478,7 @@ _dl_map_object_deps (struct link_map *map,
nneeded * sizeof needed[0]);
atomic_write_barrier ();
l->l_initfini = l_initfini;
+ l->l_free_initfini = 1;
}
/* If we have no auxiliary objects just go on to the next map. */
@@ -681,6 +682,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
l_initfini[nlist] = NULL;
atomic_write_barrier ();
map->l_initfini = l_initfini;
+ map->l_free_initfini = 1;
if (l_reldeps != NULL)
{
atomic_write_barrier ();
@@ -689,5 +691,5 @@ Filters not supported with LD_TRACE_PRELINKING"));
_dl_scope_free (old_l_reldeps);
}
if (old_l_initfini != NULL)
- map->l_orig_initfini = old_l_initfini;
+ _dl_scope_free (old_l_initfini);
}
diff --git a/elf/dl-libc.c b/elf/dl-libc.c
index 7be9483..a13fce3 100644
--- a/elf/dl-libc.c
+++ b/elf/dl-libc.c
@@ -265,13 +265,13 @@ libc_freeres_fn (free_mem)
for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
{
- /* Remove all additional names added to the objects. */
for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
{
struct libname_list *lnp = l->l_libname->next;
l->l_libname->next = NULL;
+ /* Remove all additional names added to the objects. */
while (lnp != NULL)
{
struct libname_list *old = lnp;
@@ -279,6 +279,10 @@ libc_freeres_fn (free_mem)
if (! old->dont_free)
free (old);
}
+
+ /* Free the initfini dependency list. */
+ if (l->l_free_initfini)
+ free (l->l_initfini);
}
if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
diff --git a/elf/rtld.c b/elf/rtld.c
index 4a9109e..617e30e 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2251,6 +2251,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
lnp->dont_free = 1;
lnp = lnp->next;
}
+ l->l_free_initfini = 0;
if (l != &GL(dl_rtld_map))
_dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
diff --git a/include/link.h b/include/link.h
index e877104..051b99a 100644
--- a/include/link.h
+++ b/include/link.h
@@ -1,6 +1,6 @@
/* Data structure for communication from the run-time dynamic linker for
loaded ELF shared objects.
- Copyright (C) 1995-2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2006, 2007, 2009, 2010 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
@@ -192,6 +192,9 @@ struct link_map
during LD_TRACE_PRELINKING=1
contains any DT_SYMBOLIC
libraries. */
+ unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
+ freed, ie. not allocated with
+ the dummy malloc in ld.so. */
/* Collected information about own RPATH directories. */
struct r_search_path_struct l_rpath_dirs;
@@ -240,9 +243,6 @@ struct link_map
/* List of object in order of the init and fini calls. */
struct link_map **l_initfini;
- /* The init and fini list generated at startup, saved when the
- object is also loaded dynamically. */
- struct link_map **l_orig_initfini;
/* List of the dependencies introduced through symbol binding. */
struct link_map_reldeps

View file

@ -0,0 +1,26 @@
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 67e1ca2..5e7cca5 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -635,7 +635,7 @@ for linking")
# define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
# define libc_hidden_def(name) hidden_def (name)
# define libc_hidden_weak(name) hidden_weak (name)
-# define libc_hidden_nolink(name, version) hidden_nolink (name, libc, version)
+# define libc_hidden_nolink(name, version) hidden_def (name)
# define libc_hidden_ver(local, name) hidden_ver (local, name)
# define libc_hidden_data_def(name) hidden_data_def (name)
# define libc_hidden_data_weak(name) hidden_data_weak (name)
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index 5134ce9..40c73d1 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -53,7 +53,7 @@ headers-in-tirpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \
des_crypt.h)
headers-not-in-tirpc = $(addprefix rpc/,key_prot.h rpc_des.h) \
$(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
-headers = rpc/netdb.h
+headers = rpc/netdb.h $(headers-in-tirpc) $(headers-not-in-tirpc)
install-others = $(inst_sysconfdir)/rpc
generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
$(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen

View file

@ -0,0 +1,28 @@
From bdd816a366c4e5bba5de7157d948e0c0737fb4fb Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@redhat.com>
Date: Tue, 17 May 2011 17:42:30 +0200
Subject: [PATCH] Reinstall NIS RPC headers
---
nis/Makefile | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/nis/Makefile b/nis/Makefile
index b5c9609..d2934d9 100644
--- a/nis/Makefile
+++ b/nis/Makefile
@@ -23,9 +23,9 @@ subdir := nis
aux := nis_hash
+headers := $(wildcard rpcsvc/*.[hx])
distribute := nss-nis.h nss-nisplus.h nis_intern.h Banner \
- nisplus-parser.h nis_xdr.h nss \
- $(wildcard rpcsvc/*.[hx])
+ nisplus-parser.h nis_xdr.h nss
# These are the databases available for the nis (and perhaps later nisplus)
# service. This must be a superset of the services in nss.
--
1.7.5.4

View file

@ -0,0 +1,37 @@
diff -Naur glibc-orig//resolv/res_send.c glibc/resolv/res_send.c
--- glibc-orig//resolv/res_send.c 2011-06-10 18:59:03.041436996 +1000
+++ glibc/resolv/res_send.c 2011-06-10 19:08:09.379309323 +1000
@@ -549,7 +549,7 @@
ns, ansp, ansp2, nansp2, resplen2);
if (n < 0)
return (-1);
- if (n == 0 && (buf2 == NULL || resplen2 == 0))
+ if (n == 0)
goto next_ns;
} else {
/* Use datagrams. */
@@ -559,7 +559,7 @@
ansp2, nansp2, resplen2);
if (n < 0)
return (-1);
- if (n == 0 && (buf2 == NULL || resplen2 == 0))
+ if (n == 0)
goto next_ns;
if (v_circuit)
// XXX Check whether both requests failed or
@@ -1275,14 +1275,10 @@
(*thisresplenp > *thisanssizp)
? *thisanssizp : *thisresplenp);
- if (recvresp1 || (buf2 != NULL && recvresp2)) {
- *resplen2 = 0;
+ if (recvresp1 || (buf2 != NULL && recvresp2))
return resplen;
- }
if (buf2 != NULL)
{
- /* No data from the first reply. */
- resplen = 0;
/* We are waiting for a possible second reply. */
if (hp->id == anhp->id)
recvresp1 = 1;