1 when glibc runs its tests, it does so by invoking the local library loader.
2 in Gentoo, we build/run inside of our "sandbox" which itself is linked against
3 libdl (so that it can load libraries and pull out symbols). the trouble
4 is that when you upgrade from an older glibc to the new one, often times
5 internal symbols change name or abi. this is normally OK as you cannot use
6 libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
7 we always say "keep all of the glibc libraries from the same build". but
8 when glibc runs its tests, it uses dynamic paths to point to its new local
9 copies of libraries. if the test doesnt use libdl, then glibc doesnt add
10 its path, and when sandbox triggers the loading of libdl, glibc does so
11 from the host system system. this gets us into the case of all libraries
12 are from the locally compiled version of glibc except for libdl.so.
16 http://bugs.gentoo.org/56898
18 diff -durN glibc-2.12.1.orig/grp/tst_fgetgrent.sh glibc-2.12.1/grp/tst_fgetgrent.sh
19 --- glibc-2.12.1.orig/grp/tst_fgetgrent.sh 2001-07-06 06:54:46.000000000 +0200
20 +++ glibc-2.12.1/grp/tst_fgetgrent.sh 2009-11-13 00:50:37.000000000 +0100
22 rtld_installed_name=$1; shift
24 testout=${common_objpfx}/grp/tst_fgetgrent.out
25 -library_path=${common_objpfx}
26 +# make sure libdl is also in path in case sandbox is in use
27 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
31 diff -durN glibc-2.12.1.orig/iconvdata/run-iconv-test.sh glibc-2.12.1/iconvdata/run-iconv-test.sh
32 --- glibc-2.12.1.orig/iconvdata/run-iconv-test.sh 2008-05-15 03:59:44.000000000 +0200
33 +++ glibc-2.12.1/iconvdata/run-iconv-test.sh 2009-11-13 00:50:37.000000000 +0100
37 # We have to have some directories in the library path.
38 -LIBPATH=$codir:$codir/iconvdata
39 +LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
41 # How the start the iconv(1) program.
42 ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
43 diff -durN glibc-2.12.1.orig/iconvdata/tst-table.sh glibc-2.12.1/iconvdata/tst-table.sh
44 --- glibc-2.12.1.orig/iconvdata/tst-table.sh 2002-04-24 23:39:35.000000000 +0200
45 +++ glibc-2.12.1/iconvdata/tst-table.sh 2009-11-13 00:50:37.000000000 +0100
47 irreversible=${charset}.irreversible
50 +# make sure libdl is also in path in case sandbox is in use
51 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
53 # iconv in one direction.
54 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
55 +${common_objpfx}elf/ld.so --library-path $library_path \
56 ${objpfx}tst-table-from ${charset} \
57 > ${objpfx}tst-${charset}.table
59 diff -durN glibc-2.12.1.orig/intl/tst-codeset.sh glibc-2.12.1/intl/tst-codeset.sh
60 --- glibc-2.12.1.orig/intl/tst-codeset.sh 2005-04-06 04:18:35.000000000 +0200
61 +++ glibc-2.12.1/intl/tst-codeset.sh 2009-11-13 00:50:37.000000000 +0100
63 LOCPATH=${common_objpfx}localedata
66 +# make sure libdl is also in path in case sandbox is in use
67 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
69 ${common_objpfx}elf/ld.so --library-path $common_objpfx \
70 ${objpfx}tst-codeset > ${objpfx}tst-codeset.out
72 diff -durN glibc-2.12.1.orig/intl/tst-gettext.sh glibc-2.12.1/intl/tst-gettext.sh
73 --- glibc-2.12.1.orig/intl/tst-gettext.sh 2004-08-15 21:28:18.000000000 +0200
74 +++ glibc-2.12.1/intl/tst-gettext.sh 2009-11-13 00:50:37.000000000 +0100
76 LOCPATH=${common_objpfx}localedata
79 +# make sure libdl is also in path in case sandbox is in use
80 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
83 MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
84 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
85 +${common_objpfx}elf/ld.so --library-path $library_path \
86 ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
89 diff -durN glibc-2.12.1.orig/intl/tst-gettext2.sh glibc-2.12.1/intl/tst-gettext2.sh
90 --- glibc-2.12.1.orig/intl/tst-gettext2.sh 2005-05-04 19:54:48.000000000 +0200
91 +++ glibc-2.12.1/intl/tst-gettext2.sh 2009-11-13 00:50:37.000000000 +0100
93 LOCPATH=${objpfx}domaindir
96 +# make sure libdl is also in path in case sandbox is in use
97 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
100 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
101 +${common_objpfx}elf/ld.so --library-path $library_path \
102 ${objpfx}tst-gettext2 > ${objpfx}tst-gettext2.out ${objpfx}domaindir &&
103 cmp ${objpfx}tst-gettext2.out - <<EOF
104 String1 - Lang1: 1st string
105 diff -durN glibc-2.12.1.orig/intl/tst-translit.sh glibc-2.12.1/intl/tst-translit.sh
106 --- glibc-2.12.1.orig/intl/tst-translit.sh 2005-05-04 19:56:10.000000000 +0200
107 +++ glibc-2.12.1/intl/tst-translit.sh 2009-11-13 00:50:37.000000000 +0100
109 LOCPATH=${common_objpfx}localedata
112 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
113 +# make sure libdl is also in path in case sandbox is in use
114 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
116 +${common_objpfx}elf/ld.so --library-path $library_path \
117 ${objpfx}tst-translit > ${objpfx}tst-translit.out ${objpfx}domaindir
120 diff -durN glibc-2.12.1.orig/malloc/tst-mtrace.sh glibc-2.12.1/malloc/tst-mtrace.sh
121 --- glibc-2.12.1.orig/malloc/tst-mtrace.sh 2005-10-15 01:40:35.000000000 +0200
122 +++ glibc-2.12.1/malloc/tst-mtrace.sh 2009-11-13 00:50:37.000000000 +0100
125 trap "rm -f ${common_objpfx}malloc/tst-mtrace.leak; exit 1" 1 2 15
127 +# make sure libdl is also in path in case sandbox is in use
128 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
130 MALLOC_TRACE=${common_objpfx}malloc/tst-mtrace.leak \
131 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
132 -${common_objpfx}elf/ld.so --library-path $common_objpfx \
133 +${common_objpfx}elf/ld.so --library-path $library_path \
134 ${common_objpfx}malloc/tst-mtrace || status=1
136 if test $status -eq 0 && test -f ${common_objpfx}malloc/mtrace; then
137 diff -durN glibc-2.12.1.orig/nptl/tst-tls6.sh glibc-2.12.1/nptl/tst-tls6.sh
138 --- glibc-2.12.1.orig/nptl/tst-tls6.sh 2003-09-03 00:02:59.000000000 +0200
139 +++ glibc-2.12.1/nptl/tst-tls6.sh 2009-11-13 00:50:37.000000000 +0100
141 rtld_installed_name=$1; shift
142 logfile=$common_objpfx/nptl/tst-tls6.out
144 -# We have to find libc and nptl
145 -library_path=${common_objpfx}:${common_objpfx}nptl
146 +# We have to find libc and nptl (also libdl in case sandbox is in use)
147 +library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
148 tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
149 ${common_objpfx}/nptl/tst-tls5"
151 diff -durN glibc-2.12.1.orig/posix/globtest.sh glibc-2.12.1/posix/globtest.sh
152 --- glibc-2.12.1.orig/posix/globtest.sh 2008-12-06 07:05:39.000000000 +0100
153 +++ glibc-2.12.1/posix/globtest.sh 2009-11-13 00:50:37.000000000 +0100
157 # We have to find the libc and the NSS modules.
158 -library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
159 +library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod:${common_objpfx}/dlfcn
161 # Since we use `sort' we must make sure to use the same locale everywhere.
163 diff -durN glibc-2.12.1.orig/posix/tst-getconf.sh glibc-2.12.1/posix/tst-getconf.sh
164 --- glibc-2.12.1.orig/posix/tst-getconf.sh 2002-09-01 13:11:25.000000000 +0200
165 +++ glibc-2.12.1/posix/tst-getconf.sh 2009-11-13 00:50:37.000000000 +0100
168 rtld_installed_name=$1; shift
170 - ${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} "$@"
172 + # make sure libdl is also in path in case sandbox is in use
173 + library_path=${common_objpfx}:${common_objpfx}/dlfcn
174 + ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} "$@"
178 diff -durN glibc-2.12.1.orig/posix/wordexp-tst.sh glibc-2.12.1/posix/wordexp-tst.sh
179 --- glibc-2.12.1.orig/posix/wordexp-tst.sh 2000-10-20 18:23:30.000000000 +0200
180 +++ glibc-2.12.1/posix/wordexp-tst.sh 2009-11-13 00:50:37.000000000 +0100
185 +# make sure libdl is also in path in case sandbox is in use
186 +library_path=${common_objpfx}:${common_objpfx}/dlfcn
189 -${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
190 +${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
191 ${common_objpfx}posix/wordexp-test '$*' > ${testout}1
192 cat <<"EOF" | cmp - ${testout}1 >> $logfile || failed=1