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]

PATCH: PR testsuite/32932: ssp tests can't find libssp


This patch makes sure that the newly built libssp is used for
test. Tested on Linux/x86-64.


H.J.
----
2007-07-30  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/32932
	* lib/gcc-dg.exp: Append libssp_ld_library_path to
	ld_library_path.

	* lib/gcc.exp: Load libssp.exp.
	(gcc_init): Call libssp_init and set gcc_initialized to 1.
	(gcc_target_compile): Append libssp_flags to options.

	* lib/libssp.exp: New file.

--- gcc/testsuite/lib/gcc-dg.exp.ssp	2007-07-26 21:32:14.000000000 -0700
+++ gcc/testsuite/lib/gcc-dg.exp	2007-07-30 15:06:24.000000000 -0700
@@ -60,7 +60,9 @@ 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 } {
+    global libssp_ld_library_path
     append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
+    append ld_library_path ":$libssp_ld_library_path"
     set_ld_library_path_env_vars
 }
 
--- gcc/testsuite/lib/gcc.exp.ssp	2007-07-13 07:12:23.000000000 -0700
+++ gcc/testsuite/lib/gcc.exp	2007-07-30 14:59:43.000000000 -0700
@@ -28,6 +28,7 @@
 load_lib libgloss.exp
 load_lib prune.exp
 load_lib gcc-defs.exp
+load_lib libssp.exp
 
 #
 # GCC_UNDER_TEST is the compiler under test.
@@ -113,6 +114,10 @@ proc gcc_init { args } {
     set gcc_error_prefix "error:"
 
     gcc_maybe_build_wrapper "${tmpdir}/gcc-testglue.o"
+
+    libssp_init [get_multilibs]
+
+    set gcc_initialized 1
 }
 
 #
@@ -124,6 +129,7 @@ proc gcc_target_compile { source dest ty
     global gluefile wrap_flags
     global GCC_UNDER_TEST
     global TOOL_OPTIONS
+    global libssp_flags
 	
     if {[target_info needs_status_wrapper] != "" && \
 	    [target_info needs_status_wrapper] != "0" && \
@@ -150,6 +156,7 @@ proc gcc_target_compile { source dest ty
 	lappend options "timeout=[target_info gcc,timeout]"
     }
     lappend options "additional_flags=-fno-show-column"
+    lappend options "additional_flags=$libssp_flags"
     lappend options "compiler=$GCC_UNDER_TEST"
     set options [dg-additional-files-options $options $source]
     return [target_compile $source $dest $type $options]
--- gcc/testsuite/lib/libssp.exp.ssp	2007-07-30 14:23:41.000000000 -0700
+++ gcc/testsuite/lib/libssp.exp	2007-07-30 15:01:06.000000000 -0700
@@ -0,0 +1,39 @@
+# Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+#
+# libssp_init -- initialize libssp_flags and libssp_ld_library_path.
+# 
+#
+
+proc libssp_init { paths } {
+    global libssp_flags
+    global libssp_ld_library_path
+
+    set gccpath ${paths}
+    set libssp_flags ""
+    set libssp_ld_library_path "."
+
+    if { $gccpath != "" } {
+      if [file exists "${gccpath}/lib/libssp.a"] {
+          append libssp_ld_library_path ":${gccpath}/lib"
+      }
+      if [file exists "${gccpath}/libssp/.libs/libssp.la"] {
+          set libssp_flags "-L${gccpath}/libssp/.libs"
+          append libssp_ld_library_path ":${gccpath}/libssp/.libs"
+      }
+    }
+}


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