FS-11509: [Build-System] Fix --enable-address-sanitizer configure flag.
FS-11509: [Build-System] Fix unimrcp build with address sanitizer.
This commit is contained in:
parent
143323e6ef
commit
699affa1ef
25
configure.ac
25
configure.ac
|
@ -449,19 +449,6 @@ elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Enable clang address sanitizer bit build
|
||||
AC_ARG_ENABLE(address_sanitizer,
|
||||
[AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
|
||||
[enable_address_sanitizer="$enable_address_sanitizer"],
|
||||
[enable_address_sanitizer="no"])
|
||||
|
||||
if test "${enable_address_sanitizer}" = "yes"; then
|
||||
APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer)
|
||||
APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer)
|
||||
APR_ADDTO(LDFLAGS, -fsanitize=address)
|
||||
fi
|
||||
|
||||
|
||||
case "${ax_cv_c_compiler_vendor}" in
|
||||
sun)
|
||||
VISIBILITY_FLAG=-xldscope=hidden
|
||||
|
@ -1818,6 +1805,18 @@ AC_SUBST(SNMP_LIBS)
|
|||
|
||||
CHECK_ERLANG
|
||||
|
||||
# Enable clang address sanitizer bit build
|
||||
AC_ARG_ENABLE(address_sanitizer,
|
||||
[AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
|
||||
[enable_address_sanitizer="$enable_address_sanitizer"],
|
||||
[enable_address_sanitizer="no"])
|
||||
|
||||
if test "${enable_address_sanitizer}" = "yes"; then
|
||||
APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer)
|
||||
APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer)
|
||||
APR_ADDTO(LDFLAGS, -fsanitize=address)
|
||||
fi
|
||||
|
||||
# we never use this, and hard setting it will make cross compile work better
|
||||
ac_cv_file_dbd_apr_dbd_mysql_c=no
|
||||
|
||||
|
|
|
@ -50,11 +50,14 @@ int main(void) {
|
|||
hints.ai_socktype = SOCK_STREAM;
|
||||
error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
|
||||
if (error) {
|
||||
freeaddrinfo(ai);
|
||||
exit(1);
|
||||
}
|
||||
if (ai->ai_addr->sa_family != AF_INET) {
|
||||
freeaddrinfo(ai);
|
||||
exit(1);
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
exit(0);
|
||||
}
|
||||
],[
|
||||
|
@ -92,12 +95,15 @@ AC_DEFUN([APR_CHECK_GETADDRINFO_ADDRCONFIG], [
|
|||
|
||||
int main(int argc, char **argv) {
|
||||
struct addrinfo hints, *ai;
|
||||
int ret;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_flags = AI_ADDRCONFIG;
|
||||
return getaddrinfo("localhost", NULL, &hints, &ai) != 0;
|
||||
ret = getaddrinfo("localhost", NULL, &hints, &ai) != 0;
|
||||
freeaddrinfo(ai);
|
||||
return ret;
|
||||
}], [apr_cv_gai_addrconfig=yes],
|
||||
[apr_cv_gai_addrconfig=no],
|
||||
[apr_cv_gai_addrconfig=no])])
|
||||
|
|
|
@ -136,7 +136,6 @@ AC_STRUCT_TM
|
|||
|
||||
# Checks for library functions.
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MALLOC
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_STRFTIME
|
||||
#AC_CHECK_FUNCS([gethostname gettimeofday localtime_r memmove memset socket strcasecmp strchr strdup strncasecmp strstr])
|
||||
|
|
|
@ -66,7 +66,6 @@ AC_CHECK_TYPES([int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,uint64_t,int64_
|
|||
AC_C_CONST
|
||||
|
||||
# Checks for library functions.
|
||||
AC_FUNC_MALLOC
|
||||
AC_CHECK_FUNCS([memset memcpy malloc free])
|
||||
AC_CHECK_FUNCS([usleep nanosleep])
|
||||
AC_CHECK_FUNCS([fopen fread])
|
||||
|
|
|
@ -154,11 +154,6 @@ AC_FUNC_VPRINTF
|
|||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_MEMMOVE
|
||||
|
||||
if test "${ax_cv_c_compiler_vendor}" = "gnu"
|
||||
then
|
||||
AC_FUNC_REALLOC
|
||||
AC_FUNC_MALLOC
|
||||
fi
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
|
||||
AX_C99_FUNC_LRINT
|
||||
|
|
|
@ -190,6 +190,18 @@ AC_ARG_ENABLE(test-suites,
|
|||
[enable_test_suites="$enableval"],
|
||||
[enable_test_suites="no"])
|
||||
|
||||
# Enable clang address sanitizer bit build
|
||||
AC_ARG_ENABLE(address_sanitizer,
|
||||
[AC_HELP_STRING([--enable-address-sanitizer],[build with address sanitizer])],
|
||||
[enable_address_sanitizer="$enable_address_sanitizer"],
|
||||
[enable_address_sanitizer="no"])
|
||||
|
||||
if test "${enable_address_sanitizer}" = "yes"; then
|
||||
APR_ADDTO(CFLAGS, -fsanitize=address -fno-omit-frame-pointer)
|
||||
APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer)
|
||||
APR_ADDTO(LDFLAGS, -fsanitize=address)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([TEST_SUITES],[test "${enable_test_suites}" != "no"])
|
||||
|
||||
AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
|
||||
|
|
Loading…
Reference in New Issue