aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBruce Yinhe <[email protected]>2014-08-08 15:44:59 +0200
committerBruce Yinhe <[email protected]>2014-08-08 15:45:07 +0200
commitae4ba88c8b39fc340fff8f3f3fea2628bf8b292e (patch)
tree244b7c68c2cdd84f0b8e01277db36f80bddaa64c /erts
parente189bae81fbc873d3349b9dec12ef234daf9d8ad (diff)
parentcc894a72098322e12700e543297dc333b11951de (diff)
downloadotp-ae4ba88c8b39fc340fff8f3f3fea2628bf8b292e.tar.gz
otp-ae4ba88c8b39fc340fff8f3f3fea2628bf8b292e.tar.bz2
otp-ae4ba88c8b39fc340fff8f3f3fea2628bf8b292e.zip
Merge branch 'tuncer/sanitizers' into maint
OTP-12081 * tuncer/sanitizers: Implement --enable-sanitizers[=sanitizers]
Diffstat (limited to 'erts')
-rw-r--r--erts/configure.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/erts/configure.in b/erts/configure.in
index f66110b98b..40b335849c 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -4821,6 +4821,26 @@ if test "x$GCC" = xyes; then
fi
dnl ----------------------------------------------------------------------
+dnl Enable -fsanitize= flags.
+dnl ----------------------------------------------------------------------
+
+m4_define(DEFAULT_SANITIZERS, [address,undefined])
+AC_ARG_ENABLE(
+ sanitizers,
+ AS_HELP_STRING(
+ [--enable-sanitizers@<:@=comma-separated list of sanitizers@:>@],
+ [Default=DEFAULT_SANITIZERS]),
+[
+case "$enableval" in
+ no) sanitizers= ;;
+ yes) sanitizers="-fsanitize=DEFAULT_SANITIZERS" ;;
+ *) sanitizers="-fsanitize=$enableval" ;;
+esac
+CFLAGS="$CFLAGS $sanitizers"
+LDFLAGS="$LDFLAGS $sanitizers"
+])
+
+dnl ----------------------------------------------------------------------
dnl Output the result.
dnl ----------------------------------------------------------------------