From 90db2bb2c8529aad935dfa992936709b75e700ab Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 16 May 2017 00:09:43 +0200 Subject: Add --enable-ubsan/ENABLE_UBSAN for UndefinedBehaviorSanitizer UndefinedBehaviorSanitizer (UBSan) can catch a lot of issues (out-of-bounds memory access, integer overflows, undefined shifts, etc.) and is recommended during development using GCC or Clang. Add an option for it (similar to ASAN support). Change-Id: Ib0db50cee9eb5af0f5c4f06e07f3899a3a34702d Reviewed-on: https://code.wireshark.org/review/21673 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte Reviewed-by: Pascal Quantin Reviewed-by: Peter Wu --- configure.ac | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 29767774c1..b966aabbb6 100644 --- a/configure.ac +++ b/configure.ac @@ -786,6 +786,20 @@ AC_ARG_ENABLE(asan, AC_SUBST(NO_SANITIZE_CFLAGS) AC_SUBST(NO_SANITIZE_LDFLAGS) +# Try to enable UndefinedBehaviorSanitizer. +# +AC_ARG_ENABLE(ubsan, + AC_HELP_STRING( [--enable-ubsan], + [Enable UndefinedBehaviorSanitizer (UBSan) for debugging@<:@default=no@:>@]), +[ + # + # Available since Clang >= 3.3 and GCC >= 4.9 + # + # XXX shouldn't this also be added to LDFLAGS? + AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=undefined) + +]) + # Add check hf conflict.. # AC_ARG_ENABLE(checkhf-conflict, -- cgit v1.2.1