From d8a93ff67917fdc02f2539ba6f03edc09870f535 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 8 Sep 2014 20:01:10 +0300 Subject: In configure add option --enable-sanitize This option add run time checks for buffer overflows and some other memory related things. Not recommended for production. --- configure | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 52551bbe9..815b7d21a 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in f354000. +# From configure.in 3a79f91. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -701,6 +701,7 @@ enable_rdtsc enable_profiler enable_64bit enable_lto +enable_sanitize enable_renewal with_maxconn with_mysql @@ -1351,6 +1352,8 @@ Optional Features: --disable-64bit Enforce 32bit output on x86_64 systems. --enable-lto Enables or Disables Linktime Code Optimization (LTO is enabled by default) + --enable-sanitize Enables or Disables Sanitize Address Checking + (SANITIZE is disabled by default) --disable-renewal Disable Ragnarok Renewal support (override settings in src/config/renewal.h) @@ -3656,6 +3659,26 @@ fi +# +# adress sanitize +# +# Check whether --enable-sanitize was given. +if test "${enable_sanitize+set}" = set; then : + enableval=$enable_sanitize; + enable_sanitize="$enableval" + case $enableval in + "no");; + "yes");; + *) as_fn_error $? "invalid argument --enable-sanitize=$disableval... stopping" "$LINENO" 5;; + esac + +else + enable_sanitize="no" + +fi + + + # # Renewal # @@ -5007,6 +5030,54 @@ fi fi +# +# sanitize Support test +# +if test "$enable_sanitize" != "no" ; then + + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fsanitize=address" + + OLD_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -fsanitize=address" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fsanitize=address" >&5 +$as_echo_n "checking whether $CC supports -fsanitize=address... " >&6; } + if test "$cross_compiling" = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: guessing no" >&5 +$as_echo "guessing no" >&6; } + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int main(int argc, char **argv){ + return 0; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + + -- cgit v1.2.3-60-g2f50