This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Dejagnu and parallel make tests of gcc


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.


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 ""
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];

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]