summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2014-11-09 10:43:56 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2014-12-16 13:18:42 +1100
commit4c7e1bd99ca8a6c2a4062cfcf9611395eda18392 (patch)
tree67aa8bdadd1a077d2dc1d01463dd5048cb953ac9
parent9410ca50752585653b653e655fe7cf64f29ae1ae (diff)
configure.ac : Add detection of -fsanitizer=undefined.
Both Clang and GCC-4.9 now support the undefined behaviour sanitizer so detect and enable it when configuring with --enable-sanitizer. Also improve configure reporting of sanitizer and stack smash protection.
-rw-r--r--configure.ac6
1 files changed, 5 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 52bc3e1..c01ff6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,7 +138,7 @@ AC_ARG_ENABLE(test-coverage,
AM_CONDITIONAL([ENABLE_TEST_COVERAGE], [test "$enable_test_coverage" = yes])
AC_ARG_ENABLE(sanitizer,
- AC_HELP_STRING([--sanitizer], [enable ggc/clang code sanitizier runtime checks]))
+ AC_HELP_STRING([--enable-sanitizer], [enable ggc/clang code sanitizier runtime checks]))
#====================================================================================
# Check types and their sizes.
@@ -579,11 +579,13 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
if test x$enable_sanitizer = "xyes" ; then
MN_ADD_CFLAGS([-fsanitize=address])
MN_ADD_CFLAGS([-fsanitize=integer])
+ MN_ADD_CFLAGS([-fsanitize=undefined])
# If we enable it for the C compiler we have to do it for the C++ compiler as well.
AC_LANG_PUSH([C++])
MN_ADD_CXXFLAGS([-fsanitize=address])
MN_ADD_CXXFLAGS([-fsanitize=integer])
+ MN_ADD_CXXFLAGS([-fsanitize=undefined])
AC_LANG_POP([C++])
fi
@@ -707,6 +709,8 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
echo " ** Compile with GCC version 3.X or above to avoid this problem."
fi
fi
+echo " Sanitizer enabled : ................... ${enable_sanitizer:-no}"
+echo " Stack smash protection : .............. ${enable_stack_smash_protection:-no}"
./echo-install-dirs