From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19907 invoked by alias); 24 Sep 2002 15:50:18 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19884 invoked from network); 24 Sep 2002 15:50:15 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 24 Sep 2002 15:50:15 -0000 Received: by fw-cam.cambridge.arm.com; id QAA15646; Tue, 24 Sep 2002 16:50:10 +0100 (BST) Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma015153; Tue, 24 Sep 02 16:49:47 +0100 Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [172.16.202.26]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id QAA28714; Tue, 24 Sep 2002 16:49:46 +0100 (BST) Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id g8OFnkE14794; Tue, 24 Sep 2002 16:49:46 +0100 Message-Id: <200209241549.g8OFnkE14794@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com cc: Richard.Earnshaw@arm.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. Subject: Dejagnu and parallel make tests of gcc Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_6544104840" Date: Tue, 24 Sep 2002 08:50:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-09/txt/msg00581.txt.bz2 This is a multipart MIME message. --==_Exmh_6544104840 Content-Type: text/plain; charset=us-ascii Content-length: 2123 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 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: Richard Earnshaw * 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: Richard Earnshaw * lib/libgloss.exp (build_wrapper): Use a tool-specific filename on the host for the testglue. --==_Exmh_6544104840 Content-Type: text/x-patch ; name="libgloss.patch"; charset=us-ascii Content-Description: libgloss.patch Content-Disposition: attachment; filename="libgloss.patch" Content-length: 1198 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 "" --==_Exmh_6544104840 Content-Type: text/x-patch ; name="dejagnu.patch"; charset=us-ascii Content-Description: dejagnu.patch Content-Disposition: attachment; filename="dejagnu.patch" Content-length: 3310 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]; --==_Exmh_6544104840--