This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[Ada] Fix testsuite infrastructure problems


Hi,

I recently ran into a couple of problems when trying to run the Ada testsuite 
on a Redhat 7.3 box.  The system compiler is GCC 2.96 and GNAT 3.15p is 
installed (compiled from sources) as 'gnatgcc'.


1. The testsuite driver script uses 'gnatchop' to chop the files.  'gnatchop' 
resolves to the (just compiled) target gnatchop, which has 'gcc' hardwired 
as its compiler driver.  So it aborts because GCC 2.96 doesn't handle Ada.

So I duplicated what is done for 'gnatmake' and added 'host_gnatchop' and 
'target_gnatshop'.


2. 'target_gnatshop' needs to pass --GCC to 'gnatshop' so I tried to mimic
what is done for 'gnatmake':

   gnatchop --GCC="$GCC"

This didn't work since GCC is defined by

   GCC="$BASE/xgcc -B$BASE/"

and 'gnatchop' tries to locate an executable named $GCC and aborts (see 
gnatchop.adb:1684).  I'm not really sure why this works for 'gnatmake'.

So I added a new exported variable

   GCC_DRIVER="$BASE/xgcc"

and this did it.


Ok for mainline?


2004-01-08  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* ada/acats/run_acats: Treats 'gnatchop' the same way
	as 'gnatmake'.  Export GCC_DRIVER.
	* ada/acats/run_all.sh: Add target_gnatchop.  Use 'host_gnatchop'
	and 'target_gnatchop' instead of 'gnatshop'.

-- 
Eric Botcazou
Index: ada/acats/run_acats
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/ada/acats/run_acats,v
retrieving revision 1.4
diff -u -r1.4 run_acats
--- ada/acats/run_acats	5 Dec 2003 09:55:35 -0000	1.4
+++ ada/acats/run_acats	8 Jan 2004 13:33:38 -0000
@@ -7,6 +7,7 @@
 
 # Set up environment to use the Ada compiler from the object tree
 
+host_gnatchop=`type gnatchop | awk '{print $3}'`
 host_gnatmake=`type gnatmake | awk '{print $3}'`
 ROOT=`${PWDCMD-pwd}`
 BASE=`cd $ROOT/../../..; ${PWDCMD-pwd}`
@@ -20,13 +21,27 @@
    exit 1
 fi
 
+if [ ! -f $BASE/gnatchop ]; then
+   echo gnattools missing, exiting.
+   exit 1
+fi
+
 if [ ! -f $BASE/gnatmake ]; then
    echo gnattools missing, exiting.
    exit 1
 fi
 
+GCC_DRIVER="$BASE/xgcc"
 GCC="$BASE/xgcc -B$BASE/"
-export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC
+export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_DRIVER GCC
+
+echo '#!/bin/sh' > host_gnatchop
+echo PATH=`dirname $host_gnatchop`:'$PATH' >> host_gnatchop
+echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatchop
+echo export PATH >> host_gnatchop
+echo exec $host_gnatchop '"$@"' >> host_gnatchop
+
+chmod +x host_gnatchop
 
 echo '#!/bin/sh' > host_gnatmake
 echo PATH=`dirname $host_gnatmake`:'$PATH' >> host_gnatmake
Index: ada/acats/run_all.sh
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/ada/acats/run_all.sh,v
retrieving revision 1.10
diff -u -r1.10 run_all.sh
--- ada/acats/run_all.sh	14 Nov 2003 10:04:31 -0000	1.10
+++ ada/acats/run_all.sh	8 Jan 2004 13:34:03 -0000
@@ -47,6 +47,10 @@
   exit 1
 fi
 
+target_gnatchop () {
+  gnatchop --GCC="$GCC_DRIVER" $*
+}
+
 target_gnatmake () {
   gnatmake --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
 }
@@ -101,7 +105,7 @@
 cp -pr $testdir/tests $dir/
 
 for i in $dir/support/*.ada $dir/support/*.a; do 
-   gnatchop $i >> $dir/acats.log 2>&1
+   host_gnatchop $i >> $dir/acats.log 2>&1
 done
 
 # These tools are used to preprocess some ACATS sources
@@ -139,7 +143,7 @@
    exit 1
 fi
 
-gnatchop *.adt >> $dir/acats.log 2>&1
+target_gnatchop *.adt >> $dir/acats.log 2>&1
 
 target_gnatmake -c -gnato -gnatE *.ads > /dev/null 2>&1
 target_gnatmake -c -gnato -gnatE *.adb
@@ -188,7 +192,7 @@
       test=$dir/tests/$chapter/$i
       mkdir $test
       cd $test
-      gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
+      target_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
       ls ${i}?.adb > ${i}.lst 2> /dev/null
       ls ${i}*m.adb >> ${i}.lst 2> /dev/null
       ls ${i}.adb >> ${i}.lst 2> /dev/null

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