mirror of
https://github.com/cockpit-project/cockpit.git
synced 2026-11-03 21:49:50 -09:00
build: Add basic flags for address santizer
To use:
./autogen.sh --enable-asan=yes
(Currently don't have check for gcc > 4.8).
Closes #637
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
This commit is contained in:
parent
f5e057eb9e
commit
1265023af0
1 changed files with 18 additions and 0 deletions
18
configure.ac
18
configure.ac
|
|
@ -216,6 +216,23 @@ changequote([,])dnl
|
|||
|
||||
AC_CHECK_FUNCS(fdwalk)
|
||||
|
||||
# Address sanitizer
|
||||
|
||||
AC_MSG_CHECKING([for asan flags])
|
||||
AC_ARG_ENABLE(asan,
|
||||
AC_HELP_STRING([--enable-asan=no/yes],
|
||||
[Turn the Address Sanitizer on or off])
|
||||
)
|
||||
|
||||
if test "$enable_asan" = "yes"; then
|
||||
CFLAGS="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
|
||||
asan_status="yes"
|
||||
else
|
||||
asan_status="no"
|
||||
fi
|
||||
AM_CONDITIONAL(WITH_ASAN, test "$enable_asan" = "yes")
|
||||
AC_MSG_RESULT($asan_status)
|
||||
|
||||
# Debug
|
||||
|
||||
AC_MSG_CHECKING([for debug mode])
|
||||
|
|
@ -310,4 +327,5 @@ echo "
|
|||
Building api docs: ${enable_gtk_doc}
|
||||
Debug mode: ${debug_status}
|
||||
With coverage: ${enable_coverage}
|
||||
With address sanitizer: ${asan_status}
|
||||
"
|
||||
|
|
|
|||
Loading…
Reference in a new issue