aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2004-11-24 04:39:41 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2004-11-24 04:39:41 +0000
commit1df8e83465739411cbb95cbef1b79d520246ab1e (patch)
tree01527763d9092da3909d80b1b0942d2439662fc2 /gcc
parentbe6601c384b7d9adbd0f1439ce004faa0c00f556 (diff)
downloadgcc-1df8e83465739411cbb95cbef1b79d520246ab1e.zip
gcc-1df8e83465739411cbb95cbef1b79d520246ab1e.tar.gz
gcc-1df8e83465739411cbb95cbef1b79d520246ab1e.tar.bz2
target-libpath.exp: New file defining set_ld_library_path_env_vars and restore_ld_library_path_env_vars.
* lib/target-libpath.exp: New file defining set_ld_library_path_env_vars and restore_ld_library_path_env_vars. * g++.dg/compat/compat.exp, lib/g++.exp, lib/gcc-dg.exp, lib/gfortran.exp, lib/objc.exp, lib/treelang.exp: Use new procs. * ada/acats/run_acats (LD_LIBRARY_PATH): Add previous LD_LIBRARY_PATH to LD_LIBRARY_PATH. Export LD_LIBRARY_PATH. * testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp. * testsuite/lib/libjava.exp, testsuite/libjava.jacks/jacks.exp: Use new procs in target-libpath.exp. * testsuite/lib/libmudflap.exp: Use new procs in target-libpath.exp. * testsuite/lib/libstdc++.exp: Use new procs in target-libpath.exp. From-SVN: r91137
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/g++.dg/compat/compat.exp26
-rw-r--r--gcc/testsuite/lib/g++.exp32
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp70
-rw-r--r--gcc/testsuite/lib/gfortran.exp32
-rw-r--r--gcc/testsuite/lib/objc.exp17
-rw-r--r--gcc/testsuite/lib/target-libpath.exp236
-rw-r--r--gcc/testsuite/lib/treelang.exp2
8 files changed, 279 insertions, 145 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 36b75e0..c6fcacb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2004-11-23 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * lib/target-libpath.exp: New file defining set_ld_library_path_env_vars
+ and restore_ld_library_path_env_vars.
+ * g++.dg/compat/compat.exp, lib/g++.exp, lib/gcc-dg.exp,
+ lib/gfortran.exp, lib/objc.exp, lib/treelang.exp: Use new procs.
+ * ada/acats/run_acats (LD_LIBRARY_PATH): Add previous LD_LIBRARY_PATH
+ to LD_LIBRARY_PATH. Export LD_LIBRARY_PATH.
+
2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
* gcc.dg/pragma-align-2.c: Test macro expansion.
diff --git a/gcc/testsuite/g++.dg/compat/compat.exp b/gcc/testsuite/g++.dg/compat/compat.exp
index df8dac9..5128273 100644
--- a/gcc/testsuite/g++.dg/compat/compat.exp
+++ b/gcc/testsuite/g++.dg/compat/compat.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -35,25 +35,7 @@ global ld_library_path
# Load procedures from common libraries.
load_lib standard.exp
load_lib g++.exp
-
-#
-# compat-fix-library-path -- switch LD_LIBRARY_PATH
-#
-proc compat-fix-library-path { } {
- global ld_library_path
-
- # See comments in lib/g++.exp for why this is needed.
- if {![is_remote target]} {
- # See comments in lib/g++.exp for why this is needed.
- setenv LD_LIBRARY_PATH $ld_library_path
- setenv SHLIB_PATH $ld_library_path
- setenv LD_LIBRARYN32_PATH $ld_library_path
- setenv LD_LIBRARY64_PATH $ld_library_path
- setenv LD_LIBRARY_PATH_32 $ld_library_path
- setenv LD_LIBRARY_PATH_64 $ld_library_path
- setenv DYLD_LIBRARY_PATH $ld_library_path
- }
-}
+load_lib target-libpath.exp
#
# compat-use-alt-compiler -- make the alternate compiler the default
@@ -72,7 +54,7 @@ proc compat-use-alt-compiler { } {
set CXXFLAGS ""
set ALWAYS_CXXFLAGS ""
set ld_library_path $alt_ld_library_path
- compat-fix-library-path
+ set_ld_library_path_env_vars
}
}
@@ -94,7 +76,7 @@ proc compat-use-tst-compiler { } {
set CXXFLAGS $save_cxxflags
set ALWAYS_CXXFLAGS $save_always_cxxflags
set ld_library_path $save_ld_library_path
- compat-fix-library-path
+ set_ld_library_path_env_vars
}
}
diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
index d591238..19c0683 100644
--- a/gcc/testsuite/lib/g++.exp
+++ b/gcc/testsuite/lib/g++.exp
@@ -24,6 +24,7 @@
#
load_lib prune.exp
load_lib gcc-defs.exp
+load_lib target-libpath.exp
#
# GXX_UNDER_TEST is the compiler under test.
@@ -166,36 +167,7 @@ proc g++_link_flags { paths } {
}
}
- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
- # (for the 64-bit ABI). The right way to do this would be to modify
- # unix.exp -- but that's not an option since it's part of DejaGNU
- # proper, so we do it here.
- # The same applies to Darwin (DYLD_LIBRARY_PATH), Solaris 32 bit
- # (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64), and HP-UX
- # (SHLIB_PATH).
- # Doing this does cause trouble when testing cross-compilers.
- if {![is_remote target]} {
- global env;
- if [info exists env(LD_LIBRARY_PATH)] {
- # If we've already added these directories once, keep the
- # existing path.
- if {$ld_library_path == $env(LD_LIBRARY_PATH)
- || [string first $ld_library_path: \
- $env(LD_LIBRARY_PATH)] == 0} {
- set ld_library_path $env(LD_LIBRARY_PATH)
- } elseif { $env(LD_LIBRARY_PATH) != "" } {
- append ld_library_path ":$env(LD_LIBRARY_PATH)"
- }
- }
- setenv LD_LIBRARY_PATH $ld_library_path
- setenv SHLIB_PATH $ld_library_path
- setenv LD_LIBRARYN32_PATH $ld_library_path
- setenv LD_LIBRARY64_PATH $ld_library_path
- setenv LD_LIBRARY_PATH_32 $ld_library_path
- setenv LD_LIBRARY_PATH_64 $ld_library_path
- setenv DYLD_LIBRARY_PATH $ld_library_path
- }
+ set_ld_library_path_env_vars
return "$flags"
}
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 1244462..92de9f7 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 1999, 2000, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@ load_lib scanasm.exp
load_lib scantree.exp
load_lib prune.exp
load_lib libgloss.exp
+load_lib target-libpath.exp
# We set LC_ALL and LANG to C so that we get the same error messages as expected.
setenv LC_ALL C
@@ -51,55 +52,28 @@ if ![info exists GCC_UNDER_TEST] {
}
global rootme
-set libgcc_s_path "${rootme}"
-set compiler [lindex $GCC_UNDER_TEST 0]
-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 ${rootme}/${mldir}/libgcc_s*.so.*]] >= 1 } {
- append libgcc_s_path ":${rootme}/${mldir}"
+global ld_library_path
+global orig_environment_saved
+
+# This file may be sourced, so don't override environment settings
+# that have been previously setup.
+if { $orig_environment_saved == 0 } {
+ set ld_library_path "${rootme}"
+ set compiler [lindex $GCC_UNDER_TEST 0]
+ 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 ${rootme}/${mldir}/libgcc_s*.so.*]] >= 1 } {
+ append ld_library_path ":${rootme}/${mldir}"
+ }
}
}
-}
-
-# On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
-# called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
-# (for the 64-bit ABI). The right way to do this would be to modify
-# unix.exp -- but that's not an option since it's part of DejaGNU
-# proper, so we do it here. We really only need to do
-# this on IRIX, but it shouldn't hurt to do it anywhere else.
-# Doing this does cause trouble when testing cross-compilers.
-if {![is_remote target]} {
- if [info exists env(LD_LIBRARY_PATH)] {
- setenv LD_LIBRARY_PATH "$libgcc_s_path:$env(LD_LIBRARY_PATH)"
- } else {
- setenv LD_LIBRARY_PATH $libgcc_s_path
- }
- if [info exists env(SHLIB_PATH)] {
- setenv SHLIB_PATH "$libgcc_s_path:$env(SHLIB_PATH)"
- } else {
- setenv SHLIB_PATH $libgcc_s_path
- }
- if [info exists env(LD_LIBRARYN32_PATH)] {
- setenv LD_LIBRARYN32_PATH "$libgcc_s_path:$env(LD_LIBRARYN32_PATH)"
- } else {
- setenv LD_LIBRARYN32_PATH $libgcc_s_path
- }
- if [info exists env(LD_LIBRARY64_PATH)] {
- setenv LD_LIBRARY64_PATH "$libgcc_s_path:$env(LD_LIBRARY64_PATH)"
- } else {
- setenv LD_LIBRARY64_PATH $libgcc_s_path
- }
- if [info exists env(DYLD_LIBRARY_PATH)] {
- setenv DYLD_LIBRARY_PATH "$libgcc_s_path:$env(DYLD_LIBRARY_PATH)"
- } else {
- setenv DYLD_LIBRARY_PATH $libgcc_s_path
- }
+ set_ld_library_path_env_vars
}
# Split TORTURE_OPTIONS into two choices: one for testcases with loops and
diff --git a/gcc/testsuite/lib/gfortran.exp b/gcc/testsuite/lib/gfortran.exp
index 1207d2b..95af06a 100644
--- a/gcc/testsuite/lib/gfortran.exp
+++ b/gcc/testsuite/lib/gfortran.exp
@@ -24,6 +24,7 @@
#
load_lib prune.exp
load_lib gcc-defs.exp
+load_lib target-libpath.exp
#
# GFORTRAN_UNDER_TEST is the compiler under test.
@@ -110,36 +111,7 @@ proc gfortran_link_flags { paths } {
}
}
- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
- # (for the 64-bit ABI). The right way to do this would be to modify
- # unix.exp -- but that's not an option since it's part of DejaGNU
- # proper, so we do it here.
- # The same applies to Darwin (DYLD_LIBRARY_PATH), Solaris 32 bit
- # (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64), and HP-UX
- # (SHLIB_PATH).
- # Doing this does cause trouble when testing cross-compilers.
- if {![is_remote target]} {
- global env;
- if [info exists env(LD_LIBRARY_PATH)] {
- # If we've already added these directories once, keep the
- # existing path.
- if {$ld_library_path == $env(LD_LIBRARY_PATH)
- || [string first $ld_library_path: \
- $env(LD_LIBRARY_PATH)] == 0} {
- set ld_library_path $env(LD_LIBRARY_PATH)
- } elseif { $env(LD_LIBRARY_PATH) != "" } {
- append ld_library_path ":$env(LD_LIBRARY_PATH)"
- }
- }
- setenv LD_LIBRARY_PATH $ld_library_path
- setenv SHLIB_PATH $ld_library_path
- setenv LD_LIBRARYN32_PATH $ld_library_path
- setenv LD_LIBRARY64_PATH $ld_library_path
- setenv LD_LIBRARY_PATH_32 $ld_library_path
- setenv LD_LIBRARY_PATH_64 $ld_library_path
- setenv DYLD_LIBRARY_PATH $ld_library_path
- }
+ set_ld_library_path_env_vars
return "$flags"
}
diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp
index 6cba354..c9e6161 100644
--- a/gcc/testsuite/lib/objc.exp
+++ b/gcc/testsuite/lib/objc.exp
@@ -28,6 +28,7 @@
load_lib libgloss.exp
load_lib prune.exp
load_lib gcc-defs.exp
+load_lib target-libpath.exp
#
# OBJC_UNDER_TEST is the compiler under test.
@@ -187,21 +188,7 @@ proc objc_target_compile { source dest type options } {
}
lappend options "compiler=$OBJC_UNDER_TEST"
- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
- # (for the 64-bit ABI). The right way to do this would be to modify
- # unix.exp -- but that's not an option since it's part of DejaGNU
- # proper, so we do it here.
- # The same applies to Darwin (DYLD_LIBRARY_PATH), Solaris 32 bit
- # (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64), and HP-UX
- # (SHLIB_PATH).
- setenv LD_LIBRARY_PATH $ld_library_path
- setenv SHLIB_PATH $ld_library_path
- setenv LD_LIBRARYN32_PATH $ld_library_path
- setenv LD_LIBRARY64_PATH $ld_library_path
- setenv LD_LIBRARY_PATH_32 $ld_library_path
- setenv LD_LIBRARY_PATH_64 $ld_library_path
- setenv DYLD_LIBRARY_PATH $ld_library_path
+ set_ld_library_path_env_vars
return [target_compile $source $dest $type $options]
}
diff --git a/gcc/testsuite/lib/target-libpath.exp b/gcc/testsuite/lib/target-libpath.exp
new file mode 100644
index 0000000..48090e85
--- /dev/null
+++ b/gcc/testsuite/lib/target-libpath.exp
@@ -0,0 +1,236 @@
+# Copyright (C) 2004 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was contributed by John David Anglin (dave.anglin@nrc-cnrc.gc.ca)
+
+set orig_environment_saved 0
+set orig_ld_run_path_saved 0
+set orig_shlib_path_saved 0
+set orig_ld_libraryn32_path_saved 0
+set orig_ld_library64_path_saved 0
+set orig_ld_library_path_32_saved 0
+set orig_ld_library_path_64_saved 0
+set orig_dyld_library_path_saved 0
+
+
+#######################################
+# proc set_ld_library_path_env_vars { }
+#######################################
+
+proc set_ld_library_path_env_vars { } {
+ global ld_library_path
+ global orig_environment_saved
+ global orig_ld_library_path_saved
+ global orig_ld_run_path_saved
+ global orig_shlib_path_saved
+ global orig_ld_libraryn32_path_saved
+ global orig_ld_library64_path_saved
+ global orig_ld_library_path_32_saved
+ global orig_ld_library_path_64_saved
+ global orig_dyld_library_path_saved
+ global orig_ld_library_path
+ global orig_ld_run_path
+ global orig_shlib_path
+ global orig_ld_libraryn32_path
+ global orig_ld_library64_path
+ global orig_ld_library_path_32
+ global orig_ld_library_path_64
+ global orig_dyld_library_path
+
+ # Setting the ld library path causes trouble when testing cross-compilers.
+ if { [is_remote target] } {
+ return
+ }
+
+ if { $orig_environment_saved == 0 } {
+ global env;
+
+ set orig_environment_saved 1
+
+ # Save the original environment.
+ if [info exists env(LD_LIBRARY_PATH)] {
+ set orig_ld_library_path "$env(LD_LIBRARY_PATH)"
+ set orig_ld_library_path_saved 1
+ }
+ if [info exists env(LD_RUN_PATH)] {
+ set orig_ld_run_path "$env(LD_RUN_PATH)"
+ set orig_ld_run_path_saved 1
+ }
+ if [info exists env(SHLIB_PATH)] {
+ set orig_shlib_path "$env(SHLIB_PATH)"
+ set orig_shlib_path_saved 1
+ }
+ if [info exists env(LD_LIBRARYN32_PATH)] {
+ set orig_ld_libraryn32_path "$env(LD_LIBRARYN32_PATH)"
+ set orig_ld_libraryn32_path_saved 1
+ }
+ if [info exists env(LD_LIBRARY64_PATH)] {
+ set orig_ld_library64_path "$env(LD_LIBRARY64_PATH)"
+ set orig_ld_library64_path_saved 1
+ }
+ if [info exists env(LD_LIBRARY_PATH_32)] {
+ set orig_ld_library_path_32 "$env(LD_LIBRARY_PATH_32)"
+ set orig_ld_library_path_32_saved 1
+ }
+ if [info exists env(LD_LIBRARY_PATH_64)] {
+ set orig_ld_library_path_64 "$env(LD_LIBRARY_PATH_64)"
+ set orig_ld_library_path_64_saved 1
+ }
+ if [info exists env(DYLD_LIBRARY_PATH)] {
+ set orig_dyld_library_path "$env(DYLD_LIBRARY_PATH)"
+ set orig_dyld_library_path_saved 1
+ }
+ }
+
+ # We need to set ld library path in the environment. Currently,
+ # unix.exp doesn't set the environment correctly for all systems.
+ # It only sets SHLIB_PATH and LD_LIBRARY_PATH when it executes a
+ # program. We also need the environment set for compilations, etc.
+ #
+ # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
+ # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
+ # (for the 64-bit ABI). The same applies to Darwin (DYLD_LIBRARY_PATH),
+ # Solaris 32 bit (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64),
+ # and HP-UX (SHLIB_PATH). In some cases, the variables are independent
+ # of LD_LIBRARY_PATH, and in other cases LD_LIBRARY_PATH is used if the
+ # variable is not defined.
+ #
+ # Doing this is somewhat of a hack as ld_library_path gets repeated in
+ # SHLIB_PATH and LD_LIBRARY_PATH when unix_load sets these variables.
+ if { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY_PATH "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARY_PATH "$ld_library_path"
+ }
+ if { $orig_ld_run_path_saved } {
+ setenv LD_RUN_PATH "$ld_library_path:$orig_ld_run_path"
+ } else {
+ setenv LD_RUN_PATH "$ld_library_path"
+ }
+ # The default shared library dynamic path search for 64-bit
+ # HP-UX executables searches LD_LIBRARY_PATH before SHLIB_PATH.
+ # LD_LIBRARY_PATH isn't used for 32-bit executables. Thus, we
+ # set LD_LIBRARY_PATH and SHLIB_PATH as if they were independent.
+ if { $orig_shlib_path_saved } {
+ setenv SHLIB_PATH "$ld_library_path:$orig_shlib_path"
+ } else {
+ setenv SHLIB_PATH "$ld_library_path"
+ }
+ if { $orig_ld_libraryn32_path_saved } {
+ setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_libraryn32_path"
+ } elseif { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARYN32_PATH "$ld_library_path"
+ }
+ if { $orig_ld_library64_path_saved } {
+ setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library64_path"
+ } elseif { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARY64_PATH "$ld_library_path"
+ }
+ if { $orig_ld_library_path_32_saved } {
+ setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path_32"
+ } elseif { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARY_PATH_32 "$ld_library_path"
+ }
+ if { $orig_ld_library_path_64_saved } {
+ setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path_64"
+ } elseif { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path"
+ } else {
+ setenv LD_LIBRARY_PATH_64 "$ld_library_path"
+ }
+ if { $orig_dyld_library_path_saved } {
+ setenv DYLD_LIBRARY_PATH "$ld_library_path:$orig_dyld_library_path"
+ } else {
+ setenv DYLD_LIBRARY_PATH "$ld_library_path"
+ }
+
+ verbose -log "set_ld_library_path_env_vars: ld_library_path=$ld_library_path"
+}
+
+#######################################
+# proc restore_ld_library_path_env_vars { }
+#######################################
+
+proc restore_ld_library_path_env_vars { } {
+ global orig_environment_saved
+ global orig_ld_library_path_saved
+ global orig_ld_run_path_saved
+ global orig_shlib_path_saved
+ global orig_ld_libraryn32_path_saved
+ global orig_ld_library64_path_saved
+ global orig_ld_library_path_32_saved
+ global orig_ld_library_path_64_saved
+ global orig_dyld_library_path_saved
+ global orig_ld_library_path
+ global orig_ld_run_path
+ global orig_shlib_path
+ global orig_ld_libraryn32_path
+ global orig_ld_library64_path
+ global orig_ld_library_path_32
+ global orig_ld_library_path_64
+ global orig_dyld_library_path
+
+ if { $orig_environment_saved == 0 } {
+ return
+ }
+
+ if { $orig_ld_library_path_saved } {
+ setenv LD_LIBRARY_PATH "$orig_ld_library_path"
+ } else {
+ unsetenv LD_LIBRARY_PATH
+ }
+ if { $orig_ld_run_path_saved } {
+ setenv LD_RUN_PATH "$orig_ld_run_path"
+ } else {
+ unsetenv LD_RUN_PATH
+ }
+ if { $orig_shlib_path_saved } {
+ setenv SHLIB_PATH "$orig_shlib_path"
+ } else {
+ unsetenv SHLIB_PATH
+ }
+ if { $orig_ld_libraryn32_path_saved } {
+ setenv LD_LIBRARYN32_PATH "$orig_ld_libraryn32_path"
+ } else {
+ unsetenv LD_LIBRARYN32_PATH
+ }
+ if { $orig_ld_library64_path_saved } {
+ setenv LD_LIBRARY64_PATH "$orig_ld_library64_path"
+ } else {
+ unsetenv LD_LIBRARY64_PATH
+ }
+ if { $orig_ld_library_path_32_saved } {
+ setenv LD_LIBRARY_PATH_32 "$orig_ld_library_path_32"
+ } else {
+ unsetenv LD_LIBRARY_PATH_32
+ }
+ if { $orig_ld_library_path_64_saved } {
+ setenv LD_LIBRARY_PATH_64 "$orig_ld_library_path_64"
+ } else {
+ unsetenv LD_LIBRARY_PATH_64
+ }
+ if { $orig_dyld_library_path_saved } {
+ setenv DYLD_LIBRARY_PATH "$orig_dyld_library_path"
+ } else {
+ unsetenv DYLD_LIBRARY_PATH
+ }
+}
diff --git a/gcc/testsuite/lib/treelang.exp b/gcc/testsuite/lib/treelang.exp
index 6d37773..5f6c1c8 100644
--- a/gcc/testsuite/lib/treelang.exp
+++ b/gcc/testsuite/lib/treelang.exp
@@ -33,6 +33,7 @@
load_lib libgloss.exp
load_lib prune.exp
load_lib gcc-defs.exp
+load_lib target-libpath.exp
#
# TREELANG_UNDER_TEST is the compiler under test.
@@ -141,6 +142,7 @@ proc treelang_target_compile { source dest type options } {
global treelang_libgcc_s_path
set ld_library_path ".:${treelang_libgcc_s_path}"
+ set_ld_library_path_env_vars
lappend options "libs=-ltreelang"
if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {