+2005-05-02 Mark Mitchell <mark@codesourcery.com>
+
+ Backport:
+ 2005-03-25 Mark Mitchell <mark@codesourcery.com>
+ * lib/g++.exp (g++_link_flags): Use gcc-set-multilib-library-path.
+ (g++_init): Make sure that CXXFLAGS is set.
+ * lib/gcc-defs.exp (gcc-set-multilib-library-path): New function.
+ * lib/objc.exp (objc_init): Likewise.
+ 2004-11-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+ * lib/target-libpath.exp (restore_ld_library_path_env_vars):
+ Check existence of ld library path variables before unsetting.
+ 2004-11-24 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+ * lib/target-libpath.exp (orig_ld_library_path_saved): Add missing set.
+ 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/objc.exp: Use new procs.
+
2005-05-02 Mark Mitchell <mark@codesourcery.com>
PR c++/15875
# 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
- }
-}
+load_lib target-libpath.exp
#
# compat-use-alt-compiler -- make the alternate compiler the default
set CXXFLAGS ""
set ALWAYS_CXXFLAGS ""
set ld_library_path $alt_ld_library_path
- compat-fix-library-path
+ set_ld_library_path_env_vars
}
}
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
}
}
#
load_lib prune.exp
load_lib gcc-defs.exp
+load_lib target-libpath.exp
#
# GXX_UNDER_TEST is the compiler under test.
#
proc g++_link_flags { paths } {
- global rootme
global srcdir
global ld_library_path
global GXX_UNDER_TEST
if [file exists "${gccpath}/librx/librx.a"] {
append flags "-L${gccpath}/librx "
}
- append ld_library_path ":${rootme}"
- set compiler [lindex $GXX_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}"
- }
- }
- }
+ append ld_library_path [gcc-set-multilib-library-path $GXX_UNDER_TEST]
} else {
global tool_root_dir;
}
}
- # 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]} {
- 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 DYLD_LIBRARY_PATH $ld_library_path
- }
+ set_ld_library_path_env_vars
return "$flags"
}
global gluefile wrap_flags;
global objdir srcdir
global ALWAYS_CXXFLAGS
+ global CXXFLAGS
global TOOL_EXECUTABLE TOOL_OPTIONS
global GXX_UNDER_TEST
global TESTING_IN_BUILD_TREE
}
}
+ if {![info exists CXXFLAGS]} {
+ set CXXFLAGS ""
+ }
+
set ALWAYS_CXXFLAGS ""
if ![is_remote host] {
return $options
}
+
+# Return a colon-separate list of directories to search for libraries
+# for COMPILER, including multilib directories.
+
+proc gcc-set-multilib-library-path { compiler } {
+ global rootme
+
+ # ??? rootme will not be set when testing an installed compiler.
+ # In that case, we should perhaps use some other method to find
+ # libraries.
+ if {![info exists rootme]} {
+ return ""
+ }
+
+ set libpath ":${rootme}"
+ set compiler [lindex $compiler 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 libpath ":${rootme}/${mldir}"
+ }
+ }
+ }
+
+ return $libpath
+}
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.
set objc_initialized 0
proc objc_init { args } {
- global rootme
global tmpdir
global libdir
global gluefile wrap_flags
}
}
- set objc_libgcc_s_path "${rootme}"
- set compiler [lindex $OBJC_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 objc_libgcc_s_path ":${rootme}/${mldir}"
- }
- }
- }
+ append objc_libgcc_s_path [gcc-set-multilib-library-path $OBJC_UNDER_TEST]
}
proc objc_target_compile { source dest type options } {
- global rootme;
global tmpdir;
global gluefile wrap_flags;
global srcdir
}
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. We really only need to do
- # this on IRIX, but it shouldn't hurt to do it anywhere else.
- 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 DYLD_LIBRARY_PATH $ld_library_path
+ set_ld_library_path_env_vars
return [target_compile $source $dest $type $options]
}
}
if { $orig_environment_saved == 0 } {
- global env
+ global env;
set orig_environment_saved 1