1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Update: Add sanitizer helper to configure

This allows easily enabling a sanitizer by passing --with-sanitizer=
when configuring.
This commit is contained in:
Marvin Scholz 2018-07-09 07:38:52 +02:00
parent 0df3e0eda1
commit 449c9559b1

View File

@ -37,6 +37,35 @@ AM_MAINTAINER_MODE([enable])
LT_INIT
dnl Sanitizer flags
AC_ARG_WITH([sanitizer],
[AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
[build with sanitizer flags (default disabled)])],
[],
[with_sanitizer=no])
AS_VAR_IF(with_sanitizer, no, [], [
AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
], [
AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
])
AX_APPEND_FLAG([-g])
AS_IF([test -z "${with_sanitizer##*address*}" ], [
AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
])
AS_IF([test -z "${with_sanitizer##*memory*}" ], [
AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
])
AS_IF([test -z "${with_sanitizer##*thread*}" ], [
AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
])
])
dnl Check for attributes
AX_GCC_TYPE_ATTRIBUTE([transparent_union])