This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix LD_LIBRARY_PATH setting in libgomp testing
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 7 Feb 2006 22:24:06 +0100
- Subject: [PATCH] Fix LD_LIBRARY_PATH setting in libgomp testing
libgomp-dg.exp uses gcc-set-multilib-library-path to compute the multilib
related part of LD_LIBRARY_PATH. Unfortunately this proc requires the global
variable rootme to be set and it is not set for topvel libraries, so all the
execution tests for non-default multilibs fail on non-Linux systems.
This patch brings libgomp-dg.exp on par with other toplevel libraries. Tested
on SPARC/Solaris 7, 8, 9 and 10 and AMD64/Linux. OK for mainline?
2006-02-07 Eric Botcazou <ebotcazou@libertysurf.fr>
* testsuite/lib/libgomp-dg.exp (libgomp_init): Compute multilib related
part of LD_LIBRARY_PATH manually.
--
Eric Botcazou
Index: testsuite/lib/libgomp-dg.exp
===================================================================
--- testsuite/lib/libgomp-dg.exp (revision 110691)
+++ testsuite/lib/libgomp-dg.exp (working copy)
@@ -94,14 +94,29 @@ proc libgomp_init { args } {
# Compute what needs to be put into LD_LIBRARY_PATH
set ld_library_path ".:${blddir}/.libs"
+ if { [info exists lang_test_file] && [file exists "${blddir}/"] } {
+ append ld_library_path ":${blddir}/${lang_library_path}"
+ }
+
+ # Compute what needs to be added to the existing LD_LIBRARY_PATH.
if {$gccdir != ""} {
append ld_library_path ":${gccdir}"
- }
+ set compiler [lindex $GCC_UNDER_TEST 0]
- if { [info exists lang_test_file] && [file exists "${blddir}/"] } {
- append ld_library_path ":${blddir}/${lang_library_path}"
+ if { [is_remote host] == 0 && [which $compiler] != 0 } {
+ foreach i "[exec $compiler --print-multi-lib]" {
+ set mldir ""
+ regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
+ set mldir [string trimright $mldir "\;@"]
+ if { "$mldir" == "." } {
+ continue
+ }
+ if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
+ append ld_library_path ":${gccdir}/${mldir}"
+ }
+ }
+ }
}
- append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars
set ALWAYS_CFLAGS ""