This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: other/17466: Testsuites in gcc override LD_LIBRARY_PATH
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 14 Sep 2004 12:26:42 +0100
- Subject: Re: PATCH: other/17466: Testsuites in gcc override LD_LIBRARY_PATH
- References: <20040913221544.GB28496@lucon.org>
"H. J. Lu" <hjl@lucon.org> writes:
> PR other/17466:
> * lib/gcc-defs.exp (${tool}_set_ld_library_path): New procedure.
> * lib/g++.exp (g++_link_flags): Don't use global
> ld_library_path. Call ${tool}_set_ld_library_path to set up
> LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH,
> LD_LIBRARY64_PATH and DYLD_LIBRARY_PATH.
> * lib/g77.exp (g77_link_flags): Likewise.
> * lib/objc.exp (objc_target_compile): Likewise.
> * lib/gcc-dg.exp: Call ${tool}_set_ld_library_path to set up
> LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH,
> LD_LIBRARY64_PATH and DYLD_LIBRARY_PATH.
Look at what mainline does. The problem with things like this:
> + if [info exists env(LD_LIBRARY_PATH)] {
> + setenv LD_LIBRARY_PATH "$ld_library_path:$env(LD_LIBRARY_PATH)"
> + } else {
> + setenv LD_LIBRARY_PATH $ld_library_path
> + }
is that ld_library_path will get added each time the function is called,
and it can be called several times during a typical testsuite run.
The variable can eventually exceed the environment limits on some
systems (e.g. IRIX).
Also, since you need to apply the same construct to several variables,
please consider using "foreach".
Richard