summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-21 12:41:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-21 12:41:37 +0000
commit288a6fbf6dd0dd728d28db838c1dfc1df0311161 (patch)
treed592aa53f854caeb5967b501f7b5d8ca3f308eb8 /gcc
parent64b459b59cae45e9b6988779b85d2a0b228c63d0 (diff)
2010-07-21 Vinu Rajashekhar <vinutheraj@gmail.com>
* do_one, rundeja, test_driver: Add Go support. Plus some cleanup from Joel.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rwxr-xr-xgcc/do_one136
-rwxr-xr-xgcc/rundeja47
-rwxr-xr-xgcc/test_driver9
4 files changed, 166 insertions, 31 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 40cbd1f..5410ea0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-21 Vinu Rajashekhar <vinutheraj@gmail.com>
+
+ * do_one, rundeja, test_driver: Add Go support. Plus some cleanup from
+ Joel.
+
2010-07-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* test_driver: Add -T option to getopt string.
diff --git a/gcc/do_one b/gcc/do_one
index f8f9801..5c2d41b 100755
--- a/gcc/do_one
+++ b/gcc/do_one
@@ -41,11 +41,15 @@ do_stage1=no
# Build the Ada language cross compiler. Multilib is NOT supported
do_ada=no
do_ada_multilib=yes
+# Build the GCC Go language cross compiler.
+do_gccgo=no
+ do_gccgo_multilib=yes
# Build RTEMS for a particular CPU/BSP combination
do_rtems=no
# Which test suites do we attempt
run_gcctests=no
run_acats=no
+run_gccgotests=no
# Do we send email to gcc-testresults with the test results?
do_mail=yes
# Are we noisy when running?
@@ -56,8 +60,8 @@ usage()
{
cat <<EOF
do_one [options] CPU BSP
- -A - binutils, stage 1, C++, C/C++ multilib, Ada, RTEMS
- -T - run GCC and Ada tests
+ -A - binutils, stage 1, C++, C/C++ multilib, Ada, GCC Go, RTEMS
+ -T - run GCC, Ada and GCC Go tests
-b - install binutils (from source or copy installed RPM contents)
-D - install gdb (from source or copy installed RPM contents)
-n - native compiler
@@ -65,12 +69,14 @@ do_one [options] CPU BSP
-c - do not include C++
-m - do not build multilib
-a - stage 2 Ada compiler
+ -G - stage 2 GCC Go compiler
-r - build RTEMS
-g - run GCC C/C++ tests
-C - run ACATS
-d - do not clean up (delete build directories)
-v - verbose
-M - do NOT email test results to gcc-testresults
+ -o - run GCC Go tests
EOF
}
@@ -89,7 +95,7 @@ toggle()
esac
}
-while getopts bdDnv1cmargCATM OPT
+while getopts bdDnv1cmargioCATMG OPT
do
case "$OPT" in
A) do_binutils="yes"
@@ -98,12 +104,14 @@ do
do_cxx="yes"
do_multilib="yes"
do_ada="yes"
+ do_gccgo="yes"
do_rtems="yes"
;;
d) do_cleanup=`toggle ${do_cleanup}` ;;
D) do_gdb=`toggle ${do_gdb}` ;;
T) run_gcctests="yes"
run_acats="yes"
+ run_gccgotests="yes"
;;
# unrpm binutils
b) do_binutils=`toggle ${do_binutils}` ;;
@@ -115,6 +123,7 @@ do
m) do_multilib=`toggle ${do_multilib}` ;;
# Stage 2 arguments
a) do_ada=`toggle ${do_ada}` ;;
+ G) do_gccgo=`toggle ${do_gccgo}` ;;
# Build RTEMS
r) do_rtems=`toggle ${do_rtems}` ;;
# Testsuites to run
@@ -122,7 +131,8 @@ do
C) run_acats=`toggle ${run_acats}` ;;
v) verbose=`toggle ${verbose}` ;;
M) do_mail=`toggle ${do_mail}` ;;
- *) fatal;;
+ o) run_gccgotests=`toggle ${run_gccgotests}` ;;
+ *) fatal ;;
esac
done
@@ -156,9 +166,12 @@ if [ ${verbose} = yes ] ; then
echo "Stage 2 : " ${do_ada}
echo " Ada : " ${do_ada}
echo " Multilib : " ${do_ada_multilib}
+ echo " GCC Go : " ${do_gccgo}
+ echo " Multilib : " ${do_gccgo_multilib}
echo "Build RTEMS : " ${do_rtems}
echo "Run GCC Tests : " ${run_gcctests}
echo "Run ACATS : " ${run_acats}
+ echo "Run Go Tests : " ${run_gccgotests}
echo "Email Tests : " ${do_mail}
echo "Native GCC : " `type gcc`
echo "PATH : " ${PATH}
@@ -170,11 +183,17 @@ needBSP=no
needCPU=no
if [ ${do_binutils} = yes -o ${do_gdb} = yes -o \
- ${do_stage1} = yes -o ${do_ada} = yes ] ; then
+ ${do_stage1} = yes -o ${do_ada} = yes -o ${do_gccgo} = yes ] ; then
needCPU=yes
fi
-if [ ${do_rtems} = yes -o ${run_gcctests} = yes -o ${run_acats} = yes ] ; then
+if [ ${do_native} = yes -a ${do_gccgo} = yes ] ; then
+ echo "Warning! Go requires native C++ to build."
+ do_cxx=yes
+fi
+
+if [ ${do_rtems} = yes -o ${run_gcctests} = yes -o \
+ ${run_acats} = yes -o ${run_gccgotests} = yes ] ; then
needBSP=yes
needCPU=yes
if [ x${bsp} = x ] ; then
@@ -498,6 +517,7 @@ j_rtems()
qemu|pc386)
ENABLE_BSP="${ENABLE_BSP} USE_COM1_AS_CONSOLE=1"
ENABLE_BSP="${ENABLE_BSP} BSP_PRESS_KEY_FOR_RESET=0"
+ ENABLE_BSP="${ENABLE_BSP} BSP_RESET_BOARD_AT_EXIT=0"
;;
*) ;;
esac
@@ -527,7 +547,7 @@ pwd
if [ ${run_gcctests} = "yes" ] ; then
echo "Running GCC Tests..."
cd ${BASEDIR}/b-gcc1-${cpu} || exit 1
- time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} \
+ time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gcc\
>${LOGDIR}/${cpu}-gcctests-${bsp}.log 2>&1
RDIR=${RESULTSDIR}/${TARGET}-${bsp}/`date +%Y-%m-%d-%H-%M-%S`
@@ -559,7 +579,7 @@ fi
test ${do_cleanup} = "yes" && rm -rf b-gcc1-${cpu}
##### Build an Ada compiler now that we have a cross installed
-j_gcc2()
+j_gccada()
{
if [ X${1} = X ] ; then
echo Usage: $0 TARGET_CPU
@@ -599,16 +619,16 @@ j_gcc2()
if [ ${do_ada} = "yes" ] ; then
echo "Building Stage 2 cross Ada compiler for ${1} ..."
(cd ${BASEDIR} && \
- rm -rf b-gcc2-${cpu} && \
- mkdir b-gcc2-${cpu} && \
- cd b-gcc2-${cpu} && \
- time j_gcc2 ${cpu} >${LOGDIR}/${cpu}-stage2.log 2>&1 && cd ..) || exit 1
+ rm -rf b-gccada-${cpu} && \
+ mkdir b-gccada-${cpu} && \
+ cd b-gccada-${cpu} && \
+ time j_gccada ${cpu} >${LOGDIR}/${cpu}-ada.log 2>&1 && cd ..) || exit 1
else
echo Skipping Stage 2 Ada for ${cpu}
fi
#### Run the Ada ACATS tests
-if [ ${run_acats} = "yes" -a -d b-gcc2-${cpu} ] ; then
+if [ ${run_acats} = "yes" -a -d b-gccada-${cpu} ] ; then
echo "Running ACATS..."
cd ${GCCDIR}/gcc/testsuite/ada/acats/ || exit 1
@@ -631,6 +651,94 @@ else
fi
if [ ${do_ada} = "yes" ] ; then
- test ${do_cleanup} = "yes" && rm -rf b-gcc2-${cpu}
+ test ${do_cleanup} = "yes" && rm -rf b-gccada-${cpu}
+fi
+
+##### Build a GCC Go compiler now that we have a cross installed
+j_gccgo()
+{
+ if [ X${1} = X ] ; then
+ echo Usage: $0 TARGET_CPU
+ exit 1
+ fi
+ TARGET=${1}-rtems${RTEMS_VERSION}
+
+ if [ ! -d ${INSTALL} ]; then
+ echo ${INSTALL} does not exist
+ exit 1
+ fi
+
+ if [ ${verbose} = yes ] ; then
+ echo "Cross GCC ==>" `type ${TARGET}-gcc`
+ fi
+
+ if [ ${do_gccgo_multilib} = yes ] ; then
+ gccgo_multilib="--enable-multilib"
+ else
+ gccgo_multilib="--disable-multilib"
+ fi
+
+ case ${TARGET} in
+ i386*) GOFLAGS="-march=i486" ;;
+ *) GOFLAGS="" ;;
+ esac
+# CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/
+
+ ${GCCDIR}/configure \
+ ${GCC_EXTRA_ARGS} \
+ CFLAGS_FOR_TARGET="-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ ${GOFLAGS}" \
+ --enable-threads=rtems --with-gnu-as ${gccgo_multilib} \
+ --enable-newlib-mb --enable-newlib-iconv \
+ --with-gnu-ld --with-newlib --verbose --with-system-zlib --disable-nls \
+ --enable-version-specific-runtime-libs \
+ --enable-languages=c,go --target=$TARGET --prefix=$INSTALL &&
+ make ${MAKEJOBS} &&
+ make install
+}
+
+if [ ${do_gccgo} = "yes" ] ; then
+ echo "Building Stage 2 cross GCC Go compiler for ${1} ..."
+ (cd ${BASEDIR} && \
+ rm -rf b-gccgo1-${cpu} && \
+ mkdir b-gccgo1-${cpu} && \
+ cd b-gccgo1-${cpu} && \
+ time j_gccgo ${cpu} >${LOGDIR}/${cpu}-go.log 2>&1 && cd ..) || exit 1
+else
+ echo Skipping GCC Go for ${cpu}
+fi
+
+##### Do the gccgo tests
+if [ ${run_gccgotests} = "yes" ] ; then
+ echo "Running GCC Go Tests..."
+ cd ${BASEDIR}/b-gccgo1-${cpu}/gcc || exit 1
+ time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gccgo \
+ >${LOGDIR}/${cpu}-gccgotests-${bsp}.log 2>&1
+
+ RDIR=${RESULTSDIR}/${TARGET}-${bsp}/`date +%Y-%m-%d-%H-%M-%S`
+ mkdir -p ${RDIR}
+ cp testsuite/go/go.log testsuite/go/go.sum ${RDIR}
+
+ if [ ${do_mail} = "yes" ] ; then
+ echo Sending test results to GCC community..
+ ${DIR}/contrib/test_summary -m gcc-testresults@gcc.gnu.org | sh
+ if [ $? -ne 0 ] ; then
+ echo "Failed to email GCC Test Results to GCC Community .. bailing"
+ exit 1
+ fi
+
+ echo Sending test results to RTEMS community..
+ ${GCCDIR}/contrib/test_summary -o -m rtems-tooltestresults@rtems.org | sh
+ if [ $? -ne 0 ] ; then
+ echo "Failed to email GCC Test Results to RTEMS Community .. bailing"
+ exit 1
+ fi
+ fi
+ cd .. || exit 1
+else
+ echo Skipping GCC Go DejaGNU tests for ${cpu}/${bsp}
+fi
+
+if [ ${do_gccgo} = "yes" ] ; then
+ test ${do_cleanup} = "yes" && rm -rf b-gccgo1-${cpu}
fi
exit 0
diff --git a/gcc/rundeja b/gcc/rundeja
index 52ee539..68e2455 100755
--- a/gcc/rundeja
+++ b/gcc/rundeja
@@ -2,8 +2,8 @@
#
#
-if [ $# -ne 1 ] ; then
- echo USAGE: BSP
+if [ $# -lt 2 ] ; then
+ echo USAGE: BSP COMPILER
exit 1
fi
@@ -111,20 +111,37 @@ else
echo "set boards_dir ${SCRIPTDIR}/dejagnu/boards" >${dfile}
fi
-RTEMS_MAKEFILE_PATH=${rtemsdir} \
-SCRIPTDIR=${SCRIPTDIR} \
- make -f ${SCRIPTDIR}/gcc/Makefile.rtems_gccmain
-if [ $? -ne 0 ] ; then
- echo unable to compile RTEMS GCC Main
- exit 1
+if [ $2 = gccgo ] ; then
+ RTEMS_MAKEFILE_PATH=${rtemsdir} \
+ SCRIPTDIR=${SCRIPTDIR} \
+ make -f ${SCRIPTDIR}/gcc/Makefile.rtems_gccgoinit
+ if [ $? -ne 0 ] ; then
+ echo unable to compile RTEMS GCC Go Init File
+ exit 1
+ fi
+ rtems_config=`pwd`/rtems_gccgo_init.o
+ make check-go RUNTESTFLAGS="\
+ SIM=${BSP_SIM} \
+ RTEMS_MAKEFILE_PATH=${rtemsdir} \
+ RTEMS_CONFIG_OBJ=${rtems_config} \
+ --target_board=rtems-${CPU}-${DEJABSP} \
+ "
+else
+ RTEMS_MAKEFILE_PATH=${rtemsdir} \
+ SCRIPTDIR=${SCRIPTDIR} \
+ make -f ${SCRIPTDIR}/gcc/Makefile.rtems_gccmain
+ if [ $? -ne 0 ] ; then
+ echo unable to compile RTEMS GCC Main
+ exit 1
+ fi
+ rtems_config=`pwd`/rtems_gcc_main.o
+ make check-gcc RUNTESTFLAGS="\
+ SIM=${BSP_SIM} \
+ RTEMS_MAKEFILE_PATH=${rtemsdir} \
+ RTEMS_CONFIG_OBJ=${rtems_config} \
+ --target_board=rtems-${CPU}-${DEJABSP} \
+ "
fi
-rtems_config=`pwd`/rtems_gcc_main.o
-make check-gcc RUNTESTFLAGS="\
-SIM=${BSP_SIM} \
-RTEMS_MAKEFILE_PATH=${rtemsdir} \
-RTEMS_CONFIG_OBJ=${rtems_config} \
---target_board=rtems-${CPU}-${DEJABSP} \
-"
# "execute.exp=pr206*"
# vect.exp=vect*
# powerpc.exp=405*
diff --git a/gcc/test_driver b/gcc/test_driver
index d39fb55..7187b37 100755
--- a/gcc/test_driver
+++ b/gcc/test_driver
@@ -44,6 +44,7 @@ cat <<EOF
do_one [options] CPU .. CPU
-A - enable clean, native, and update
-a - build Ada (default=yes)
+ -G - build GCC Go (default=yes)
-c - clean install point (also installs auto tools)
-m - mail results to lists (default=yes)
-n - build native
@@ -60,6 +61,7 @@ doUpdateRTEMS="no"
doNative="no"
verbose="no"
doAda="yes"
+doGccGo="yes"
doMail="yes"
doTests="yes"
@@ -72,6 +74,7 @@ do
doUpdateRTEMS=`toggle ${doUpdateRTEMS}`
;;
a) doAda=`toggle ${doAda}` ;;
+ G) doGccGo=`toggle ${doGccGo}` ;;
c) doCleanInstallPoint=`toggle ${doCleanInstallPoint}` ;;
m) doMail=`toggle ${doMail}` ;;
n) doNative=`toggle ${doNative}` ;;
@@ -105,7 +108,8 @@ if [ ${verbose} = "yes" ] ; then
echo "Install Native: " ${doNative}
echo "Update Tool Source: " ${doUpdateTools}
echo "Update RTEMS: " ${doUpdateRTEMS}
- echo "Build Ada " ${doAda}
+ echo "Build Ada: " ${doAda}
+ echo "Build GCC Go: " ${doGccGo}
echo "Email Results: " ${doMail}
echo "Run Tests: " ${doTests}
if [ "X${CPUs}" = "X" ] ; then
@@ -118,6 +122,7 @@ fi
test ${doMail} = "no" && mailArg="-M"
test ${doTests} = "yes" && testArg="-T"
test ${doAda} = "yes" && adaArg="-a"
+test ${doGccGo} = "yes" && gccgoArg="-G"
start=`date`
echo Started at: ${start}
@@ -215,7 +220,7 @@ do_cpus()
esac
doOne=${SCRIPTDIR}/gcc/do_one
- time sh -x ${doOne} -v -b -D -1 -d -r ${adaArg} ${mailArg} ${testArg} \
+ time sh -x ${doOne} -v -b -D -1 -d -r ${gccgoArg} ${adaArg} ${mailArg} ${testArg} \
${cpu} ${bsp} >${BASEDIR}/${bsp}.log 2>&1
echo $?
done