summaryrefslogtreecommitdiff
path: root/lang/gcc-aux
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2014-04-12 22:04:15 +0000
committerJohn Marino <marino@FreeBSD.org>2014-04-12 22:04:15 +0000
commit71f4c0a48af7a9452b586d26b383cb2240e2b4f5 (patch)
treeb9ea194e40ec1cc4aba61e0459a9e3e03c0d4f95 /lang/gcc-aux
parentMark broken: Fails to configure (diff)
lang/gnatdroid-armv7 (&gcc-aux): Fix socket support and gnat.dg testsuite
The socket support on Gnatdroid was broken, and it had to be fixed at lang/gcc-aux. Until now, the dejagnu testsuite did not work on remote targets. To fix this, support files had to be installed at ${LOCALBASE}/share/dejagnu. Dejagnu was not made a run dependency, conditional or otherwise. The test targets for gnatdroid are really maintainer targets. Running the gnat.dg testsuite confirms that everything works in the cross-compiler except stack checking (there's no support in gcc for this just yet).
Notes
Notes: svn path=/head/; revision=351148
Diffstat (limited to 'lang/gcc-aux')
-rw-r--r--lang/gcc-aux/Makefile21
-rw-r--r--lang/gcc-aux/Makefile.version4
-rw-r--r--lang/gcc-aux/files/android.exp106
-rw-r--r--lang/gcc-aux/files/diff-ada46
-rw-r--r--lang/gcc-aux/files/diff-ada-testsuite415
-rw-r--r--lang/gcc-aux/files/gnatdroid.exp14
6 files changed, 582 insertions, 24 deletions
diff --git a/lang/gcc-aux/Makefile b/lang/gcc-aux/Makefile
index 6f4e3a937075..1d2a0c03e60b 100644
--- a/lang/gcc-aux/Makefile
+++ b/lang/gcc-aux/Makefile
@@ -26,6 +26,7 @@ BOOTSTRAP_COMPILER= gnat-bootstrap.${GARCH}.${OPSYS:L}.tar.bz2
BLD_TARGET= ${GARCH}-aux-${OPSYS:L}${OSREL}
FULL_GNATGCC= NOT_SET
OS_LABEL4VERS= [${OPSYS}${GARCH:M*64:S/amd_//:S/x86_//}]
+NO_MTREE= yes
OPTIONS_GROUP= Standard Bootstrap
OPTIONS_GROUP_Standard= FORT OBJC NLS TESTSUITE STATIC
@@ -250,17 +251,25 @@ test-objc:
do-install:
cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} \
${MAKE_CMD} install-strip ${MAKE_ARGS}
- ${RM} -rf ${STAGEDIR}${PKG_PREFIX}/share/info
+ ${MV} ${STAGEDIR}${PKG_PREFIX}/share ${WRKDIR}/moved_share
+ ${MKDIR} -p ${STAGEDIR}${PREFIX}/share/dejagnu/baseboards \
+ ${STAGEDIR}${PREFIX}/share/dejagnu/config
+ ${INSTALL_DATA} ${FILESDIR}/android.exp \
+ ${STAGEDIR}${PREFIX}/share/dejagnu/config
+ ${INSTALL_DATA} ${FILESDIR}/gnatdroid.exp \
+ ${STAGEDIR}${PREFIX}/share/dejagnu/baseboards
post-install:
cd ${STAGEDIR}${PKG_PREFIX}; ${FIND} * -type d -empty | \
${SORT} -dr | ${XARGS} ${RMDIR}
- cd ${STAGEDIR}${PREFIX}; \
- ${FIND} ${PORTNAME} \( -type f -or -type l \) | \
- ${SORT} | ${SED} -e 's/\/man\/man[1578]\/.*[1578]$$/&.gz/' \
- >> ${TMPPLIST}
+ cd ${STAGEDIR}${PREFIX}; ${FIND} ${PORTNAME} share \
+ \( -type f -or -type l \) | ${SORT} | \
+ ${SED} -e 's/\/man\/man[1578]\/.*[1578]$$/&.gz/' >> ${TMPPLIST}
cd ${STAGEDIR}${PREFIX}; ${FIND} ${PORTNAME} -type d | ${SORT} -r | \
- ${SED} -e '/^share/d' -e 's/^/@dirrm /g' >> ${TMPPLIST}
+ ${SED} -e 's/^/@dirrm /g' >> ${TMPPLIST}
+ cd ${STAGEDIR}${PREFIX}; ${FIND} share -type d | ${SORT} -r | \
+ ${SED} -e 's/\(.*\)/@unexec rmdir %D\/\1 2>\/dev\/null || true/g' \
+ >> ${TMPPLIST}
.if ${PORT_OPTIONS:MBOOTSTRAP}
post-stage:
diff --git a/lang/gcc-aux/Makefile.version b/lang/gcc-aux/Makefile.version
index 8b0b88e2f77f..2b7aee618ec8 100644
--- a/lang/gcc-aux/Makefile.version
+++ b/lang/gcc-aux/Makefile.version
@@ -4,9 +4,9 @@ GCC_BRANCH= 4.9
GCC_POINT= 0
GCC_VERSION= ${GCC_BRANCH}.${GCC_POINT}
SNAPSHOT= 20140406
-MAIN_PR= 1
+MAIN_PR= 2
ARMV5_PR= 1
-ARMV7_PR= 1
+ARMV7_PR= 2
IDENTIFICATION= gcc-${GCC_BRANCH}-${SNAPSHOT}
MS_SUBDIR= snapshots/${GCC_BRANCH}-${SNAPSHOT}
diff --git a/lang/gcc-aux/files/android.exp b/lang/gcc-aux/files/android.exp
new file mode 100644
index 000000000000..b3eb17563371
--- /dev/null
+++ b/lang/gcc-aux/files/android.exp
@@ -0,0 +1,106 @@
+# This file is part of DejaGnu.
+
+if {![info exists board]} {
+ error "must set $board before loading android.exp"
+}
+
+# For rcp_download, rsh_exec.
+load_lib remote.exp
+
+#
+# unix_load -- load the program and execute it
+#
+# See default.exp for explanation of arguments and results.
+#
+
+
+proc unix_load { dest prog args } {
+ global ld_library_path
+ set output ""
+ set orig_ld_library_path ""
+
+ if { [llength $args] > 0 } {
+ set parg [lindex $args 0]
+ } else {
+ set parg ""
+ }
+
+ if { [llength $args] > 1 } {
+ set inp [lindex $args 1]
+ } else {
+ set inp ""
+ }
+
+ if {![file exists $prog]} then {
+ # We call both here because this should never happen.
+ perror "$prog does not exist in unix_load."
+ verbose -log "$prog does not exist." 3
+ return "untested"
+ }
+ verbose "loading to $dest" 2
+ if {![is_remote $dest]} {
+ if { "$inp" != "" } {
+ set command "$prog $parg < $inp"
+ } else {
+ set command "$prog $parg"
+ }
+
+ if {![info exists ld_library_path]} {
+ set ld_library_path ""
+ }
+
+ set orig_ld_library_path "[getenv LD_LIBRARY_PATH]"
+ setenv LD_LIBRARY_PATH "$ld_library_path:$orig_ld_library_path"
+ setenv SHLIB_PATH "$ld_library_path:$orig_ld_library_path"
+ verbose -log "Setting LD_LIBRARY_PATH to $ld_library_path:$orig_ld_library_path" 2
+
+ set id [remote_spawn $dest "$command" "readonly"]
+ if { $id < 0 } {
+ set output "remote_spawn failed"
+ set status -1
+ } else {
+ set status [remote_wait $dest 300]
+ set output [lindex $status 1]
+ set status [lindex $status 0]
+ }
+ # Unset them so we don't potentially get hosed when we try to run a
+ # non-testcase executable. (Setting LD_LIBRARY_PATH is the wrong
+ # fix in the first place; this just tries to minimize the resulting
+ # crap.)
+ if {[info exists ld_library_path]} {
+ setenv LD_LIBRARY_PATH $orig_ld_library_path
+ setenv SHLIB_PATH $orig_ld_library_path
+ }
+ } else {
+ set remotefile "/data/local/testsuite/[file tail $prog].[pid]"
+ set remotefile [remote_download $dest $prog $remotefile]
+ if { $remotefile == "" } {
+ verbose -log "Download of $prog to [board_info $dest name] failed." 3
+ return [list "unresolved" ""]
+ }
+ set status [remote_exec $dest "$remotefile" $parg $inp]
+ remote_file $dest delete $remotefile.o $remotefile
+ if { [lindex $status 0] < 0 } {
+ verbose -log "Couldn't execute $prog, [lindex $status 1]" 3
+ return [list "unresolved" ""]
+ }
+ set output [lindex $status 1]
+ set status [lindex $status 0]
+ }
+
+ setenv LD_LIBRARY_PATH $orig_ld_library_path
+ setenv SHLIB_PATH $orig_ld_library_path
+
+ verbose "Executed $prog, status $status" 2
+ if {![string match "" $output]} {
+ verbose -- "$output" 2
+ }
+ if { $status == 0 } {
+ set result "pass"
+ } else {
+ set result "fail"
+ }
+ return [list $result $output]
+}
+
+set_board_info protocol "unix"
diff --git a/lang/gcc-aux/files/diff-ada b/lang/gcc-aux/files/diff-ada
index 1763266297c6..53b26e3b6497 100644
--- a/lang/gcc-aux/files/diff-ada
+++ b/lang/gcc-aux/files/diff-ada
@@ -846,7 +846,7 @@
+ use Interfaces;
+ flags : constant Unsigned_32 :=
+ Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0));
-+ nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.FNDELAY);
++ nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.O_NDELAY);
+ enabled : constant Boolean := Arg.all = 1;
+ newval : C.int := C.int (flags);
+ begin
@@ -1207,7 +1207,7 @@
+ use Interfaces;
+ flags : constant Unsigned_32 :=
+ Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0));
-+ nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.FNDELAY);
++ nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.O_NDELAY);
+ enabled : constant Boolean := Arg.all = 1;
+ newval : C.int := C.int (flags);
+ begin
@@ -1816,7 +1816,7 @@
#warning Sockets not supported on these platforms
#undef HAVE_SOCKETS
-@@ -198,8 +198,18 @@
+@@ -198,8 +198,19 @@
#include <netdb.h>
#endif
@@ -1831,13 +1831,14 @@
+ || defined (__DragonFly__) \
+ || defined (__NetBSD__) \
+ || defined (__OpenBSD__) \
++ || defined (__ANDROID__) \
+ || defined (__hpux__) \
+ || defined (_WIN32) \
+ || defined (__APPLE__)
# define HAVE_THREAD_SAFE_GETxxxBYyyy 1
#elif defined (linux) || defined (__GLIBC__) || \
-@@ -231,7 +241,13 @@
+@@ -231,7 +242,13 @@
# endif
#endif
@@ -7685,6 +7686,20 @@
/* To be called from an established signal handler. Setup the DWARF CFI
bits letting unwinders walk through the signal frame up into the
+--- gcc/ada/socket.c.orig
++++ gcc/ada/socket.c
+@@ -65,7 +65,10 @@
+ int s_port;
+ __netdb_char_ptr s_proto;
+ };
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) \
++ || defined(__DragonFly__) \
++ || defined(__OpenBSD__) \
++ || defined(__NetBSD__)
+ typedef unsigned int IOCTL_Req_T;
+ #else
+ typedef int IOCTL_Req_T;
--- gcc/ada/sysdep.c.orig
+++ gcc/ada/sysdep.c
@@ -263,6 +263,7 @@
@@ -8868,7 +8883,7 @@
TARGET_ADA_SRCS =
--- gcc/ada/gcc-interface/Makefile.in.orig
+++ gcc/ada/gcc-interface/Makefile.in
-@@ -1044,25 +1044,27 @@
+@@ -1044,25 +1044,24 @@
ifeq ($(strip $(filter-out arm% linux-androideabi,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-linux.ads \
@@ -8878,7 +8893,6 @@
- s-linux.ads<s-linux.ads \
+ s-intman.adb<s-intman-android.adb \
+ s-linux.ads<s-linux-android.ads \
-+ s-mudido.adb<s-mudido-affinity.adb \
s-osinte.adb<s-osinte-android.adb \
s-osinte.ads<s-osinte-android.ads \
s-osprim.adb<s-osprim-posix.adb \
@@ -8887,15 +8901,15 @@
+ s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
system.ads<system-linux-armel.ads \
+- $(DUMMY_SOCKETS_TARGET_PAIRS)
+ a-exexpr.adb<a-exexpr-gcc.adb \
-+ s-excmac.ads<s-excmac-arm.ads \
- $(DUMMY_SOCKETS_TARGET_PAIRS)
++ s-excmac.ads<s-excmac-arm.ads
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- GNATRTL_SOCKETS_OBJS =
+- GNATRTL_SOCKETS_OBJS =
EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=
+ EXTRA_LIBGNAT_OBJS+=raise-gcc.o sigtramp-armdroid.o
@@ -8904,7 +8918,7 @@
THREADSLIB =
GNATLIB_SHARED = gnatlib-shared-dual
LIBRARY_VERSION := $(LIB_VERSION)
-@@ -1072,6 +1074,7 @@
+@@ -1072,6 +1071,7 @@
ifeq ($(strip $(filter-out sparc% sun solaris%,$(target_cpu) $(target_vendor) $(target_os))),)
LIBGNAT_TARGET_PAIRS_COMMON = \
a-intnam.ads<a-intnam-solaris.ads \
@@ -8912,7 +8926,7 @@
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-solaris.adb \
s-mudido.adb<s-mudido-affinity.adb \
-@@ -1114,6 +1117,8 @@
+@@ -1114,6 +1114,8 @@
TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
EH_MECHANISM=-gcc
@@ -8921,7 +8935,7 @@
THREADSLIB = -lposix4 -lthread
MISCLIB = -lposix4 -lnsl -lsocket
SO_OPTS = -Wl,-h,
-@@ -1325,12 +1330,17 @@
+@@ -1325,12 +1327,17 @@
# x86 FreeBSD
ifeq ($(strip $(filter-out %86 freebsd%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
@@ -8941,7 +8955,7 @@
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix.adb \
-@@ -1338,11 +1348,12 @@
+@@ -1338,11 +1345,12 @@
$(X86_TARGET_PAIRS) \
system.ads<system-freebsd-x86.ads
@@ -8956,7 +8970,7 @@
EH_MECHANISM=-gcc
THREADSLIB= -lpthread
-@@ -1354,12 +1365,17 @@
+@@ -1354,12 +1362,17 @@
# x86-64 FreeBSD
ifeq ($(strip $(filter-out %86_64 freebsd%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
@@ -8976,7 +8990,7 @@
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix.adb \
-@@ -1367,11 +1383,240 @@
+@@ -1367,11 +1380,240 @@
$(X86_64_TARGET_PAIRS) \
system.ads<system-freebsd-x86_64.ads
@@ -9219,7 +9233,7 @@
EH_MECHANISM=-gcc
THREADSLIB= -lpthread
-@@ -3063,6 +3308,7 @@
+@@ -3063,6 +3305,7 @@
socket.o : socket.c gsocket.h
sysdep.o : sysdep.c
raise.o : raise.c raise.h
diff --git a/lang/gcc-aux/files/diff-ada-testsuite b/lang/gcc-aux/files/diff-ada-testsuite
index 6ddaf4193ba3..d3e971b19aa4 100644
--- a/lang/gcc-aux/files/diff-ada-testsuite
+++ b/lang/gcc-aux/files/diff-ada-testsuite
@@ -109,6 +109,421 @@
egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
if [ $? -ne 0 ]; then
grep 'tasking not implemented' ${i}.log > /dev/null 2>&1
+--- /dev/null
++++ gcc/testsuite/ada/acats/run_remote.sh
+@@ -0,0 +1,412 @@
++#!/bin/sh
++# Run ACATS with the GNU Ada compiler
++
++# The following functions are to be customized if you run in cross
++# environment or want to change compilation flags. Note that for
++# tests requiring checks not turned on by default, this script
++# automatically adds the needed flags to pass (ie: -gnato or -gnatE).
++
++# gccflags="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions"
++# gnatflags="-gnatN"
++
++gccflags="-O2"
++gnatflags="-gnatws"
++tabtarget="/data/local/testsuite"
++STRIP="arm-aux-linux-androideabi-strip"
++
++target_run () {
++ # Run on rooted tablet (port 22 vs port 2222)
++ BN=`basename $*`
++ $STRIP_FOR_TARGET $*
++ /usr/bin/scp -qp $* root@tablet:$tabtarget/
++ /usr/bin/ssh -q tablet $tabtarget/$BN
++}
++
++target_cmd () {
++ /usr/bin/ssh -q tablet "$1"
++}
++
++# End of customization section.
++
++display_noeol () {
++ printf "$@"
++ printf "$@" >> $dir/acats.sum
++ printf "$@" >> $dir/acats.log
++}
++
++display () {
++ echo "$@"
++ echo "$@" >> $dir/acats.sum
++ echo "$@" >> $dir/acats.log
++}
++
++log () {
++ echo "$@" >> $dir/acats.sum
++ echo "$@" >> $dir/acats.log
++}
++
++inform () {
++ printf "%04d %7s" $1 $2
++}
++
++disinform () {
++ printf "\r"
++}
++
++dir=`${PWDCMD-pwd}`
++
++if [ "$testdir" = "" ]; then
++ echo You must use make check or make check-ada
++ exit 1
++fi
++
++if [ "$dir" = "$testdir" ]; then
++ echo "error: srcdir must be different than objdir, exiting."
++ exit 1
++fi
++
++target_gnatmake () {
++ echo gnatmake-cross --GCC=\"$GCC\" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC=\"$GCC\"
++ gnatmake-cross --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
++}
++
++target_gcc () {
++ $GCC $gccflags $*
++}
++
++clean_dir () {
++ 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`
++}
++
++split_testid () {
++ local mysplit=`echo $1 | awk -F/ '{print "section=" $1 "; TN=" $2 "; prog=" $3 ";"}'`
++ eval ${mysplit}
++}
++
++EXTERNAL_OBJECTS=""
++# Global variable to communicate external objects to link with.
++
++rm -f $dir/acats.sum $dir/acats.log $dir/transfer.lst
++
++display "Test Run By $USER on `date`"
++
++display " === acats configuration ==="
++
++target=`$GCC -dumpmachine`
++
++display target gcc is $GCC
++display `$GCC -v 2>&1`
++display host=`gcc -dumpmachine`
++display target=$target
++display `type gnatmake-cross`
++gnatls-cross -v >> $dir/acats.log
++display ""
++
++# Let's be tidy and clear off the remote device first
++target_cmd "cd ${tabtarget}; rm logs/*; rmdir logs; rm *"
++
++display " === acats support ==="
++display_noeol "Generating support files..."
++
++rm -rf $dir/support
++mkdir -p $dir/support
++cd $dir/support
++
++cp $testdir/support/*.ada $testdir/support/*.a $testdir/support/*.tst $dir/support
++
++# Find out the size in bit of an address on the target
++target_gnatmake $testdir/support/impbit.adb >> $dir/acats.log 2>&1
++target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
++target_bit=`cat $dir/support/impbit.out`
++echo target_bit="$target_bit" >> $dir/acats.log
++
++# Find out a suitable asm statement
++# Adapted from configure.ac gcc_cv_as_dwarf2_debug_line
++case "$target" in
++ ia64*-*-* | s390*-*-*)
++ target_insn="nop 0"
++ ;;
++ mmix-*-*)
++ target_insn="swym 0"
++ ;;
++ *)
++ target_insn="nop"
++ ;;
++esac
++echo target_insn="$target_insn" >> $dir/acats.log
++
++sed -e "s,ACATS4GNATDIR,$dir,g" \
++ < $testdir/support/impdef.a > $dir/support/impdef.a
++sed -e "s,ACATS4GNATDIR,$dir,g" \
++ -e "s,ACATS4GNATBIT,$target_bit,g" \
++ -e "s,ACATS4GNATINSN,$target_insn,g" \
++ < $testdir/support/macro.dfs > $dir/support/MACRO.DFS
++sed -e "s,ACATS4GNATDIR,$dir,g" \
++ < $testdir/support/tsttests.dat > $dir/support/TSTTESTS.DAT
++
++cp $testdir/tests/cd/*.c $dir/support
++cp $testdir/tests/cxb/*.c $dir/support
++grep -v '^#' $testdir/norun.lst | sort > $dir/support/norun.lst
++
++rm -rf $dir/run
++mv $dir/tests $dir/tests.$$ 2> /dev/null
++rm -rf $dir/tests.$$ &
++mkdir -p $dir/run
++
++cp -pr $testdir/tests $dir/
++
++for i in $dir/support/*.ada $dir/support/*.a; do
++ host_gnatchop $i >> $dir/acats.log 2>&1
++done
++
++# These tools are used to preprocess some ACATS sources
++# they need to be compiled native on the host.
++
++host_gnatmake -q -gnatws macrosub.adb
++if [ $? -ne 0 ]; then
++ display "**** Failed to compile macrosub"
++ exit 1
++fi
++./macrosub > macrosub.out 2>&1
++
++gcc -c cd300051.c
++host_gnatmake -q -gnatws widechr.adb
++if [ $? -ne 0 ]; then
++ display "**** Failed to compile widechr"
++ exit 1
++fi
++./widechr > widechr.out 2>&1
++
++rm -f $dir/support/macrosub
++rm -f $dir/support/widechr
++rm -f $dir/support/*.ali
++rm -f $dir/support/*.o
++
++display " done."
++
++# From here, all compilations will be made by the target compiler
++
++display_noeol "Compiling support files..."
++
++target_gcc -c *.c
++if [ $? -ne 0 ]; then
++ display "**** Failed to compile C code"
++ exit 1
++fi
++
++host_gnatchop *.adt >> $dir/acats.log 2>&1
++
++target_gnatmake -c -gnato -gnatE *.ads >> $dir/acats.log 2>&1
++target_gnatmake -c -gnato -gnatE *.adb >> $dir/acats.log 2>&1
++
++display " done."
++display ""
++display " === acats tests ==="
++
++if [ $# -eq 0 ]; then
++ chapters=`cd $dir/tests; echo [a-z]*`
++else
++ chapters=$*
++fi
++
++glob_countn=0
++glob_countok=0
++glob_countu=0
++countdown=0
++
++for chapter in $chapters; do
++ if [ -d $dir/tests/$chapter ]; then
++ cd $dir/tests/$chapter
++ ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
++ cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
++ > $dir/tests/$chapter/${chapter}.lst
++ countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
++ countdown=`expr $countdown + $countn`
++ fi
++done
++
++cat > $dir/execute.sh << EOF
++inform () {
++ printf "left: %04d" \$1
++}
++disinform () {
++ printf "\r"
++}
++cycle () {
++ local countx=0
++ local total=\$(echo \$testlist | awk '{print NF}')
++ mkdir -p logs
++ echo "Executing \$total tests on remote device"
++ inform \$total
++ for x in \$testlist; do
++ timeout -t 30 ./\${x} > logs/\${x}.log 2>&1
++ countx=\$(expr \$countx + 1)
++ if [ \$countx -eq 25 ]; then
++ total=\$(expr \$total - 25)
++ countx=0
++ disinform
++ inform \$total
++ fi
++ done
++ disinform
++ tar -czf remote.logs.tar.gz logs
++}
++testlist=" \\
++EOF
++
++display "All tests are being cross-compiled without execution first."
++
++for chapter in $chapters; do
++ if [ ! -d $dir/tests/$chapter ]; then
++ continue
++ fi
++
++ countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
++ glob_countn=`expr $glob_countn + $countn`
++ counti=0
++ for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
++ counti=`expr $counti + 1`
++ extraflags="-gnat95"
++ grep $i $testdir/overflow.lst > /dev/null 2>&1
++ if [ $? -eq 0 ]; then
++ extraflags="$extraflags -gnato"
++ fi
++ grep $i $testdir/elabd.lst > /dev/null 2>&1
++ if [ $? -eq 0 ]; then
++ extraflags="$extraflags -gnatE"
++ fi
++ grep $i $testdir/floatstore.lst > /dev/null 2>&1
++ if [ $? -eq 0 ]; then
++ extraflags="$extraflags -ffloat-store"
++ fi
++ grep $i $testdir/stackcheck.lst > /dev/null 2>&1
++ if [ $? -eq 0 ]; then
++ extraflags="$extraflags -fstack-check"
++ fi
++ inform $countdown $i
++ countdown=`expr $countdown - 1`
++ test=$dir/tests/$chapter/$i
++ mkdir $test && cd $test >> $dir/acats.log 2>&1
++
++ if [ $? -ne 0 ]; then
++ disinform
++ display "FAIL: $i"
++ failed="${failed}${i} "
++ clean_dir
++ continue
++ fi
++
++ host_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
++ find_main
++ if [ -z "$main" ]; then
++ sync
++ find_main
++ fi
++ binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
++ echo "BUILD $main" >> $dir/acats.log
++ EXTERNAL_OBJECTS=""
++ case $i in
++ cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
++ ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
++ ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
++ cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
++ esac
++ if [ "$main" = "" ]; then
++ disinform
++ display "FAIL: $i"
++ failed="${failed}${i} "
++ clean_dir
++ continue
++ fi
++
++ target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
++ if [ $? -ne 0 ]; then
++ disinform
++ display "FAIL: $i"
++ failed="${failed}${i} "
++ clean_dir
++ continue
++ fi
++ echo $chapter/$i/$binmain >> $dir/transfer.lst
++ echo "$binmain \\" >> $dir/execute.sh
++ $STRIP $binmain
++ disinform
++ done
++done
++echo '"' >> $dir/execute.sh
++echo "cycle" >> $dir/execute.sh
++
++sync
++display "Transfer files to remote device: root@tablet:$tabtarget/"
++cd $dir/tests
++cat $dir/transfer.lst | xargs tar --strip-components=2 -czf - | \
++ target_cmd "tar -C $tabtarget -xzf -"
++cd $dir
++tar -czf - execute.sh | target_cmd "tar -C $tabtarget -xzf -"
++target_cmd "cd $tabtarget; sh execute.sh"
++rm -rf $dir/logs $dir/remote.logs.tar.gz
++/usr/bin/scp -q root@tablet:$tabtarget/remote.logs.tar.gz $dir/
++tar -xzf $dir/remote.logs.tar.gz
++
++countdown=`wc -l < $dir/transfer.lst`
++glob_countn=${countdown}
++for i in `cat $dir/transfer.lst`; do
++ split_testid $i
++ if [ "$section" != "$savedsect" ]; then
++ display Running chapter $section ...
++ fi
++ savedsect=$section
++
++ #inform $countdown $TN
++ countdown=`expr $countdown - 1`
++ proglog="$dir/logs/${prog}.log"
++ echo "RUN $prog" >> $dir/acats.log
++ if [ ! -f $proglog ]; then
++ echo "LOG NOT FOUND!" >> $proglog
++ fi
++
++ cat $proglog >> $dir/acats.log
++
++ egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' $proglog > /dev/null 2>&1
++ if [ $? -ne 0 ]; then
++ grep 'tasking not implemented' $proglog > /dev/null 2>&1
++
++ if [ $? -ne 0 ]; then
++ display "FAIL: ${TN}"
++ failed="${failed}${TN} "
++ else
++ log "UNSUPPORTED: ${TN}"
++ glob_countn=`expr $glob_countn - 1`
++ glob_countu=`expr $glob_countu + 1`
++ fi
++ else
++ log "PASS: ${TN}"
++ glob_countok=`expr $glob_countok + 1`
++ fi
++ cd $dir/tests/$section/$TN
++ clean_dir
++ #disinform
++done
++
++display " === acats Summary ==="
++display "# of expected passes $glob_countok"
++display "# of unexpected failures `expr $glob_countn - $glob_countok`"
++
++if [ $glob_countu -ne 0 ]; then
++ display "# of unsupported tests $glob_countu"
++fi
++
++if [ $glob_countok -ne $glob_countn ]; then
++ display "*** FAILURES: $failed"
++fi
++
++display "$0 completed at `date`"
++
++exit 0
--- gcc/testsuite/gnat.dg/test_raise_from_pure.adb.orig
+++ gcc/testsuite/gnat.dg/test_raise_from_pure.adb
@@ -1,4 +1,4 @@
diff --git a/lang/gcc-aux/files/gnatdroid.exp b/lang/gcc-aux/files/gnatdroid.exp
new file mode 100644
index 000000000000..978319f8a9b1
--- /dev/null
+++ b/lang/gcc-aux/files/gnatdroid.exp
@@ -0,0 +1,14 @@
+# gnatdroid testsuite running over ssh.
+
+load_generic_config "android"
+
+process_multilib_options ""
+
+# The default compiler for this target.
+set_board_info compiler "[find_gcc]"
+
+set_board_info rsh_prog /usr/bin/ssh
+set_board_info rcp_prog /usr/bin/scp
+set_board_info protocol standard
+set_board_info hostname tablet
+set_board_info username root