From 78832f5fe380c5fcfd720012ecc45230640d7906 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sat, 10 Jan 2026 11:32:51 -0800 Subject: Add --undefined option to ./configure for UBSan checker. --- configure | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure b/configure index 872c50a..3770b03 100755 --- a/configure +++ b/configure @@ -92,6 +92,7 @@ warn=0 debug=0 address=0 memory=0 +undefined=0 insecure=0 unknown=0 old_cc="$CC" @@ -147,6 +148,7 @@ case "$1" in --sanitize) address=1; shift ;; --address) address=1; shift ;; --memory) memory=1; shift ;; + --undefined) undefined=1; shift ;; --insecure) insecure=1; shift ;; *) unknown=1; echo "unknown option ignored: $1" | tee -a configure.log; shift;; esac @@ -258,6 +260,9 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then if test $memory -eq 1; then CFLAGS="${CFLAGS} -g -fsanitize=memory -fno-omit-frame-pointer" fi + if test $undefined -eq 1; then + CFLAGS="${CFLAGS} -g -fsanitize=undefined -fno-omit-frame-pointer" + fi if test $insecure -eq 1; then CFLAGS="${CFLAGS} -DZLIB_INSECURE" fi -- cgit v1.2.3-55-g6feb