提交 699affa1 authored 作者: Andrey Volk's avatar Andrey Volk 提交者: Mike Jerris

FS-11509: [Build-System] Fix --enable-address-sanitizer configure flag.

FS-11509: [Build-System] Fix unimrcp build with address sanitizer.
上级 143323e6
...@@ -449,19 +449,6 @@ elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then ...@@ -449,19 +449,6 @@ elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
fi fi
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 case "${ax_cv_c_compiler_vendor}" in
sun) sun)
VISIBILITY_FLAG=-xldscope=hidden VISIBILITY_FLAG=-xldscope=hidden
...@@ -1818,6 +1805,18 @@ AC_SUBST(SNMP_LIBS) ...@@ -1818,6 +1805,18 @@ AC_SUBST(SNMP_LIBS)
CHECK_ERLANG 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 # we never use this, and hard setting it will make cross compile work better
ac_cv_file_dbd_apr_dbd_mysql_c=no ac_cv_file_dbd_apr_dbd_mysql_c=no
......
...@@ -50,11 +50,14 @@ int main(void) { ...@@ -50,11 +50,14 @@ int main(void) {
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
error = getaddrinfo("127.0.0.1", NULL, &hints, &ai); error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
if (error) { if (error) {
freeaddrinfo(ai);
exit(1); exit(1);
} }
if (ai->ai_addr->sa_family != AF_INET) { if (ai->ai_addr->sa_family != AF_INET) {
freeaddrinfo(ai);
exit(1); exit(1);
} }
freeaddrinfo(ai);
exit(0); exit(0);
} }
],[ ],[
...@@ -92,12 +95,15 @@ AC_DEFUN([APR_CHECK_GETADDRINFO_ADDRCONFIG], [ ...@@ -92,12 +95,15 @@ AC_DEFUN([APR_CHECK_GETADDRINFO_ADDRCONFIG], [
int main(int argc, char **argv) { int main(int argc, char **argv) {
struct addrinfo hints, *ai; struct addrinfo hints, *ai;
int ret;
memset(&hints, 0, sizeof(hints)); memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_ADDRCONFIG; 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=yes],
[apr_cv_gai_addrconfig=no], [apr_cv_gai_addrconfig=no],
[apr_cv_gai_addrconfig=no])]) [apr_cv_gai_addrconfig=no])])
......
...@@ -136,7 +136,6 @@ AC_STRUCT_TM ...@@ -136,7 +136,6 @@ AC_STRUCT_TM
# Checks for library functions. # Checks for library functions.
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_FUNC_STRFTIME AC_FUNC_STRFTIME
#AC_CHECK_FUNCS([gethostname gettimeofday localtime_r memmove memset socket strcasecmp strchr strdup strncasecmp strstr]) #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_ ...@@ -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 AC_C_CONST
# Checks for library functions. # Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset memcpy malloc free]) AC_CHECK_FUNCS([memset memcpy malloc free])
AC_CHECK_FUNCS([usleep nanosleep]) AC_CHECK_FUNCS([usleep nanosleep])
AC_CHECK_FUNCS([fopen fread]) AC_CHECK_FUNCS([fopen fread])
......
...@@ -154,11 +154,6 @@ AC_FUNC_VPRINTF ...@@ -154,11 +154,6 @@ AC_FUNC_VPRINTF
AC_FUNC_MEMCMP AC_FUNC_MEMCMP
AC_FUNC_MEMMOVE AC_FUNC_MEMMOVE
if test "${ax_cv_c_compiler_vendor}" = "gnu"
then
AC_FUNC_REALLOC
AC_FUNC_MALLOC
fi
AC_FUNC_SELECT_ARGTYPES AC_FUNC_SELECT_ARGTYPES
AX_C99_FUNC_LRINT AX_C99_FUNC_LRINT
......
...@@ -190,6 +190,18 @@ AC_ARG_ENABLE(test-suites, ...@@ -190,6 +190,18 @@ AC_ARG_ENABLE(test-suites,
[enable_test_suites="$enableval"], [enable_test_suites="$enableval"],
[enable_test_suites="no"]) [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([TEST_SUITES],[test "${enable_test_suites}" != "no"])
AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin]) AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论