FS-11516 [build-system] Add --enable-pool-sanitizer configure flag. This will make it easier to find memory issues when using address sanitizer. Also added -fstack-protector-strong when using --enable-address-sanitizer.
This commit is contained in:
parent
8a809624cb
commit
892f0a289f
14
configure.ac
14
configure.ac
|
@ -1817,11 +1817,21 @@ AC_ARG_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(CFLAGS, -fsanitize=address -fno-omit-frame-pointer -fstack-protector-strong)
|
||||
APR_ADDTO(CXXFLAGS, -fsanitize=address -fno-omit-frame-pointer -fstack-protector-strong)
|
||||
APR_ADDTO(LDFLAGS, -fsanitize=address)
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(,
|
||||
[AC_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])],
|
||||
[enable_pool_sanitizer="$enable_pool_sanitizer"],
|
||||
[enable_pool_sanitizer="no"])
|
||||
|
||||
if test "${enable_pool_sanitizer}" = "yes"; then
|
||||
APR_ADDTO(CFLAGS, -DDESTROY_POOLS)
|
||||
ac_configure_args="$ac_configure_args --enable-pool-debug=yes"
|
||||
fi
|
||||
|
||||
# we never use this, and hard setting it will make cross compile work better
|
||||
ac_cv_file_dbd_apr_dbd_mysql_c=no
|
||||
|
||||
|
|
|
@ -507,6 +507,16 @@ static void free_proc_chain(struct process_chain *procs);
|
|||
static void pool_destroy_debug(apr_pool_t *pool, const char *file_line);
|
||||
#endif
|
||||
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
APR_DECLARE(void) apr_pool_mutex_set(apr_pool_t *pool,
|
||||
apr_thread_mutex_t *mutex)
|
||||
{
|
||||
pool->user_mutex = mutex;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !APR_POOL_DEBUG
|
||||
/*
|
||||
* Initialization
|
||||
|
@ -729,14 +739,6 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool)
|
|||
#endif
|
||||
}
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
APR_DECLARE(void) apr_pool_mutex_set(apr_pool_t *pool,
|
||||
apr_thread_mutex_t *mutex)
|
||||
{
|
||||
pool->user_mutex = mutex;
|
||||
}
|
||||
#endif
|
||||
|
||||
APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool)
|
||||
{
|
||||
apr_memnode_t *active;
|
||||
|
|
Loading…
Reference in New Issue