diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-11-06 15:35:36 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-11-06 15:35:36 +0000 |
commit | 7127cb0d2abad770a97a6dd86a97d316fda698ce (patch) | |
tree | 4656c13e437039089fed86a423ddcb2033c87b32 /gcc/do_one | |
parent | e3d5bc5b538a58ca65dd313ddf6e6f0c88bd36d0 (diff) |
2011-11-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* do_one: do_cleanup defaults to "no".
Add initial support for Objective-C and FORTRAN.
- Objective-C needs work on run-time support
- FORTRAN needs to be tested
* gcc_status: Use BUILDDIR not BASEDIR.
* gccgo_status: Use BUILDDIR not BASEDIR.
* networkconfig.h: Update.
* rtems_gccgo_init.c: Switch to unlimited objects configuration.
* rundeja: Add Objective-C.
* test_driver: Add -C to check options and exit.
Add --enable-watchdog to PPL configuration.
* testsuite/ada/acats/Makefile.rtems: Correct uC5282.
* gccobjc_status: New file.
Diffstat (limited to 'gcc/do_one')
-rwxr-xr-x | gcc/do_one | 193 |
1 files changed, 144 insertions, 49 deletions
@@ -1,4 +1,3 @@ -#! /bin/sh # # Execution Times (for sparc-rtems${RTEMS_VERSION}) # @@ -31,7 +30,7 @@ source ${vfile} ######################## Set defaults ############################# # Remove Build Directories -do_cleanup=yes +do_cleanup=no # Install Binutils (from rpm or source) do_binutils=no do_binutils_method=source @@ -47,6 +46,7 @@ do_stage1=no do_multilib=yes # Build the Objective-C language cross compiler. do_objc=no + do_native_objc=yes # Build the Ada language cross compiler. do_ada=no do_ada_multilib=yes @@ -56,6 +56,9 @@ do_gccgo=no # Build the GCC Java language cross compiler. do_gcj=no do_gcj_multilib=yes +# Build the GCC FORTRAN language cross compiler. +do_fortran=no + do_fortran_multilib=yes # Build RTEMS for a particular CPU/BSP combination do_rtems=no # Which test suites do we attempt @@ -65,16 +68,19 @@ run_acats=no run_gccgotests=no run_libgotests=no run_libjavatests=no +run_fortrantests=no # Do we send email to gcc-testresults with the test results? do_mail=yes # Are we noisy when running? -verbose=no +verbose=yes ######################## Parse arguments ########################### usage() { cat <<EOF do_one [options] CPU BSP + -A - binutils, stage 1, C++, C/C++ multilib, Ada, GCC Go, ObjC, RTEMS + -T - run GCC, Ada, GCC Go, and ObjC tests -A - binutils, stage 1, C++, C/C++ multilib, Ada, GCC Go, GCJ, RTEMS -T - run GCC, Ada, GCC Go and GCJ tests -b - install binutils (from source or copy installed RPM contents) @@ -86,10 +92,12 @@ do_one [options] CPU BSP -a - stage 2 Ada compiler -G - stage 2 GCC Go compiler -J - stage 2 GCC Java compiler + -f - stage 2 GCC FORTRAN compiler + -F - run FORTRAN tests -r - build RTEMS -g - run GCC C/C++ tests -C - run ACATS - -d - do not clean up (delete build directories) + -d - do not clean up (delete build directories) (default=no) -v - verbose -M - do NOT email test results to gcc-testresults -O - Build Objective-C @@ -115,7 +123,7 @@ toggle() esac } -while getopts bdDnv1cmargiotCATMGOP OPT +while getopts bdDnv1cmargiotCfFAJTMGOP OPT do case "$OPT" in A) do_binutils="yes" @@ -127,6 +135,7 @@ do do_gccgo="yes" do_gcj="yes" do_objc="yes" + #do_fortran="yes" do_rtems="yes" ;; d) do_cleanup=`toggle ${do_cleanup}` ;; @@ -148,6 +157,7 @@ do a) do_ada=`toggle ${do_ada}` ;; G) do_gccgo=`toggle ${do_gccgo}` ;; J) do_gcj=`toggle ${do_gcj}` ;; + f) do_fortran=`toggle ${do_fortran}` ;; # Build RTEMS r) do_rtems=`toggle ${do_rtems}` ;; # Testsuites to run @@ -156,10 +166,11 @@ do v) verbose=`toggle ${verbose}` ;; M) do_mail=`toggle ${do_mail}` ;; O) do_objc=`toggle ${do_objc}` ;; - P) run_objctests=`toggle ${do_objc}` ;; + P) run_objctests=`toggle ${run_objctests}` ;; o) run_gccgotests=`toggle ${run_gccgotests}` ;; t) run_libgotests=`toggle ${run_libgotests}` ;; j) run_libjavatests=`toggle ${run_libjavatests}` ;; + F) run_fortrantests=`toggle ${run_fortrantests}` ;; *) fatal ;; esac done @@ -218,6 +229,17 @@ if [ ${do_gcj} = "yes" ] ; then esac fi +# Which CPUs do not support FORTRAN +if [ ${do_fortran} = "yes" ] ; then + case ${cpu} in + arm|i386|m68k|mips|powerpc|sparc) ;; + *) + do_fortran=no + echo ${cpu} does not support Ada + ;; + esac +fi + # When verbose, print settings if [ ${verbose} = yes ] ; then echo "Target : " ${cpu} @@ -236,6 +258,7 @@ if [ ${verbose} = yes ] ; then echo " Go Multilib : " ${do_gccgo_multilib} echo " GCJ : " ${do_gcj} echo " GCJ Multilib : " ${do_gccgcj_multilib} + echo " FORTRAN : " ${do_fortran} echo "Build RTEMS : " ${do_rtems} echo "Run GCC Tests : " ${run_gcctests} echo "Run ObjC Tests : " ${run_objctests} @@ -255,7 +278,8 @@ needCPU=no if [ ${do_binutils} = yes -o ${do_gdb} = yes -o \ ${do_stage1} = yes -o ${do_ada} = yes -o \ - ${do_gccgo} = yes -o ${do_gcj} = yes ] ; then + ${do_gccgo} = yes -o ${do_gcj} = yes -o \ + ${do_fortran} = yes ] ; then needCPU=yes fi @@ -391,9 +415,9 @@ j_binutils() ;; source) echo "Building Binutils from source" - rm -rf b-${cpu}-binutils - mkdir b-${cpu}-binutils - cd b-${cpu}-binutils + rm -rf ${BUILDDIR}/b-${cpu}-binutils + mkdir ${BUILDDIR}/b-${cpu}-binutils + cd ${BUILDDIR}/b-${cpu}-binutils (${BINUTILSDIR}/configure --target=${TARGET} --prefix=$INSTALL \ --disable-werror && \ make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-binutils.log 2>&1 @@ -405,7 +429,7 @@ j_binutils() make check >${LOGDIR}/${cpu}-binutils-check.log 2>&1 grep ^FAIL ${LOGDIR}/${cpu}-binutils-check.log cd .. - test ${do_cleanup} = "yes" && rm -rf b-${cpu}-binutils + test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-binutils ;; *) echo "Where do I get the binutils from?" @@ -456,9 +480,9 @@ j_gdb() source) echo "Building GDB from source" cd ${BASEDIR} - rm -rf b-${cpu}-gdb - mkdir b-${cpu}-gdb - cd b-${cpu}-gdb + rm -rf ${BUILDDIR}/b-${cpu}-gdb + mkdir ${BUILDDIR}/b-${cpu}-gdb + cd ${BUILDDIR}/b-${cpu}-gdb (${GDBDIR}/configure --target=${GDBTARGET} \ --enable-sim --enable-sim-hardware \ --disable-werror \ @@ -469,7 +493,7 @@ j_gdb() exit 1 fi cd .. - test ${do_cleanup} = "yes" && rm -rf b-${cpu}-gdb + test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-gdb ;; *) echo "Where do I get the gdb from?" @@ -487,26 +511,27 @@ fi j_native() { test ${do_native_ada} = "yes" && AdaArg=",ada" + test ${do_native_objc} = "yes" && ObjCArg=",objc" ${GCCDIR}/configure \ ${NATIVE_GCC_EXTRA_ARGS} \ --disable-werror \ - --enable-languages=c,c++${AdaArg} --prefix=$INSTALL && + --enable-languages=c,c++${AdaArg}${ObjCArg} --prefix=$INSTALL && make ${MAKEJOBS} && make install } if [ ${do_native} = "yes" ] ; then echo "Building native compiler..." cd ${BASEDIR} && \ - rm -rf b-native && \ - mkdir b-native && \ - cd b-native + rm -rf ${BUILDDIR}/b-native && \ + mkdir ${BUILDDIR}/b-native && \ + cd ${BUILDDIR}/b-native time j_native >${LOGDIR}/native.log 2>&1 if [ $? -ne 0 ] ; then echo "Failed to build native gcc" exit 1 fi cd .. - test ${do_cleanup} = "yes" && rm -rf b-native + test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-native else echo Skipping native fi @@ -573,9 +598,9 @@ j_gcc() if [ ${do_stage1} = "yes" ] ; then echo "Building Stage 1 compiler (C/C++)..." (cd ${BASEDIR} && \ - rm -rf b-${cpu}-gcc && \ - mkdir b-${cpu}-gcc && \ - cd b-${cpu}-gcc && \ + rm -rf ${BUILDDIR}/b-${cpu}-gcc && \ + mkdir ${BUILDDIR}/b-${cpu}-gcc && \ + cd ${BUILDDIR}/b-${cpu}-gcc && \ time j_gcc ${cpu} >${LOGDIR}/${cpu}-gcc.log 2>&1 && cd ..) || exit 1 else echo Skipping Stage 1 for ${cpu} @@ -587,7 +612,7 @@ j_rtems() { cpuArg=$1 bspArg=$2 - bspdir=b-${cpuArg}-${bspArg} + bspdir=${BUILDDIR}/b-${cpuArg}-${bspArg} cd ${BASEDIR} rm -rf ${bspdir} @@ -638,7 +663,8 @@ if [ ${do_rtems} = "yes" ] ; then echo "Failed to build RTEMS for ${cpu}/${bsp}" exit 1 fi - test ${do_cleanup} = "yes" && rm -rf b-${cpu}-${bsp} b-${cpu}-multilib + test ${do_cleanup} = "yes" && \ + rm -rf ${BUILDDIR}/b-${cpu}-${bsp} ${BUILDDIR}/b-${cpu}-multilib else echo Skipping RTEMS for ${cpu}/${bsp} fi @@ -647,7 +673,7 @@ pwd ##### Do the gcc tests if [ ${run_gcctests} = "yes" ] ; then echo "Running GCC Tests..." - cd ${BASEDIR}/b-${cpu}-gcc || exit 1 + cd ${BUILDDIR}/b-${cpu}-gcc || exit 1 time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gcc \ >${LOGDIR}/${cpu}-gcctests-${bsp}.log 2>&1 @@ -677,7 +703,7 @@ if [ ${run_gcctests} = "yes" ] ; then else echo Skipping GCC DejaGNU tests for ${cpu}/${bsp} fi -test ${do_cleanup} = "yes" && rm -rf b-${cpu}-gcc +test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-gcc ##### Build an Objective-C compiler now that we have a cross installed j_gccobjc() @@ -716,9 +742,9 @@ objc_fail="no" if [ ${do_objc} = "yes" ] ; then echo "Building Stage 2 cross Objective-C compiler for ${1} ..." (cd ${BASEDIR} && \ - rm -rf b-${cpu}-objc && \ - mkdir b-${cpu}-objc && \ - cd b-${cpu}-objc && \ + rm -rf ${BUILDDIR}/b-${cpu}-objc && \ + mkdir ${BUILDDIR}/b-${cpu}-objc && \ + cd ${BUILDDIR}/b-${cpu}-objc && \ time j_gccobjc ${cpu} >${LOGDIR}/${cpu}-objc.log 2>&1 && cd ..) || \ objc_fail="yes" else @@ -727,11 +753,11 @@ fi #### Run the Objective-C tests if [ ${run_objctests} = "yes" -a \ - -d ${BASEDIR}/b-${cpu}-objc -a ${objc_fail} = "no" ] ; then + -d ${BUILDDIR}/b-${cpu}-objc -a ${objc_fail} = "no" ] ; then echo "Running Objective-C Tests..." - cd ${BASEDIR}/b-${cpu}-gcc || exit 1 - time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gcc\ + cd ${BUILDDIR}/b-${cpu}-objc || exit 1 + time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} objc \ >${LOGDIR}/${cpu}-gcctests-${bsp}.log 2>&1 #RDIR=${RESULTSDIR}/${TARGET}-${bsp}/`date +%Y-%m-%d-%H-%M-%S` @@ -762,7 +788,7 @@ else fi if [ ${do_ada} = "yes" ] ; then - test ${do_cleanup} = "yes" && rm -rf b-${cpu}-ada + test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-ada fi ##### Build an Ada compiler now that we have a cross installed @@ -804,15 +830,16 @@ j_gccada() if [ $status -ne 0 ] ; then echo "Failed building Ada" fi + return $status } ada_fail="no" if [ ${do_ada} = "yes" ] ; then echo "Building Stage 2 cross Ada compiler for ${1} ..." (cd ${BASEDIR} && \ - rm -rf b-${cpu}-ada && \ - mkdir b-${cpu}-ada && \ - cd b-${cpu}-ada && \ + rm -rf ${BUILDDIR}/b-${cpu}-ada && \ + mkdir ${BUILDDIR}/b-${cpu}-ada && \ + cd ${BUILDDIR}/b-${cpu}-ada && \ time j_gccada ${cpu} >${LOGDIR}/${cpu}-ada.log 2>&1 && cd ..) || \ ada_fail="yes" else @@ -821,7 +848,7 @@ fi #### Run the Ada ACATS tests if [ ${run_acats} = "yes" -a \ - -d ${BASEDIR}/b-${cpu}-ada -a ${ada_fail} = "no" ] ; then + -d ${BUILDDIR}/b-${cpu}-ada -a ${ada_fail} = "no" ] ; then echo "Running ACATS..." cd ${GCCDIR}/gcc/testsuite/ada/acats/ || exit 1 @@ -844,7 +871,7 @@ else fi if [ ${do_ada} = "yes" ] ; then - test ${do_cleanup} = "yes" && rm -rf b-${cpu}-ada + test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-ada fi ##### Build a GCC Go compiler now that we have a cross installed @@ -899,9 +926,9 @@ go_fail="no" if [ ${do_gccgo} = "yes" ] ; then echo "Building Stage 2 cross GCC Go compiler for ${1} ..." (cd ${BASEDIR} && \ - rm -rf b-${cpu}-go && \ - mkdir b-${cpu}-go && \ - cd b-${cpu}-go && \ + rm -rf ${BUILDDIR}/b-${cpu}-go && \ + mkdir ${BUILDDIR}/b-${cpu}-go && \ + cd ${BUILDDIR}/b-${cpu}-go && \ time j_gccgo ${cpu} >${LOGDIR}/${cpu}-go.log 2>&1 && cd ..) || \ go_fail="yes" else @@ -910,9 +937,9 @@ fi ##### Do the gccgo tests if [ $a ${run_gccgotests} = "yes" -a \ - -d ${BASEDIR}/b-${cpu}-go -a ${go_fail} = "no" ] ; then + -d ${BUILDDIR}/b-${cpu}-go -a ${go_fail} = "no" ] ; then echo "Running GCC Go Tests..." - cd ${BASEDIR}/b-${cpu}-go/gcc || exit 1 + cd ${BUILDDIR}/b-${cpu}-go/gcc || exit 1 time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gccgo \ >${LOGDIR}/${cpu}-gccgotests-${bsp}.log 2>&1 @@ -942,22 +969,22 @@ fi ##### Do the libgo tests if [ $a ${run_libgotests} = "yes" -a \ - -d ${BASEDIR}/b-${cpu}-go -a ${go_fail} = "no" ] ; then + -d ${BUILDDIR}/b-${cpu}-go -a ${go_fail} = "no" ] ; then echo "Running libgo DejaGNU tests..." - cd ${BASEDIR}/b-${cpu}-go || exit 1 + cd ${BUILDDIR}/b-${cpu}-go || exit 1 time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} libgo \ >${LOGDIR}/${cpu}-libgotests-${bsp}.log 2>&1 RDIR=${RESULTSDIR}/${TARGET}-${bsp}/`date +%Y-%m-%d-%H-%M-%S` mkdir -p ${RDIR} - cp ${TARGET}-${bsp}/libgo/testsuite/libgo-all.log \ - ${TARGET}-${bsp}/libgo/testsuite/libgo-all.sum ${RDIR} + cp ${TARGET}/libgo/testsuite/libgo-all.log \ + ${TARGET}/libgo/testsuite/libgo-all.sum ${RDIR} else echo Skipping libgo DejaGNU tests for ${cpu}/${bsp} fi if [ ${do_gccgo} = "yes" ] ; then - test ${do_cleanup} = "yes" && rm -rf b-${cpu}-go + test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-go fi exit 0 @@ -1041,4 +1068,72 @@ fi if [ ${do_gcj} = "yes" ] ; then test ${do_cleanup} = "yes" && rm -rf b-${cpu}-gcj fi + +##### Build a FORTRAN compiler now that we have a cross installed +j_fortran() +{ + 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 + + ${GCCDIR}/configure \ + ${GCC_EXTRA_ARGS} \ + CFLAGS_FOR_TARGET="-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ ${F_FLAGS}" \ + --with-ppl=/users/joel/test-gcc/install-svn/ \ + --enable-threads=rtems --with-gnu-as \ + --with-gnu-ld --disable-newlib --verbose \ + --with-system-zlib --disable-nls \ + --enable-version-specific-runtime-libs \ + --enable-languages=c,fortran --target=$TARGET --prefix=$INSTALL && \ + make ${MAKEJOBS} && + make install + status=$? + if [ $status -ne 0 ] ; then + echo "Failed building FORTRAN" + fi + exit $status +} + +fortran_fail="no" +if [ ${do_fortran} = "yes" ] ; then + echo "Building Stage 2 cross GCC FORTRAN compiler for ${1} ..." + (cd ${BASEDIR} && \ + rm -rf b-${cpu}-fortran && \ + mkdir b-${cpu}-fortran && \ + cd b-${cpu}-fortran && \ + time j_fortran ${cpu} >${LOGDIR}/${cpu}-fortran.log 2>&1 && cd ..) || \ + fortran_fail="yes" +else + echo Skipping GCC FORTRAN compiler for ${cpu} +fi + +##### Do the FORTRAN tests +if [ $a ${run_fortrantests} = "yes" -a \ + -d ${BASEDIR}/b-${cpu}-fortran -a ${fortran_fail} = "no" ] ; then + echo "Running fortran DejaGNU tests..." + cd ${BASEDIR}/b-${cpu}-fortran || exit 1 + time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} fortran \ + >${LOGDIR}/${cpu}-fortrantests-${bsp}.log 2>&1 + + RDIR=${RESULTSDIR}/${TARGET}-${bsp}/`date +%Y-%m-%d-%H-%M-%S` + mkdir -p ${RDIR} + #cp ${TARGET}-${bsp}/libjava/testsuite/libjava-all.log \ + # ${TARGET}-${bsp}/libjava/testsuite/libjava-all.sum ${RDIR} +else + echo Skipping FORTRAN DejaGNU tests for ${cpu}/${bsp} +fi + +if [ ${do_fortran} = "yes" ] ; then + test ${do_cleanup} = "yes" && rm -rf b-${cpu}-fortran +fi + + + exit 0 |