Skip to content
Snippets Groups Projects
Commit 8c745226 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Adrien Béraud
Browse files

debug: allow easier enabling of ASAN for libjami and contrib builds

Change-Id: I0e142f271fa0db3c3d4af1e57919ef1f65beb8c2
parent 5028c30b
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,16 @@ AS_IF([test "x$enable_debug" = "xyes"],
[DAEMONCFLAGS+=" -DNDEBUG=1 -O3"
DAEMONCXXFLAGS+=" -DNDEBUG=1 -O3 -Wno-deprecated"])
dnl Build using address sanitizer
AC_ARG_ENABLE([asan],
AS_HELP_STRING([--enable-asan],
[Enable address sanitization]))
AS_IF([test "x$enable_asan" = "xyes"],
[DAEMONCXXFLAGS+=" -fsanitize=address -fno-omit-frame-pointer"
DAEMONLDFLAGS+=" -fsanitize=address"
AC_MSG_NOTICE([WARNING: Address sanitization enabled for libjami])], [])
AC_ARG_ENABLE([fuzzing],
AS_HELP_STRING([--enable-fuzzing],
[Build fuzzing tools]))
......
......@@ -26,8 +26,9 @@ usage()
echo " --prefix=PREFIX install files in PREFIX"
echo " --no-checksums don't verify checksums (allows to replace tarballs)"
echo " --disable-downloads don't download packages from the internet"
echo ' --cache-dir=DIR the directory where contrib tarballs are cached'
echo " --cache-dir=DIR the directory where contrib tarballs are cached"
echo " --enable-debug build with debug symbol and extra checks (disabled by default)"
echo " --enable-asan build with address sanitizer (disabled by default)"
echo " --disable-FOO configure to not build package FOO"
echo " --enable-FOO configure to build package FOO"
}
......@@ -39,6 +40,7 @@ PKGS_ENABLE=
PKGS_DISABLE=
CACHE_BUILD=
CONF_TARBALLS=
ENABLE_ASAN=
if test ! -f "../src/main.mak"
then
......@@ -72,6 +74,9 @@ do
--enable-debug)
ENABLE_DEBUG=1
;;
--enable-asan)
ENABLE_ASAN=1
;;
--host=*)
HOST="${1#--host=}"
;;
......@@ -136,6 +141,7 @@ CONF_TARBALLS := $CONF_TARBALLS
CACHE_DIR := $CACHE_DIR
CACHE_BUILD := $CACHE_BUILD
ENABLE_DEBUG := $ENABLE_DEBUG
ENABLE_ASAN := $ENABLE_ASAN
EOF
add_make()
......
......@@ -190,6 +190,12 @@ EXTRA_COMMON += -m32
endif
endif
ifdef ENABLE_ASAN
$(info Address sanitization enabled for contrib builds)
EXTRA_COMMON += -fsanitize=address
EXTRA_LDFLAGS += -fsanitize=address
endif
ifdef ENABLE_DEBUG
EXTRA_COMMON += -g -fno-omit-frame-pointer
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment