Changeset: 0f8a80ec5ca0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0f8a80ec5ca0
Modified Files:
        configure.ag
Branch: Jun2016
Log Message:

Implemented --enable-sanitizer option to configure.
Note, you can use --enable-sanitizer=address (default if no argument
given), or --enable-sanitizer=thread (or the other sanitizer options
that the compiler supports).  But you do need to have the correct
compiler support installed (libasan for the address sanitizer on Fedora).


diffs (52 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -292,6 +292,13 @@ AC_ARG_ENABLE(developer,
        enable_developer=$enableval,
        enable_developer=$dft_developer)
 
+dft_sanitizer=no
+AC_ARG_ENABLE(sanitizer,
+       AS_HELP_STRING([--enable-sanitizer],
+               [enable support for the GCC address sanitizer (default=no)]),
+       enable_sanitizer=$enableval,
+       enable_sanitizer=$dft_sanitizer)
+
 dnl The console is a direct client hooked onto the kernel with full
 dnl administrative privileges, bypassing any security checks.  It is
 dnl handy only during development.
@@ -751,6 +758,26 @@ yes-*-*)
        ;;
 esac
 fi
+if test "x$enable_sanitizer" != xno; then
+case "$GCC" in
+yes)
+       # if no specific sanitizer was specified, use address sanitizer
+       if test "x$enable_sanitizer" = xyes; then
+               MCHECK_ADD_FLAG([-fsanitize=address])
+       else
+               MCHECK_ADD_FLAG([-fsanitize=$enable_sanitizer])
+               if test "x$enable_sanitizer" = xthread; then
+                       X_CFLAGS="$X_CFLAGS -DNO_ATOMIC_INSTRUCTIONS"
+               fi
+       fi
+       MCHECK_ADD_FLAG([-fno-omit-frame-pointer])
+       ;;
+*)
+       AC_MSG_ERROR([--enable-sanitizer only supported with GCC])
+       ;;
+esac
+fi
+
 AC_SUBST(CFLAGS)
 AC_SUBST(X_CFLAGS)
 
@@ -3565,6 +3592,7 @@ for comp in \
        'debug     ' \
        'optimize  ' \
        'developer ' \
+       'sanitizer ' \
        'instrument' \
        'profile   ' \
 ; do
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to