From: Richard Earnshaw <rearnsha@arm.com>
To: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com
Cc: Richard.Earnshaw@arm.com
Subject: Dejagnu and parallel make tests of gcc
Date: Tue, 24 Sep 2002 08:50:00 -0000 [thread overview]
Message-ID: <200209241549.g8OFnkE14794@pc960.cambridge.arm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2123 bytes --]
Ok, first question. Is the copy of dejagnu on sources.redhat.com (the one
in gdb) the master copy these days, or is there some other mailing list
for dejagnu framework patches?
I've finally worked out what the problems were with running parallel makes
for testing gcc and with the patches below I can now run
gnumake -k -j <some-big-number> check
from the top level and get all the testsuites to run in parallel on a
cross build.
The problem was the pesky testglue.o file that is used to wrap executables
that are run on the simulator, or other non-native targets. This file is
built by each of check-gcc check-g++ check-objc etc and then removed when
that check is complete.
On a sequential make that isn't a problem because the next make simply
rebuilds the file, but on a parallel make it means that the file gets
removed before some of the tests have finished running. Unfortunately
because of the convoluted cross-build configurations that we need to
support the fix involves changes to both gcc/testsuite/lib and
dejagnu/lib. Fortunately each patch can be applied independently without
affecting or requiring the other. However, for parallel checks of cross
targets you do need both.
The first patch is to the gcc testsuite and ensures that if the gcc, g++
etc test packages all try to build testglue.c together then there will not
be a race condition where they build the same object on top of each other.
The second patch is to the dejagnu framework itself and ensures that when
we transfer the object to the (potentially remote) host we use a filename
that will not conflict with any other -- in this case I've chosen
${tool}_tg.o, which should be fairly safe.
gcc/testsuite:
<date> Richard Earnshaw <rearnsha@arm.com>
* lib/gcc.exp (gcc_init): Use a filename for the testglue that is
unique to the tool.
* lib/g77.exp (g77_init): Likewise.
* lib/g++.exp (g++_init): Likewise.
* lib/objc.exp (objc_init): Likewise.
dejagnu:
<date> Richard Earnshaw <rearnsha@arm.com>
* lib/libgloss.exp (build_wrapper): Use a tool-specific filename on
the host for the testglue.
[-- Attachment #2: libgloss.patch --]
[-- Type: text/x-patch , Size: 1198 bytes --]
Index: libgloss.exp
===================================================================
RCS file: /cvs/src/src/dejagnu/lib/libgloss.exp,v
retrieving revision 1.8
diff -p -r1.8 libgloss.exp
*** libgloss.exp 21 Apr 2002 08:47:07 -0000 1.8
--- libgloss.exp 24 Sep 2002 15:47:35 -0000
*************** proc find_ld { } {
*** 812,817 ****
--- 812,818 ----
proc build_wrapper { gluefile } {
global libdir
+ global tool
if [target_info exists wrap_m68k_aout] {
set flags "additional_flags=-DWRAP_M68K_AOUT";
*************** proc build_wrapper { gluefile } {
*** 832,838 ****
lappend flags "additional_flags=[target_info wrap_compile_flags]";
}
if { [target_compile ${libdir}/testglue.c ${gluefile} object $flags] == "" } {
! set gluefile [remote_download host ${gluefile} testglue.o];
return [list $gluefile $result];
} else {
return ""
--- 833,839 ----
lappend flags "additional_flags=[target_info wrap_compile_flags]";
}
if { [target_compile ${libdir}/testglue.c ${gluefile} object $flags] == "" } {
! set gluefile [remote_download host ${gluefile} ${tool}_tg.o];
return [list $gluefile $result];
} else {
return ""
[-- Attachment #3: dejagnu.patch --]
[-- Type: text/x-patch , Size: 3310 bytes --]
Index: g++.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/g++.exp,v
retrieving revision 1.26
diff -p -r1.26 g++.exp
*** g++.exp 9 May 2002 21:01:53 -0000 1.26
--- g++.exp 24 Sep 2002 15:43:16 -0000
*************** proc g++_init { args } {
*** 239,245 ****
}
if { [target_info needs_status_wrapper] != "" } {
! set gluefile ${tmpdir}/testglue.o;
set result [build_wrapper $gluefile];
if { $result != "" } {
set gluefile [lindex $result 0];
--- 239,245 ----
}
if { [target_info needs_status_wrapper] != "" } {
! set gluefile ${tmpdir}/g++-testglue.o;
set result [build_wrapper $gluefile];
if { $result != "" } {
set gluefile [lindex $result 0];
Index: g77.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/g77.exp,v
retrieving revision 1.14
diff -p -r1.14 g77.exp
*** g77.exp 9 May 2002 21:01:53 -0000 1.14
--- g77.exp 24 Sep 2002 15:43:16 -0000
*************** proc g77_init { args } {
*** 168,174 ****
}
if { [target_info needs_status_wrapper] != "" } {
! set gluefile ${tmpdir}/testglue.o;
set result [build_wrapper $gluefile];
if { $result != "" } {
set gluefile [lindex $result 0];
--- 168,174 ----
}
if { [target_info needs_status_wrapper] != "" } {
! set gluefile ${tmpdir}/g77-testglue.o;
set result [build_wrapper $gluefile];
if { $result != "" } {
set gluefile [lindex $result 0];
Index: gcc.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/gcc.exp,v
retrieving revision 1.9
diff -p -r1.9 gcc.exp
*** gcc.exp 16 Jul 2002 02:16:47 -0000 1.9
--- gcc.exp 24 Sep 2002 15:43:16 -0000
*************** proc gcc_init { args } {
*** 109,115 ****
if {[target_info needs_status_wrapper] != "" && \
[target_info needs_status_wrapper] != "0" && \
![info exists gluefile]} {
! set gluefile ${tmpdir}/testglue.o;
set result [build_wrapper $gluefile];
if { $result != "" } {
set gluefile [lindex $result 0];
--- 109,115 ----
if {[target_info needs_status_wrapper] != "" && \
[target_info needs_status_wrapper] != "0" && \
![info exists gluefile]} {
! set gluefile ${tmpdir}/gcc-testglue.o;
set result [build_wrapper $gluefile];
if { $result != "" } {
set gluefile [lindex $result 0];
Index: objc.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/objc.exp,v
retrieving revision 1.15
diff -p -r1.15 objc.exp
*** objc.exp 16 Jul 2002 02:16:47 -0000 1.15
--- objc.exp 24 Sep 2002 15:43:16 -0000
*************** proc objc_init { args } {
*** 108,114 ****
set tmpdir /tmp
}
if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } {
! set gluefile ${tmpdir}/testglue.o;
set result [build_wrapper $gluefile];
if { $result != "" } {
set gluefile [lindex $result 0];
--- 108,114 ----
set tmpdir /tmp
}
if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } {
! set gluefile ${tmpdir}/objc-testglue.o;
set result [build_wrapper $gluefile];
if { $result != "" } {
set gluefile [lindex $result 0];
next reply other threads:[~2002-09-24 15:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-24 8:50 Richard Earnshaw [this message]
2002-09-24 9:06 ` Andrew Cagney
2002-09-25 8:17 ` Jim Wilson
2002-09-26 18:57 ` Andrew Cagney
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=200209241549.g8OFnkE14794@pc960.cambridge.arm.com \
--to=rearnsha@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb-patches@sources.redhat.com \
/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