Commit 07ab46d3 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add sanitizer support for clang


Former-commit-id: 972a777ff245226ceb96c85bfb87cba5182827cf
parent a43cda7e
......@@ -151,7 +151,7 @@ if test "$enable_opt" = "yes" ; then
fi
# Add address sanitizer options to flags, if requested. Only useful for GCC
# version 4.8 and later.
# version 4.8 and later and clang.
AC_ARG_ENABLE([sanitizer],
[AS_HELP_STRING([--enable-sanitizer],
[Enable memory error detection using address sanitizer @<:@no/yes@:>@]
......@@ -164,9 +164,12 @@ if test "$enable_san" = "yes"; then
if test "$ax_cv_c_compiler_vendor" = "gnu"; then
AX_COMPARE_VERSION( $ax_cv_c_compiler_version, [ge], [4.8.0],
[enable_san="yes"], [enable_san="no"] )
if test "$enable_san" = "yes"; then
CFLAGS="$CFLAGS -fsanitize=address -fno-omit-frame-pointer"
fi
elif test "$ax_cv_c_compiler_vendor" = "clang"; then
AX_COMPARE_VERSION( $ax_cv_c_compiler_version, [ge], [3.2.0],
[enable_san="yes"], [enable_san="no"] )
fi
if test "$enable_san" = "yes"; then
CFLAGS="$CFLAGS -fsanitize=address -fno-omit-frame-pointer"
else
AC_MSG_WARN([Compiler does not support address sanitizer option])
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment