]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: g++.exp (g++_link_flags): Use gcc-set-multilib-library-path.
authorMark Mitchell <mark@codesourcery.com>
Mon, 2 May 2005 23:32:41 +0000 (23:32 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 2 May 2005 23:32:41 +0000 (23:32 +0000)
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.

From-SVN: r99128

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/compat/compat.exp
gcc/testsuite/lib/g++.exp
gcc/testsuite/lib/gcc-defs.exp
gcc/testsuite/lib/objc.exp
gcc/testsuite/lib/target-libpath.exp

index 67b991b9a4b48579bc6de4c84aaeec17ee5860a1..f0e819fb7b520d8474cb20bfc9bf2e5c8f72a8a2 100644 (file)
@@ -1,3 +1,21 @@
+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
index 94da38c77de764b3741025b455919b51427e0423..accd1452d7dc7972e6ead3698963e008175686df 100644 (file)
@@ -35,22 +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
-    }
-}
+load_lib target-libpath.exp
 
 #
 # compat-use-alt-compiler -- make the alternate compiler the default
@@ -69,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
     }
 }
 
@@ -91,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
     }
 }
 
index 0b5681b134b42047b0b43a5d78cc192981773054..8a6e3a0b55b9869c0de4878247c570a08b4001cd 100644 (file)
@@ -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.
@@ -96,7 +97,6 @@ proc g++_include_flags { paths } {
 #
 
 proc g++_link_flags { paths } {
-    global rootme
     global srcdir
     global ld_library_path
     global GXX_UNDER_TEST
@@ -128,21 +128,7 @@ proc g++_link_flags { paths } {
       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;
 
@@ -166,20 +152,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.  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"
 }
@@ -197,6 +170,7 @@ proc g++_init { args } {
     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
@@ -244,6 +218,10 @@ proc g++_init { args } {
        }
     }
 
+    if {![info exists CXXFLAGS]} {
+       set CXXFLAGS ""
+    }
+
     set ALWAYS_CXXFLAGS ""
 
     if ![is_remote host] {
index bb2369c21100b3e9a21b2a5198b5df1f7cdaaafd..b19e2788fd35ee02be3e512d4e74e9e87060d7df 100644 (file)
@@ -217,3 +217,35 @@ proc dg-additional-files-options { options source } {
 
     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
+}
index 2819660df3801be33fed7b9ac1c48b8c447be1d0..b0f910430ddca551740b0bd074a41ac24d6b8faf 100644 (file)
@@ -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.
@@ -85,7 +86,6 @@ proc objc_version { } {
 set objc_initialized 0
 
 proc objc_init { args } {
-    global rootme
     global tmpdir
     global libdir
     global gluefile wrap_flags
@@ -118,25 +118,10 @@ proc objc_init { args } {
        }
     }
 
-    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
@@ -184,17 +169,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.  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]
 }
index e8cf4630e16c53df67ff798c10fdabd7c61222f7..8635e7e3453af421386d6714a0b0348835ad5bfa 100644 (file)
@@ -57,7 +57,7 @@ proc set_ld_library_path_env_vars { } {
   }
 
   if { $orig_environment_saved == 0 } {
-    global env
+    global env;
 
     set orig_environment_saved 1