mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-13 04:52:39 +00:00
autotools: remove --enable-{asan,ubsan} in favor of --enable-sanitizers
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
d96134fa74
commit
5f40423627
29
configure.ac
29
configure.ac
@ -452,17 +452,24 @@ AC_ARG_ENABLE([static-binaries],
|
|||||||
[enable_static_binaries=$enableval], [enable_static_binaries=no])
|
[enable_static_binaries=$enableval], [enable_static_binaries=no])
|
||||||
AM_CONDITIONAL([ENABLE_STATIC_BINARIES], [test "x$enable_static_binaries" = "xyes"])
|
AM_CONDITIONAL([ENABLE_STATIC_BINARIES], [test "x$enable_static_binaries" = "xyes"])
|
||||||
|
|
||||||
# Build with ASAN commands
|
AC_ARG_ENABLE([sanitizers],
|
||||||
AC_ARG_ENABLE([asan],
|
[AS_HELP_STRING([--enable-sanitizers], [build with sanitizers enabled [default=no]])],
|
||||||
[AS_HELP_STRING([--enable-asan], [build with address sanitizer enabled [default=no]])],
|
[enable_sanitizers=$enableval], [enable_sanitizers=no])
|
||||||
[enable_asan=$enableval], [enable_asan=no])
|
AM_CONDITIONAL([ENABLE_SANITIZERS], [test "x$enable_sanitizers" = "xyes"])
|
||||||
AM_CONDITIONAL([ENABLE_ASAN], [test "x$enable_asan" = "xyes"])
|
if test "x$enable_sanitizers" = "xyes"; then
|
||||||
|
AC_DEFINE([ENABLE_SANITIZERS], 1, [build with sanitizers enabled])
|
||||||
|
|
||||||
# Build with UBSAN commands
|
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
|
||||||
AC_ARG_ENABLE([ubsan],
|
-fsanitize=address \
|
||||||
[AS_HELP_STRING([--enable-ubsan], [build with ubsan sanitizer enabled [default=no]])],
|
-fsanitize=undefined \
|
||||||
[enable_asan=$enableval], [enable_ubsan=no])
|
-fsanitize=memory \
|
||||||
AM_CONDITIONAL([ENABLE_UBSAN], [test "x$enable_ubsan" = "xyes"])
|
-fno-omit-frame-pointer])
|
||||||
|
AC_SUBST(AM_CFLAGS)
|
||||||
|
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
fi
|
||||||
|
|
||||||
# Optional test binaries
|
# Optional test binaries
|
||||||
AC_ARG_ENABLE([tests],
|
AC_ARG_ENABLE([tests],
|
||||||
@ -1104,7 +1111,7 @@ Documentation:
|
|||||||
- user documentation: $enable_doc
|
- user documentation: $enable_doc
|
||||||
|
|
||||||
Debugging:
|
Debugging:
|
||||||
- ASAN: $enable_asan
|
- Sanitizers: $enable_sanitizers
|
||||||
- Coverity: $enable_coverity_build
|
- Coverity: $enable_coverity_build
|
||||||
- mutex debugging: $enable_mutex_debugging
|
- mutex debugging: $enable_mutex_debugging
|
||||||
- tests: $enable_tests
|
- tests: $enable_tests
|
||||||
|
@ -260,14 +260,6 @@ liblxc_la_CFLAGS = -fPIC \
|
|||||||
$(AM_CFLAGS) \
|
$(AM_CFLAGS) \
|
||||||
$(LIBLXC_SANITIZER) \
|
$(LIBLXC_SANITIZER) \
|
||||||
-pthread
|
-pthread
|
||||||
if ENABLE_ASAN
|
|
||||||
liblxc_la_CFLAGS += -fsanitize=address \
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
endif
|
|
||||||
|
|
||||||
if ENABLE_UBSAN
|
|
||||||
liblxc_la_CFLAGS += -fsanitize=undefined
|
|
||||||
endif
|
|
||||||
|
|
||||||
liblxc_la_LDFLAGS = -pthread \
|
liblxc_la_LDFLAGS = -pthread \
|
||||||
-Wl,-no-undefined \
|
-Wl,-no-undefined \
|
||||||
|
Loading…
Reference in New Issue
Block a user