This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: other/17466: Testsuites in gcc override LD_LIBRARY_PATH


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]