yann@1365: Original patch from: gentoo/src/patchsets/glibc/2.9/3020_all_glibc-tests-sandbox-libdl-paths.patch yann@1365: yann@1365: -= BEGIN original header =- yann@1365: when glibc runs its tests, it does so by invoking the local library loader. yann@1365: in Gentoo, we build/run inside of our "sandbox" which itself is linked against yann@1365: libdl (so that it can load libraries and pull out symbols). the trouble yann@1365: is that when you upgrade from an older glibc to the new one, often times yann@1365: internal symbols change name or abi. this is normally OK as you cannot use yann@1365: libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so yann@1365: we always say "keep all of the glibc libraries from the same build". but yann@1365: when glibc runs its tests, it uses dynamic paths to point to its new local yann@1365: copies of libraries. if the test doesnt use libdl, then glibc doesnt add yann@1365: its path, and when sandbox triggers the loading of libdl, glibc does so yann@1365: from the host system system. this gets us into the case of all libraries yann@1365: are from the locally compiled version of glibc except for libdl.so. yann@1365: yann@1365: Fix by Wormo yann@1365: yann@1365: http://bugs.gentoo.org/56898 yann@1365: yann@1365: -= END original header =- yann@1365: yann@1365: diff -durN glibc-2_9.orig/grp/tst_fgetgrent.sh glibc-2_9/grp/tst_fgetgrent.sh yann@1365: --- glibc-2_9.orig/grp/tst_fgetgrent.sh 2001-07-06 06:54:46.000000000 +0200 yann@1365: +++ glibc-2_9/grp/tst_fgetgrent.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -24,7 +24,8 @@ yann@1365: rtld_installed_name=$1; shift yann@1365: yann@1365: testout=${common_objpfx}/grp/tst_fgetgrent.out yann@1365: -library_path=${common_objpfx} yann@1365: +# make sure libdl is also in path in case sandbox is in use yann@1365: +library_path=${common_objpfx}:${common_objpfx}/dlfcn yann@1365: yann@1365: result=0 yann@1365: yann@1365: diff -durN glibc-2_9.orig/iconvdata/run-iconv-test.sh glibc-2_9/iconvdata/run-iconv-test.sh yann@1365: --- glibc-2_9.orig/iconvdata/run-iconv-test.sh 2008-05-15 03:59:44.000000000 +0200 yann@1365: +++ glibc-2_9/iconvdata/run-iconv-test.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -34,7 +34,7 @@ yann@1365: export GCONV_PATH yann@1365: yann@1365: # We have to have some directories in the library path. yann@1365: -LIBPATH=$codir:$codir/iconvdata yann@1365: +LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn yann@1365: yann@1365: # How the start the iconv(1) program. yann@1365: ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \ yann@1365: diff -durN glibc-2_9.orig/iconvdata/tst-table.sh glibc-2_9/iconvdata/tst-table.sh yann@1365: --- glibc-2_9.orig/iconvdata/tst-table.sh 2002-04-24 23:39:35.000000000 +0200 yann@1365: +++ glibc-2_9/iconvdata/tst-table.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -59,8 +59,11 @@ yann@1365: irreversible=${charset}.irreversible yann@1365: fi yann@1365: yann@1365: +# make sure libdl is also in path in case sandbox is in use yann@1365: +library_path=${common_objpfx}:${common_objpfx}/dlfcn yann@1365: + yann@1365: # iconv in one direction. yann@1365: -${common_objpfx}elf/ld.so --library-path $common_objpfx \ yann@1365: +${common_objpfx}elf/ld.so --library-path $library_path \ yann@1365: ${objpfx}tst-table-from ${charset} \ yann@1365: > ${objpfx}tst-${charset}.table yann@1365: yann@1365: diff -durN glibc-2_9.orig/intl/tst-codeset.sh glibc-2_9/intl/tst-codeset.sh yann@1365: --- glibc-2_9.orig/intl/tst-codeset.sh 2005-04-06 04:18:35.000000000 +0200 yann@1365: +++ glibc-2_9/intl/tst-codeset.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -37,6 +37,9 @@ yann@1365: LOCPATH=${common_objpfx}localedata yann@1365: export LOCPATH yann@1365: yann@1365: +# make sure libdl is also in path in case sandbox is in use yann@1365: +library_path=${common_objpfx}:${common_objpfx}/dlfcn yann@1365: + yann@1365: ${common_objpfx}elf/ld.so --library-path $common_objpfx \ yann@1365: ${objpfx}tst-codeset > ${objpfx}tst-codeset.out yann@1365: yann@1365: diff -durN glibc-2_9.orig/intl/tst-gettext.sh glibc-2_9/intl/tst-gettext.sh yann@1365: --- glibc-2_9.orig/intl/tst-gettext.sh 2004-08-15 21:28:18.000000000 +0200 yann@1365: +++ glibc-2_9/intl/tst-gettext.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -51,9 +51,12 @@ yann@1365: LOCPATH=${common_objpfx}localedata yann@1365: export LOCPATH yann@1365: yann@1365: +# make sure libdl is also in path in case sandbox is in use yann@1365: +library_path=${common_objpfx}:${common_objpfx}/dlfcn yann@1365: + yann@1365: # Now run the test. yann@1365: MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \ yann@1365: -${common_objpfx}elf/ld.so --library-path $common_objpfx \ yann@1365: +${common_objpfx}elf/ld.so --library-path $library_path \ yann@1365: ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir yann@1365: yann@1365: exit $? yann@1365: diff -durN glibc-2_9.orig/intl/tst-gettext2.sh glibc-2_9/intl/tst-gettext2.sh yann@1365: --- glibc-2_9.orig/intl/tst-gettext2.sh 2005-05-04 19:54:48.000000000 +0200 yann@1365: +++ glibc-2_9/intl/tst-gettext2.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -65,8 +65,11 @@ yann@1365: LOCPATH=${objpfx}domaindir yann@1365: export LOCPATH yann@1365: yann@1365: +# make sure libdl is also in path in case sandbox is in use yann@1365: +library_path=${common_objpfx}:${common_objpfx}/dlfcn yann@1365: + yann@1365: # Now run the test. yann@1365: -${common_objpfx}elf/ld.so --library-path $common_objpfx \ yann@1365: +${common_objpfx}elf/ld.so --library-path $library_path \ yann@1365: ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir && yann@1365: cmp ${objpfx}tst-gettext2.out - < ${objpfx}tst-translit.out ${objpfx}domaindir yann@1365: yann@1365: exit $? yann@1365: diff -durN glibc-2_9.orig/malloc/tst-mtrace.sh glibc-2_9/malloc/tst-mtrace.sh yann@1365: --- glibc-2_9.orig/malloc/tst-mtrace.sh 2005-10-15 01:40:35.000000000 +0200 yann@1365: +++ glibc-2_9/malloc/tst-mtrace.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -24,9 +24,12 @@ yann@1365: status=0 yann@1365: trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15 yann@1365: yann@1365: +# make sure libdl is also in path in case sandbox is in use yann@1365: +library_path=${common_objpfx}:${common_objpfx}/dlfcn yann@1365: + yann@1365: MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \ yann@1365: LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \ yann@1365: -${common_objpfx}elf/ld.so --library-path $common_objpfx \ yann@1365: +${common_objpfx}elf/ld.so --library-path $library_path \ yann@1365: ${common_objpfx}malloc/tst-mtrace || status=1 yann@1365: yann@1365: if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then yann@1365: diff -durN glibc-2_9.orig/nptl/tst-tls6.sh glibc-2_9/nptl/tst-tls6.sh yann@1365: --- glibc-2_9.orig/nptl/tst-tls6.sh 2003-09-03 00:02:59.000000000 +0200 yann@1365: +++ glibc-2_9/nptl/tst-tls6.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -5,8 +5,8 @@ yann@1365: rtld_installed_name=$1; shift yann@1365: logfile=$common_objpfx/nptl/tst-tls6.out yann@1365: yann@1365: -# We have to find libc and nptl yann@1365: -library_path=${common_objpfx}:${common_objpfx}nptl yann@1365: +# We have to find libc and nptl (also libdl in case sandbox is in use) yann@1365: +library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn yann@1365: tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \ yann@1365: ${common_objpfx}/nptl/tst-tls5" yann@1365: yann@1365: diff -durN glibc-2_9.orig/posix/globtest.sh glibc-2_9/posix/globtest.sh yann@1365: --- glibc-2_9.orig/posix/globtest.sh 2007-02-14 20:52:33.000000000 +0100 yann@1365: +++ glibc-2_9/posix/globtest.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -18,7 +18,7 @@ yann@1365: esac yann@1365: yann@1365: # We have to find the libc and the NSS modules. yann@1365: -library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod yann@1365: +library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn yann@1365: yann@1365: # Since we use `sort' we must make sure to use the same locale everywhere. yann@1365: LC_ALL=C yann@1365: diff -durN glibc-2_9.orig/posix/tst-getconf.sh glibc-2_9/posix/tst-getconf.sh yann@1365: --- glibc-2_9.orig/posix/tst-getconf.sh 2002-09-01 13:11:25.000000000 +0200 yann@1365: +++ glibc-2_9/posix/tst-getconf.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -10,7 +10,10 @@ yann@1365: else yann@1365: rtld_installed_name=$1; shift yann@1365: runit() { yann@1365: - ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@" yann@1365: + yann@1365: + # make sure libdl is also in path in case sandbox is in use yann@1365: + library_path=${common_objpfx}:${common_objpfx}/dlfcn yann@1365: + ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@" yann@1365: } yann@1365: fi yann@1365: yann@1365: diff -durN glibc-2_9.orig/posix/wordexp-tst.sh glibc-2_9/posix/wordexp-tst.sh yann@1365: --- glibc-2_9.orig/posix/wordexp-tst.sh 2000-10-20 18:23:30.000000000 +0200 yann@1365: +++ glibc-2_9/posix/wordexp-tst.sh 2009-02-02 22:01:23.000000000 +0100 yann@1365: @@ -19,8 +19,11 @@ yann@1365: " yann@1365: export IFS yann@1365: yann@1365: +# make sure libdl is also in path in case sandbox is in use yann@1365: +library_path=${common_objpfx}:${common_objpfx}/dlfcn yann@1365: + yann@1365: failed=0 yann@1365: -${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \ yann@1365: +${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \ yann@1365: ${common_objpfx}posix/wordexp-test '$*' > ${testout}1 yann@1365: cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1 yann@1365: wordexp returned 0