From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10618 invoked by alias); 30 Jul 2007 23:04:06 -0000 Received: (qmail 10609 invoked by uid 22791); 30 Jul 2007 23:04:05 -0000 X-Spam-Check-By: sourceware.org Received: from rwcrmhc13.comcast.net (HELO rwcrmhc13.comcast.net) (216.148.227.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 30 Jul 2007 23:04:02 +0000 Received: from lucon.org ([24.6.230.138]) by comcast.net (rwcrmhc13) with ESMTP id <20070730230359m13006qfpke>; Mon, 30 Jul 2007 23:04:00 +0000 Received: by lucon.org (Postfix, from userid 500) id 98996F7F57; Mon, 30 Jul 2007 16:03:59 -0700 (PDT) Date: Tue, 31 Jul 2007 00:46:00 -0000 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: PATCH: PR testsuite/32932: ssp tests can't find libssp Message-ID: <20070730230359.GA13062@lucon.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.14 (2007-02-12) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg02153.txt.bz2 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 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" + } + } +}