mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 10:52:56 +01:00
Problem: address sanitizer support in CI is hacky
Solution: import better solution from zproject and add a new autoconf option
This commit is contained in:
parent
6d76106cde
commit
11e2e5f6b5
@ -16,8 +16,7 @@ if [ $BUILD_TYPE == "default" ]; then
|
||||
CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}")
|
||||
|
||||
if [ -n "$ADDRESS_SANITIZER" ] && [ "$ADDRESS_SANITIZER" == "enabled" ]; then
|
||||
CONFIG_OPTS+=("CFLAGS=-fsanitize=address")
|
||||
CONFIG_OPTS+=("CXXFLAGS=-fsanitize=address")
|
||||
CONFIG_OPTS+=("--enable-address-sanitizer=yes")
|
||||
fi
|
||||
|
||||
if [ -z $CURVE ]; then
|
||||
|
16
configure.ac
16
configure.ac
@ -127,6 +127,22 @@ if test "x$zmq_militant" = "xyes"; then
|
||||
AC_DEFINE(ZMQ_ACT_MILITANT, 1, [Enable militant API assertions])
|
||||
fi
|
||||
|
||||
# Memory mis-use detection
|
||||
AC_MSG_CHECKING([whether to enable ASan])
|
||||
AC_ARG_ENABLE(address-sanitizer, [AS_HELP_STRING([--enable-address-sanitizer=yes/no],
|
||||
[Build with GCC Address Sanitizer instrumentation])],
|
||||
[ZMQ_ASAN="$enableval"])
|
||||
|
||||
if test "x${ZMQ_ASAN}" == "xyes"; then
|
||||
CFLAGS="${CFLAGS} -fsanitize=address"
|
||||
CXXFLAGS="${CXXFLAGS} -fsanitize=address"
|
||||
|
||||
AM_CONDITIONAL(ENABLE_ASAN, true)
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AM_CONDITIONAL(ENABLE_ASAN, false)
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
# By default compiling with -Werror except OSX.
|
||||
libzmq_werror="yes"
|
||||
|
Loading…
Reference in New Issue
Block a user