From: "H.J. Lu" <hjl@lucon.org>
To: gcc-patches@gcc.gnu.org
Subject: PATCH: PR testsuite/32932: ssp tests can't find libssp
Date: Tue, 31 Jul 2007 00:46:00 -0000 [thread overview]
Message-ID: <20070730230359.GA13062@lucon.org> (raw)
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"
+ }
+ }
+}
next reply other threads:[~2007-07-30 23:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-31 0:46 H.J. Lu [this message]
2007-07-31 17:53 ` Janis Johnson
2007-07-31 18:40 ` H.J. Lu
2007-07-31 21:31 ` Janis Johnson
2007-07-31 18:45 ` PATCH: gcc/testsuite: Set gcc_initialized to 1 H.J. Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070730230359.GA13062@lucon.org \
--to=hjl@lucon.org \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).