* PATCH: PR testsuite/32932: ssp tests can't find libssp
@ 2007-07-31 0:46 H.J. Lu
2007-07-31 17:53 ` Janis Johnson
0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2007-07-31 0:46 UTC (permalink / raw)
To: gcc-patches
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"
+ }
+ }
+}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: PR testsuite/32932: ssp tests can't find libssp
2007-07-31 0:46 PATCH: PR testsuite/32932: ssp tests can't find libssp H.J. Lu
@ 2007-07-31 17:53 ` Janis Johnson
2007-07-31 18:40 ` H.J. Lu
2007-07-31 18:45 ` PATCH: gcc/testsuite: Set gcc_initialized to 1 H.J. Lu
0 siblings, 2 replies; 5+ messages in thread
From: Janis Johnson @ 2007-07-31 17:53 UTC (permalink / raw)
To: H.J. Lu; +Cc: gcc-patches, echristo
On Mon, 2007-07-30 at 16:03 -0700, H.J. Lu wrote:
> This patch makes sure that the newly built libssp is used for
> test. Tested on Linux/x86-64.
The patch doesn't handle multilibs; apparently you didn't test
with both -m32 and -m64.
These tests really ought to be in libssp/testsuite, which doesn't
yet exist, and look for libraries in the same way as other library
testsuites. I've copied Eric Christopher, who added these tests,
to get his opinion about that.
Setting gcc_initialized doesn't belong in this patch, and should
be tested by running the full testsuite with multiple runs, e.g.
-m32 and -m64, to make sure there are no surprises.
Janis
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: PR testsuite/32932: ssp tests can't find libssp
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
1 sibling, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2007-07-31 18:40 UTC (permalink / raw)
To: Janis Johnson; +Cc: gcc-patches, echristo
On Tue, Jul 31, 2007 at 10:43:56AM -0700, Janis Johnson wrote:
> On Mon, 2007-07-30 at 16:03 -0700, H.J. Lu wrote:
> > This patch makes sure that the newly built libssp is used for
> > test. Tested on Linux/x86-64.
>
> The patch doesn't handle multilibs; apparently you didn't test
> with both -m32 and -m64.
It does support multilibs:
@@ -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
}
#
and I tested with -m32 on Linux/x86-64:
Executing on host: /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ /export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/ssp-1.c -fstack-protector -fno-show-column -L/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libssp/.libs
-lm -m32 -o ./ssp-1.exe (timeout = 300)
PASS: gcc.dg/ssp-1.c (test for excess errors)
Setting LD_LIBRARY_PATH to :/export/build/gnu/gcc/build-x86_64-linux/gcc:/export/build/gnu/gcc/build-x86_64-linux/gcc/32:.:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libssp/.libs::/export/build/gnu/gcc/build-x86_64-linux/gcc:/export/build/gnu/gcc/build-x86_64-linux/gcc/32:.:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libssp/.libs:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/libstdc++-v3/.libs:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/libmudflap/.libs:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/libssp/.libs:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/libgomp/.libs:/export/build/gnu/gcc/build-x86_64-linux/./gcc:/export/build/gnu/gcc/build-x86_64-linux/./prev-gcc
PASS: gcc.dg/ssp-1.c execution test
...
Executing on host: /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ /export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/ssp-1.c -fstack-protector -fno-show-column -L/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libssp/.libs
-lm -o ./ssp-1.exe (timeout = 300)
PASS: gcc.dg/ssp-1.c (test for excess errors)
Setting LD_LIBRARY_PATH to :/export/build/gnu/gcc/build-x86_64-linux/gcc:/export/build/gnu/gcc/build-x86_64-linux/gcc/32:.:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libssp/.libs::/export/build/gnu/gcc/build-x86_64-linux/gcc:/export/build/gnu/gcc/build-x86_64-linux/gcc/32:.:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libssp/.libs:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/libstdc++-v3/.libs:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/libmudflap/.libs:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/libssp/.libs:/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/libgomp/.libs:/export/build/gnu/gcc/build-x86_64-linux/./gcc:/export/build/gnu/gcc/build-x86_64-linux/./prev-gcc
PASS: gcc.dg/ssp-1.c execution test
>
> These tests really ought to be in libssp/testsuite, which doesn't
> yet exist, and look for libraries in the same way as other library
> testsuites. I've copied Eric Christopher, who added these tests,
> to get his opinion about that.
>
> Setting gcc_initialized doesn't belong in this patch, and should
> be tested by running the full testsuite with multiple runs, e.g.
> -m32 and -m64, to make sure there are no surprises.
Here is my result:
http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg01202.html
H.J.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PATCH: PR testsuite/32932: ssp tests can't find libssp
2007-07-31 18:40 ` H.J. Lu
@ 2007-07-31 21:31 ` Janis Johnson
0 siblings, 0 replies; 5+ messages in thread
From: Janis Johnson @ 2007-07-31 21:31 UTC (permalink / raw)
To: H.J. Lu; +Cc: gcc-patches, echristo
On Tue, 2007-07-31 at 11:20 -0700, H.J. Lu wrote:
> On Tue, Jul 31, 2007 at 10:43:56AM -0700, Janis Johnson wrote:
> > On Mon, 2007-07-30 at 16:03 -0700, H.J. Lu wrote:
> > > This patch makes sure that the newly built libssp is used for
> > > test. Tested on Linux/x86-64.
> >
> > The patch doesn't handle multilibs; apparently you didn't test
> > with both -m32 and -m64.
>
> It does support multilibs:
>
> @@ -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]
But libssp_init only processes the first one; see how they're
handled for libmudflap, for example, to add all of them to
LD_LIBRARY_PATH.
> and I tested with -m32 on Linux/x86-64:
>
> Executing on host: /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
> -B/export/build/gnu/gcc/build-x86_64-linux/gcc/
> /export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/ssp-1.c -fstack-protector -fno-show-column
> -L/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libssp/.libs
> -lm -m32 -o ./ssp-1.exe (timeout = 300)
This uses the 32-bit library for -m32, and adds it to LD_LIBRARY_PATH
> Executing on host: /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
> -B/export/build/gnu/gcc/build-x86_64-linux/gcc/
> /export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/ssp-1.c
> -fstack-protector -fno-show-column
> -L/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libssp/.libs
> -lm -o ./ssp-1.exe (timeout = 300)
This uses the 32-bit library for the default and adds the 32-bit
library to LD_LIBRARY_PATH.
Janis
^ permalink raw reply [flat|nested] 5+ messages in thread
* PATCH: gcc/testsuite: Set gcc_initialized to 1
2007-07-31 17:53 ` Janis Johnson
2007-07-31 18:40 ` H.J. Lu
@ 2007-07-31 18:45 ` H.J. Lu
1 sibling, 0 replies; 5+ messages in thread
From: H.J. Lu @ 2007-07-31 18:45 UTC (permalink / raw)
To: Janis Johnson; +Cc: gcc-patches, echristo
On Tue, Jul 31, 2007 at 10:43:56AM -0700, Janis Johnson wrote:
>
> Setting gcc_initialized doesn't belong in this patch, and should
> be tested by running the full testsuite with multiple runs, e.g.
> -m32 and -m64, to make sure there are no surprises.
>
Tested on Linux/x86-64 with RUNTESTFLAGS=--target_board 'unix{-m32,}'.
H.J.
----
2007-07-30 H.J. Lu <hongjiu.lu@intel.com>
* lib/gcc.exp: (gcc_init): Set gcc_initialized to 1.
--- 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
@@ -113,6 +114,8 @@ proc gcc_init { args } {
set gcc_error_prefix "error:"
gcc_maybe_build_wrapper "${tmpdir}/gcc-testglue.o"
+
+ set gcc_initialized 1
}
#
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-07-31 20:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-31 0:46 PATCH: PR testsuite/32932: ssp tests can't find libssp H.J. Lu
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
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).