aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-05-16 00:09:43 +0200
committerPeter Wu <peter@lekensteyn.nl>2017-05-16 10:38:50 +0000
commit90db2bb2c8529aad935dfa992936709b75e700ab (patch)
tree94866102d83cbbc766744c74c9b5ae01e93ff475 /configure.ac
parent924d1ecf6370c26bd31c08b922519a85669fa301 (diff)
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 <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 14 insertions, 0 deletions
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,