summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-01 20:09:33 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-01 22:44:15 +0300
commitaa3c85dc48617dbdb565d33b294cad2931b5ac73 (patch)
tree43e3b12fa096309c2d78d7943022510df7c1a555 /configure.in
parent4e42c889ee50f233c61d7233a5361a83b51d5248 (diff)
downloadhercules-aa3c85dc48617dbdb565d33b294cad2931b5ac73.tar.gz
hercules-aa3c85dc48617dbdb565d33b294cad2931b5ac73.tar.bz2
hercules-aa3c85dc48617dbdb565d33b294cad2931b5ac73.tar.xz
hercules-aa3c85dc48617dbdb565d33b294cad2931b5ac73.zip
Add extended sanitify flags.
Configure option: --enable-sanitize=full
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in25
1 files changed, 19 insertions, 6 deletions
diff --git a/configure.in b/configure.in
index 1f2001981..3b5420c8b 100644
--- a/configure.in
+++ b/configure.in
@@ -300,9 +300,9 @@ AC_ARG_ENABLE(
AC_ARG_ENABLE(
[sanitize],
AC_HELP_STRING(
- [--enable-sanitize],
+ [--enable-sanitize@<:@=ARG@:>@],
[
- Enables or Disables Sanitize Address Checking (SANITIZE is disabled by default)
+ Sanitize: yes, no, full)
]
),
[
@@ -310,6 +310,7 @@ AC_ARG_ENABLE(
case $enableval in
"no");;
"yes");;
+ "full");;
*) AC_MSG_ERROR([[invalid argument --enable-sanitize=$disableval... stopping]]);;
esac
],
@@ -625,14 +626,25 @@ fi
# sanitize Support test
#
if test "$enable_sanitize" != "no" ; then
+ if test "$enable_sanitize" == "full" ; then
+ # skipped because server have multiply issues -fsanitize=alignment
+ SAN="-fsanitize=address \
+-fsanitize=shift -fsanitize=integer-divide-by-zero -fsanitize=unreachable \
+-fsanitize=vla-bound -fsanitize=null -fsanitize=return \
+-fsanitize=signed-integer-overflow -fsanitize=bounds \
+-fsanitize=object-size -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow \
+-fsanitize=nonnull-attribute -fsanitize=returns-nonnull-attribute -fsanitize=bool \
+-fsanitize=enum -fsanitize=vptr"
+ else
+ SAN="-fsanitize=address"
+ fi
OLD_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -fsanitize=address"
-
+ CFLAGS="$CFLAGS $SAN"
OLD_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -fsanitize=address"
+ LDFLAGS="$LDFLAGS $SAN"
- AC_MSG_CHECKING([whether $CC supports -fsanitize=address])
+ AC_MSG_CHECKING([whether $CC supports $SAN])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([
int main(int argc, char **argv){
@@ -651,6 +663,7 @@ if test "$enable_sanitize" != "no" ; then
AC_MSG_RESULT([guessing no])
]
)
+
fi