Changeset 4659dc5 in rtems-testing


Ignore:
Timestamp:
Jan 8, 2013, 7:38:03 PM (6 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
30a5316
Parents:
96edb09
git-author:
Joel Sherrill <joel.sherrill@…> (01/08/13 19:38:03)
git-committer:
Joel Sherrill <joel.sherrill@…> (01/08/13 19:40:38)
Message:

gcc/do_one: Various rework

+ Separate secondary language options
+ Remove support for unarchiving gdb and binutils RPMs
+ Rework argument checking for native/cross
+ Add -B n for controlling number of parallel jobs

Now assume that if gcc support libraries like mpc, mpfr, isl, etc
are needed, they will be symbolically linked into the gcc source tree.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gcc/do_one

    r96edb09 r4659dc5  
    3232# Remove Build Directories
    3333do_cleanup=no
    34 # Install Binutils (from rpm or source)
     34# Install Binutils
    3535do_binutils=no
    36   do_binutils_method=source
    37 # Install GDB (from rpm or source)
     36# Install GDB
    3837do_gdb=no
    39   do_gdb_method=source
    4038# Build the native compiler?
    4139do_native=no
     
    5856        do_gcj_multilib=yes
    5957# Build the GCC FORTRAN language cross compiler.
    60 do_fortran=yes
     58do_fortran=no
    6159        do_fortran_multilib=yes
    6260# Build RTEMS for a particular CPU/BSP combination
     
    8078cat <<EOF
    8179do_one [options] CPU BSP
    82   -A - binutils, stage 1, C++, C/C++ multilib, Ada, GCC Go, ObjC, RTEMS
    83   -T - run GCC, Ada, GCC Go, and ObjC tests
    84   -A - binutils, stage 1, C++, C/C++ multilib, Ada, GCC Go, GCJ, RTEMS
    85   -T - run GCC, Ada, GCC Go and GCJ tests
    86   -b - install binutils (from source or copy installed RPM contents)
    87   -D - install gdb (from source or copy installed RPM contents)
    88   -n - native compiler
    89   -1 - stage 1 C/C++ compiler
    90   -c -   do not include C++
    91   -m -   do not build multilib
    92   -a - stage 2 Ada compiler
    93   -G - stage 2 GCC Go compiler
    94   -J - stage 2 GCC Java compiler
    95   -f - stage 2 GCC FORTRAN compiler
    96   -F - run FORTRAN tests
    97   -r - build RTEMS
    98   -g - run GCC C/C++ tests
    99   -C - run ACATS
    100   -d - do not clean up (delete build directories) (default=no)
    101   -v - verbose
    102   -M - do NOT email test results to gcc-testresults
    103   -O - Build Objective-C
    104   -P - Run Objective-C Tests
    105   -o - run GCC Go tests
    106   -t - run libgo tests
    107   -j - run libjava tests
     80  -A   - binutils, stage 1, C++, C/C++ multilib, RTEMS
     81  -S   - enable secondary languages of Ada, GCC Go, ObjC, FORTRAN
     82  -T   - run GCC tests for languages enabled
     83  -B n - build jobs in parallel (e.g. make -j N)
     84  -n   - native compiler
     85  -d   - do not clean up (delete build directories) (default=no)
     86  -M   - do NOT email test results to gcc-testresults
     87  -v   - verbose
     88
     89  Cross Compilation Options (Base and Primary Languages)
     90  ======================================================
     91    -b   - install binutils
     92    -D   - install gdb
     93    -1   - stage 1 C/C++ compiler
     94    -c   -   do not include C++
     95    -m   -   do not build multilib
     96    -r   - build RTEMS
     97    -g   - run GCC C/C++ tests
     98
     99
     100  Cross Compilation Options (Secondary Languages)
     101  ===============================================
     102    -a   - enable stage 2 Ada compiler
     103    -G   - enable stage 2 GCC Go compiler
     104    -J   - enable stage 2 GCC Java compiler
     105    -f   - enable stage 2 GCC FORTRAN compiler
     106    -F   - run FORTRAN tests
     107    -C   - run ACATS
     108    -O   - Build Objective-C
     109    -P   - Run Objective-C Tests
     110    -o   - run GCC Go tests
     111    -t   - run libgo tests
     112    -j   - run libjava tests
    108113EOF
    109114}
     
    124129}
    125130
    126 while getopts bdDnv1cmargiotCfFAJTMGOP OPT
     131while getopts bdDnv1cmargiotB:CfFAJTMGOPS OPT
    127132do
    128133    case "$OPT" in
     
    132137           do_cxx="yes"
    133138           do_multilib="yes"
     139           do_rtems="yes"
     140           ;;
     141        S) # Secondary languages need to be explicitly turned on
    134142           do_ada="yes"
    135143           do_gccgo="yes"
     
    137145           do_objc="yes"
    138146           do_fortran="yes"
    139            do_rtems="yes"
    140147           ;;
     148        B) MAKEJOBS="-j$OPTARG" ;;
    141149        d) do_cleanup=`toggle ${do_cleanup}` ;;
    142150        D) do_gdb=`toggle ${do_gdb}` ;;
     
    145153           run_acats="yes"
    146154           run_gccgotests="yes"
     155           run_fortrantests="yes"
    147156           ;;
    148         # unrpm binutils
    149157        b) do_binutils=`toggle ${do_binutils}` ;;
    150158        # Build the native
     
    177185
    178186run_libgotests=$run_gccgotests
     187
    179188########################### Grab CPU/BSP ###########################
    180 
    181189shiftcount=`expr $OPTIND - 1`
    182190shift $shiftcount
    183 
    184191cpu=${1}
    185192bsp=${2}
    186193
    187 # Which CPUs do not support C++
    188 if [ ${do_cxx} = "yes" ] ; then
    189   case ${cpu} in
    190     avr|h8300|m32c)
    191       do_cxx=no
    192       echo ${cpu} does not support C++
    193       ;;
    194     *);;
    195   esac
    196 fi
    197 
    198 # Which CPUs do not support Ada
    199 if [ ${do_ada} = "yes" ] ; then
    200   case ${cpu} in
    201     avr|h8300|m32c|sh)
    202       do_ada=no
    203       run_acats=no
    204       echo ${cpu} does not support Ada
    205       ;;
    206     *);;
    207   esac
    208 fi
    209 
    210 # Which CPUs do not support Go
    211 if [ ${do_gccgo} = "yes" ] ; then
    212   case ${cpu} in
    213     avr|h8300|m32c)
    214       do_gccgo=no
    215       echo ${cpu} does not support Go
    216       ;;
    217     *);;
    218   esac
    219 fi
    220 
    221 # Which CPUs do not support GCJ
    222 if [ ${do_gcj} = "yes" ] ; then
    223   case ${cpu} in
    224     avr|h8300|m32c)
    225       do_gcj=no
    226       echo ${cpu} does not support GCJ
    227       ;;
    228     *);;
    229   esac
    230 fi
    231 
    232 # Which CPUs do not support FORTRAN
    233 if [ ${do_fortran} = "yes" ] ; then
    234   case ${cpu} in
    235     arm|i386|m68k|mips|powerpc|sparc) ;;
    236     *)
    237       do_fortran=no
    238       echo ${cpu} does not support Ada
    239       ;;
    240   esac
     194needBSP=no
     195needCPU=no
     196
     197# If native or cross, check things differently
     198if [ ${do_native} = yes ] ; then
     199  if [ ${do_gccgo} = yes ] ; then
     200    echo "Warning! Go requires native C++ to build."
     201    do_cxx=yes
     202  fi
     203
     204  if [ ${do_gcj} = yes ] ; then
     205    echo "Warning! GCJ requires native C++ to build."
     206    do_cxx=yes
     207  fi
     208else # NOT NATIVE - build for RTEMS
     209  # Should the user have specified a CPU and/or BSP?
     210  if [ ${do_binutils} = yes -o ${do_gdb} = yes -o \
     211       ${do_stage1} = yes -o ${do_ada} = yes -o \
     212       ${do_gccgo} = yes -o ${do_gcj} = yes -o \
     213       ${do_fortran} = yes ] ; then
     214    needCPU=yes
     215  fi
     216
     217  if [ ${do_rtems} = yes -o ${run_gcctests} = yes -o \
     218       ${run_acats} = yes -o ${run_gccgotests} = yes -o \
     219       ${run_libjavatests} = yes ] ; then
     220    needBSP=yes
     221    needCPU=yes
     222    if [ x${bsp} = x ] ; then
     223      echo "BSP NOT SET"
     224      fatal
     225    fi
     226  fi
     227
     228  if [ ${needCPU} = yes -a x${cpu} = x ] ; then
     229    echo "CPU NOT SET"
     230    fatal
     231  fi
     232
     233  if [ ${needBSP} = yes -a x${bsp} = x ] ; then
     234    echo "BSP NOT SET"
     235    fatal
     236  fi
     237
     238  TARGET=${cpu}-rtems${RTEMS_VERSION}
     239
     240  # Which CPUs do not support C++
     241  if [ ${do_cxx} = "yes" ] ; then
     242    case ${cpu} in
     243      avr|h8300|m32c)
     244        do_cxx=no
     245        echo ${cpu} does not support C++
     246        ;;
     247      *);;
     248    esac
     249  fi
     250
     251  # Which CPUs do not support Ada
     252  if [ ${do_ada} = "yes" ] ; then
     253    case ${cpu} in
     254      avr|h8300|m32c|sh)
     255        do_ada=no
     256        run_acats=no
     257        echo ${cpu} does not support Ada
     258        ;;
     259      *);;
     260    esac
     261  fi
     262
     263  # Which CPUs do not support Go
     264  if [ ${do_gccgo} = "yes" ] ; then
     265    case ${cpu} in
     266      avr|h8300|m32c)
     267        do_gccgo=no
     268        echo ${cpu} does not support Go
     269        ;;
     270      *);;
     271    esac
     272  fi
     273
     274  # Which CPUs do not support GCJ
     275  if [ ${do_gcj} = "yes" ] ; then
     276    case ${cpu} in
     277      avr|h8300|m32c)
     278        do_gcj=no
     279        echo ${cpu} does not support GCJ
     280        ;;
     281      *);;
     282    esac
     283  fi
     284
     285  # Which CPUs do not support FORTRAN
     286  if [ ${do_fortran} = "yes" ] ; then
     287    case ${cpu} in
     288      arm|i386|m68k|mips|powerpc|sparc) ;;
     289      *)
     290        do_fortran=no
     291        echo ${cpu} does not support Ada
     292        ;;
     293    esac
     294  fi
    241295fi
    242296
     
    247301  echo "Binutils        : " ${do_binutils}
    248302  echo "GDB             : " ${do_gdb}
     303  echo "Make Jobs       : " ${MAKEJOBS}
    249304  echo "Build Native    : " ${do_native}
    250305  echo "Build Stage 1   : " ${do_stage1}
     
    274329fi
    275330
    276 # Should the user have specified a CPU and/or BSP?
    277 needBSP=no
    278 needCPU=no
    279 
    280 if [ ${do_binutils} = yes -o ${do_gdb} = yes -o \
    281      ${do_stage1} = yes -o ${do_ada} = yes -o \
    282      ${do_gccgo} = yes -o ${do_gcj} = yes -o \
    283      ${do_fortran} = yes ] ; then
    284   needCPU=yes
    285 fi
    286 
    287 if [ ${do_native} = yes -a ${do_gccgo} = yes ] ; then
    288   echo "Warning! Go requires native C++ to build."
    289   do_cxx=yes
    290 fi
    291 
    292 if [ ${do_native} = yes -a ${do_gcj} = yes ] ; then
    293   echo "Warning! GCJ requires native C++ to build."
    294   do_cxx=yes
    295 fi
    296 
    297 if [ ${do_rtems} = yes -o ${run_gcctests} = yes -o \
    298      ${run_acats} = yes -o ${run_gccgotests} = yes -o \
    299      ${run_libjavatests} = yes ] ; then
    300   needBSP=yes
    301   needCPU=yes
    302   if [ x${bsp} = x ] ; then
    303     echo "BSP NOT SET"
    304     fatal
    305   fi
    306 fi
    307 
    308 if [ ${needCPU} = yes -a x${cpu} = x ] ; then
    309   echo "CPU NOT SET"
    310   fatal
    311 fi
    312 
    313 if [ ${needBSP} = yes -a x${bsp} = x ] ; then
    314   echo "BSP NOT SET"
    315   fatal
    316 fi
    317 
    318 TARGET=${cpu}-rtems${RTEMS_VERSION}
    319 
    320331# Do we accept an alternate name for the BSP?
    321332if [ x${bsp} = xqemu ] ; then
     
    326337 
    327338######### Consistency check installation of source
    328 
    329339if [ ! -d ${GCCDIR}/newlib ] ; then
    330340  echo "${GCCDIR}/newlib not present"
     
    394404  cd ${INSTALL}/..
    395405 
    396   case ${do_binutils_method} in
    397     rpm)
    398       if [ ! -r /opt/rtems-${RTEMS_VERSION}/bin/${TARGET}-as ] ; then
    399          echo "Binutils RPMs not installed"
    400          exit 0
    401       fi
    402 
    403       echo "Extracting binutils from installed RPMs"
    404       DIR=`pwd`
    405       mkdir tmp-unrpm
    406       cd tmp-unrpm
    407       cd /
    408       for cpu in $*
    409       do
    410         pkg=`rpm -qf /opt/rtems-${RTEMS_VERSION}/bin/${TARGET}-as`
    411         rpm -ql $pkg | cpio -pvdum ${DIR}/tmp-unrpm
    412       done
    413       cd ${DIR}/tmp-unrpm/opt/rtems-${RTEMS_VERSION}
    414       find . | cpio -pdum ${INSTALL}
    415       cd ${DIR}
    416       rm -rf tmp-unrpm
    417       ;;
    418     source)
    419       echo "Building Binutils from source"
    420       rm -rf ${BUILDDIR}/b-${cpu}-binutils
    421       mkdir ${BUILDDIR}/b-${cpu}-binutils
    422       cd ${BUILDDIR}/b-${cpu}-binutils
    423       (${BINUTILSDIR}/configure --target=${TARGET} --prefix=$INSTALL \
    424         --disable-werror && \
    425         make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-binutils.log 2>&1
    426       if [ $? -ne 0 ] ; then
    427         echo "Failed to build Binutils from source"
    428         exit 1
    429       fi
    430       echo "Checking Binutils "
    431       make check >${LOGDIR}/${cpu}-binutils-check.log 2>&1
    432       grep ^FAIL ${LOGDIR}/${cpu}-binutils-check.log
    433       cd ..
    434       test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-binutils
    435       ;;
    436     *)
    437       echo "Where do I get the binutils from?"
    438       exit 1
    439       ;;
    440   esac
     406  echo "Building Binutils from source"
     407  rm -rf ${BUILDDIR}/b-${cpu}-binutils
     408  mkdir ${BUILDDIR}/b-${cpu}-binutils
     409  cd ${BUILDDIR}/b-${cpu}-binutils
     410  (${BINUTILSDIR}/configure --target=${TARGET} --prefix=$INSTALL \
     411    --disable-werror && \
     412    make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-binutils.log 2>&1
     413  if [ $? -ne 0 ] ; then
     414    echo "Failed to build Binutils from source"
     415    exit 1
     416  fi
     417  echo "Checking Binutils "
     418  make check >${LOGDIR}/${cpu}-binutils-check.log 2>&1
     419  grep ^FAIL ${LOGDIR}/${cpu}-binutils-check.log
     420  cd ..
     421  test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-binutils
    441422}
    442423
     
    458439  esac
    459440
    460   case ${do_gdb_method} in
    461     rpm)
    462       if [ ! -r /opt/rtems-${RTEMS_VERSION}/bin/${GDBTARGET}-gdb ] ; then
    463          echo "Binutils RPMs not installed"
    464          exit 0
    465       fi
    466 
    467       echo "Extracting gdb from installed RPMs"
    468       DIR=`pwd`
    469       mkdir tmp-unrpm
    470       cd tmp-unrpm
    471       cd /
    472       for cpu in $*
    473       do
    474         pkg=`rpm -qf /opt/rtems-${RTEMS_VERSION}/bin/${GDBTARGET}-gdb`
    475         rpm -ql $pkg | cpio -pvdum ${DIR}/tmp-unrpm
    476       done
    477       cd ${DIR}/tmp-unrpm/opt/rtems-${RTEMS_VERSION}
    478       find . | cpio -pdum ${INSTALL}
    479       cd ${DIR}
    480       rm -rf tmp-unrpm
    481       ;;
    482     source)
    483       echo "Building GDB from source"
    484       cd ${BASEDIR}
    485       rm -rf ${BUILDDIR}/b-${cpu}-gdb
    486       mkdir ${BUILDDIR}/b-${cpu}-gdb
    487       cd ${BUILDDIR}/b-${cpu}-gdb
    488       (${GDBDIR}/configure --target=${GDBTARGET} \
    489         --enable-sim --enable-sim-hardware \
    490         --disable-werror \
    491         --enable-timebase --enable-sim-trace  --prefix=$INSTALL && \
    492         make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-gdb.log 2>&1
    493       if [ $? -ne 0 ] ; then
    494         echo "Failed to build gdb from source"
    495         exit 1
    496       fi
    497       cd ..
    498       test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-gdb
    499       ;;
    500     *)
    501       echo "Where do I get the gdb from?"
    502       exit 1
    503       ;;
    504   esac
     441  echo "Building GDB from source"
     442  cd ${BASEDIR}
     443  rm -rf ${BUILDDIR}/b-${cpu}-gdb
     444  mkdir ${BUILDDIR}/b-${cpu}-gdb
     445  cd ${BUILDDIR}/b-${cpu}-gdb
     446  (${GDBDIR}/configure --target=${GDBTARGET} \
     447    --enable-sim --enable-sim-hardware \
     448    --disable-werror \
     449    --enable-timebase --enable-sim-trace  --prefix=$INSTALL && \
     450    make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-gdb.log 2>&1
     451  if [ $? -ne 0 ] ; then
     452    echo "Failed to build gdb from source"
     453    exit 1
     454  fi
     455  cd ..
     456  test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-gdb
    505457}
    506458
     
    574526    ${GCC_EXTRA_ARGS} \
    575527    --disable-werror \
    576    --enable-threads=rtems  --with-gnu-as ${multilib} \
    577    --enable-newlib-mb --enable-newlib-iconv \
    578    --with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
     528    --enable-threads=rtems  --with-gnu-as ${multilib} \
     529    --enable-newlib-mb --enable-newlib-iconv \
     530    --with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
    579531    --enable-version-specific-runtime-libs \
    580532    --enable-languages=c${cxx} --target=$TARGET --prefix=$INSTALL
Note: See TracChangeset for help on using the changeset viewer.