]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Allow sanitization compiler option
authorIgor Putovny <igor.putovny@nic.cz>
Tue, 24 Oct 2023 11:46:28 +0000 (13:46 +0200)
committerIgor Putovny <igor.putovny@nic.cz>
Thu, 30 May 2024 10:30:00 +0000 (12:30 +0200)
configure.ac

index 272837820277b0e6863a2c94bfd13fd4051b846f..973ca5467b643da4f9038ab22fcc109f8738a7bb 100644 (file)
@@ -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