From df0f4c4666ee48d5992b9599e106bc5c80799538 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 18 Mar 2024 12:15:57 +1030 Subject: [PATCH] configure: disable ASAN for buggy clang. See https://github.com/llvm/llvm-project/issues/81470 which started breaking CI because configurator doesn't expect test programs to crash! Signed-off-by: Rusty Russell --- configure | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/configure b/configure index baed36e91..e7b91f880 100755 --- a/configure +++ b/configure @@ -294,18 +294,37 @@ done # Now fill in any unset vars. set_defaults -# We assume warning flags don't affect congfigurator that much! -echo -n "Compiling $CONFIGURATOR..." -$CC ${CWARNFLAGS-$BASE_WARNFLAGS} $CDEBUGFLAGS $COPTFLAGS -o $CONFIGURATOR $CONFIGURATOR.c -echo "done" - if [ "$ASAN" = "1" ]; then if [ "$VALGRIND" = "1" ]; then echo "Address sanitizer (ASAN) and valgrind cannot be enabled at the same time" exit 1 fi + + # Test for buggy clang https://github.com/llvm/llvm-project/issues/81470 + cat > /tmp/asan-test.$$.c </dev/null; then + echo "WARNING: ASAN compilatin bug detected: DISABLING" >&2 + CSANFLAGS=$(echo "$CSANFLAGS" | sed 's/-fsanitize=address//') + ASAN=0 + break + fi + done fi + +# We assume warning flags don't affect congfigurator that much! +echo -n "Compiling $CONFIGURATOR..." +$CC ${CWARNFLAGS-$BASE_WARNFLAGS} $CDEBUGFLAGS $COPTFLAGS -o $CONFIGURATOR $CONFIGURATOR.c +echo "done" + if [ "$CLANG_COVERAGE" = "1" ]; then case "$CC" in (*"clang"*)