Testsuite in libstdc++ overrides LD_LIBRARY_PATH by using the global ld_library_path, which causes LD_LIBRARY_PATH to be set as $ld_library_path.
A patch is posted at http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01372.html
This is ok for 3.4 and 4.0. Thanks H.J! -benjamin
Subject: Bug 17469 CVSROOT: /cvs/gcc Module name: gcc Changes by: hjl@gcc.gnu.org 2004-09-24 16:51:12 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/testsuite/lib: libstdc++.exp Log message: 2004-09-24 H.J. Lu <hongjiu.lu@intel.com> PR libstdc++/17469 * testsuite/lib/libstdc++.exp: Don't use global ld_library_path. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2671&r2=1.2672 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/lib/libstdc++.exp.diff?cvsroot=gcc&r1=1.23&r2=1.24
Subject: Bug 17469 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: hjl@gcc.gnu.org 2004-09-24 16:57:57 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/testsuite/lib: libstdc++.exp Log message: 2004-09-24 H.J. Lu <hongjiu.lu@intel.com> PR libstdc++/17469 * testsuite/lib/libstdc++.exp: Don't use global ld_library_path. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.178&r2=1.2224.2.179 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/lib/libstdc++.exp.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.15.4.5&r2=1.15.4.6
Fixed.