aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2011-11-18 17:30:58 +0200
committerPekka Enberg <penberg@kernel.org>2011-11-19 10:46:30 +0200
commit6329d02b495b415dcac9f51300f7209a65ba80eb (patch)
tree212ac7f1474d7ee1cde60f863896c995c2c65bcd
parentbc367edabaf2503a20dfdd5f5912d9a4733424fa (diff)
downloadsparse-6329d02b495b415dcac9f51300f7209a65ba80eb.tar.gz
sparse, llvm: Make 'sparsec' error handling more robust
Make 'sparsec' more robust against SIGSEGV in Sparse/LLVM code so that 'make check' detects test breakage. Cc: Christopher Li <sparse@chrisli.org> Cc: Jeff Garzik <jgarzik@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rwxr-xr-xsparsec9
1 files changed, 8 insertions, 1 deletions
diff --git a/sparsec b/sparsec
index 1e5c8bd0..33e1a2b5 100755
--- a/sparsec
+++ b/sparsec
@@ -2,6 +2,8 @@
#
# GCC compatible C compiler based on Sparse LLVM
+set +e
+
SPARSEOPTS=""
DIRNAME=`dirname $0`
@@ -27,9 +29,12 @@ while [ $# -gt 0 ]; do
shift
done
+TMPLLVM=`mktemp -t tmp.XXXXXX`".llvm"
TMPFILE=`mktemp -t tmp.XXXXXX`".o"
-$DIRNAME/sparse-llvm $SPARSEOPTS | llc | as -o $TMPFILE
+$DIRNAME/sparse-llvm $SPARSEOPTS > $TMPLLVM
+
+llc $TMPLLVM | as -o $TMPFILE
if [ $NEED_LINK -eq 1 ]; then
if [ -z $OUTFILE ]; then
@@ -43,3 +48,5 @@ else
fi
mv $TMPFILE $OUTFILE
fi
+
+rm -f $TMPLLVM