#!/bin/bash set -eu function die() { echo "$@" 1>&2 exit 1 } ME="$(readlink -f "$0")" MYDIR="$(dirname "$ME")" TARGET_TRIPLE="$1" test -n "$TARGET_TRIPLE" || die "No target triple specified" # Check if cparser is available CPARSER=$(readlink -f "${MYDIR}/../../cparser/build/debug/cparser") || die "cparser missing" test -x "${CPARSER}" || die "cparser missing (expected at ${CPARSER})" # Synchronize spec files SOURCE="firm@i44sun3:/data1/firm/specinst" DESTDIR="/data1/$(whoami)" rsync -rsh=ssh -z --delete --recursive --links "$SOURCE" "${DESTDIR}/" || die "rsync failed" cd "${DESTDIR}/specinst" # Need to call "relocate" if the spec stuff ended up in a different directory # than the original installation (set +eu ; . shrc && bin/relocate) # Setup result directory rm -rf result # remove old symlink RESDIR="/ben/firm/public_html/nightly_spec_results/${TARGET_TRIPLE}" mkdir -p "${RESDIR}" || dir "Couldn't setup result dir" ln -sf "${RESDIR}" result || die "Couldn't setup result dir" SPEC_PY_FLAGS="--c-compiler=${CPARSER} --no-cpp --no-fortran --iterations=1" # Start spec differently on each architecture case "$TARGET_TRIPLE" in "i686-linux-gnu") SPEC_PY_FLAGS="$SPEC_PY_FLAGS --time-limit=1800" ;; "sparc-leon-linux-gnu") SPEC_PY_FLAGS="$SPEC_PY_FLAGS --time-limit=5400" SPEC_PY_FLAGS="$SPEC_PY_FLAGS --no-floating-point" SPEC_PY_FLAGS="$SPEC_PY_FLAGS --target-architecture=sparc" SPEC_PY_FLAGS="$SPEC_PY_FLAGS --c-compiler-args=-mtarget=sparc-leon-linux-gnu" SPEC_PY_FLAGS="$SPEC_PY_FLAGS --c-compiler-args=-msoft-float" SPEC_PY_FLAGS="$SPEC_PY_FLAGS --c-compiler-args=-static" SPEC_PY_FLAGS="$SPEC_PY_FLAGS --submit=qemu-sparc" SPEC_PY_FLAGS="$SPEC_PY_FLAGS --submit=-r" SPEC_PY_FLAGS="$SPEC_PY_FLAGS --submit=2.6.40" SPEC_PY_FLAGS="$SPEC_PY_FLAGS 164.gzip 176.gcc 181.mcf 186.crafty 197.parser 253.perlbmk 254.gap 255.vortex 256.bzip2" ;; *) echo "Architecture not yet supported (or maybe none was specified?)" exit 1 ;; esac ${MYDIR}/../spec.py --config-only $SPEC_PY_FLAGS > config/default.cfg (set +eu ; . shrc && runspec | tee log.txt) # Error handling #function handler() { # killall -q -9 -g runspec # killall -q -9 -g specinvoke # killall -q -9 cparser #} #SPEC_PY=$! #trap handler TERM KILL EXIT INT #wait $SPEC_PY # Grep for errors in the output ERR=$(grep --count Error log.txt) if [ $ERR -ne 0 ]; then exit 1 fi exit 0