diff configure @ 1754:076aca59192f

Use undefined behaviour sanitiser in debug mode
author Chris Cannam
date Thu, 07 Dec 2017 13:34:23 +0000
parents e4cf3ec06955
children 9db7ad441ea6
line wrap: on
line diff
--- a/configure	Tue Dec 05 14:29:23 2017 +0000
+++ b/configure	Thu Dec 07 13:34:23 2017 +0000
@@ -4425,9 +4425,10 @@
 
 if test "x$GCC" = "xyes"; then
    	CXXFLAGS_ANY="-std=c++11 -fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe"
-        CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -Werror"
+        CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -Werror -fsanitize=undefined"
    	CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0 -O3 -ffast-math"
    	CXXFLAGS_MINIMAL="$CXXFLAGS_ANY -g0 -O0"
+        LIBS_DEBUG="$LIBS -lubsan"
 fi
 
 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE"
@@ -4441,6 +4442,7 @@
 $as_echo "$as_me: enabling debug build" >&6;}
 QMAKE_CONFIG="debug"
 CXXFLAGS_BUILD="$CXXFLAGS_DEBUG"
+LIBS="$LIBS_DEBUG"
 SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"
 fi