On Thu, 2006-05-04 at 19:40 +0200, Richard Guenther wrote:
> On Thu, 4 May 2006, Laurent GUERBY wrote:
> > I see that from time to time, more on SMP/dual core machines, if you add
> > sync or sleep it goes away but the run is slower. I've always assumed
> > it's some kind of process/kernel/fs race condition (I don't see
> > anything wrong in gnatchop code).
> 
> Yes, this happens repeatedly on a 4-way HT-Xeon machine.  Maybe just
> skipping the test completely if $main is empty would at least avoid
> the spurious FAILs...

In the same vein as my 20050418 patch, may be the following will help.
Tested on x86_64-linux.

Laurent

2005-05-15  Laurent GUERBY  <[EMAIL PROTECTED]>

        * ada/acats/run_all.sh: Use sync when main not found.

Index: run_all.sh
===================================================================
--- run_all.sh  (revision 113519)
+++ run_all.sh  (working copy)
@@ -64,6 +64,13 @@
   rm -f "$binmain" *.o *.ali > /dev/null 2>&1
 }

+find_main () {
+  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
+  main=`tail -1 ${i}.lst`
+}
+
 EXTERNAL_OBJECTS=""
 # Global variable to communicate external objects to link with.

@@ -230,10 +237,12 @@
       fi

       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
-      main=`tail -1 ${i}.lst`
+      main=""
+      find_main
+      if [ "$main" == "" ]; then
+         sync
+         find_main
+      fi
       binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
       echo "BUILD $main" >> $dir/acats.log
       EXTERNAL_OBJECTS=""


Reply via email to