From c5ec0eb50f66f9379ac99e2c4ee4e5a9f6164e18 Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Tue, 24 Oct 2023 13:46:28 +0200 Subject: [PATCH] Allow sanitization compiler option --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 27283782..973ca546 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,12 @@ AC_ARG_ENABLE([memcheck], [enable_memcheck=yes] ) +AC_ARG_ENABLE([satan], + [AS_HELP_STRING([--enable-satan], [enable memory and undefined bahaviour sanitization @<:@no@:>@])], + [], + [enable_satan=no] +) + AC_ARG_ENABLE([compact-tries], [AS_HELP_STRING([--enable-compact-tries], [use 4-way tries instead of 16-way ones @<:@no@:>@])], [], @@ -425,6 +431,12 @@ if test "$enable_debug" = yes ; then fi fi +if test "$enable_satan" = yes; then + BIRD_CHECK_GCC_OPTION([bird_cv_c_option_satan_address], [-fsanitize=address], []) + BIRD_CHECK_GCC_OPTION([bird_cv_c_option_satan_undefined], [-fsanitize=undefined], []) + BIRD_CHECK_GCC_OPTION([bird_cv_c_option_satan_memory], [-fsanitize=memory], []) +fi + if test "$enable_compact_tries" = yes ; then AC_DEFINE([ENABLE_COMPACT_TRIES], [1], [Define to 1 if you want 4-way tries instead of 16-way ones.]) fi