From 9a52cf3d972cb19e95a26ab965e4d1c4b99bfdb7 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 22 May 2019 18:22:58 +0200 Subject: [PATCH] list-symbols.sh: if the build fails, print the build transcript If "make clean lib" fails in list-symbols.sh, print the transcript from running make. --- tests/scripts/list-symbols.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/scripts/list-symbols.sh b/tests/scripts/list-symbols.sh index c25871942..ffdce8f35 100755 --- a/tests/scripts/list-symbols.sh +++ b/tests/scripts/list-symbols.sh @@ -14,8 +14,20 @@ fi cp include/mbedtls/config.h include/mbedtls/config.h.bak scripts/config.pl full -CFLAGS=-fno-asynchronous-unwind-tables make clean lib >/dev/null 2>&1 +make_ret= +CFLAGS=-fno-asynchronous-unwind-tables make clean lib \ + >list-symbols.make.log 2>&1 || + { + make_ret=$? + echo "Build failure: CFLAGS=-fno-asynchronous-unwind-tables make clean lib" + cat list-symbols.make.log >&2 + } +rm list-symbols.make.log mv include/mbedtls/config.h.bak include/mbedtls/config.h +if [ -n "$make_ret" ]; then + exit "$make_ret" +fi + if uname | grep -F Darwin >/dev/null; then nm -gUj library/libmbed*.a 2>/dev/null | sed -n -e 's/^_//p' elif uname | grep -F Linux >/dev/null; then