From: Vincent Bernat Date: Wed, 21 Feb 2018 20:56:12 +0000 (+0100) Subject: build: don't enable sanitizers and safe-stack at the same time X-Git-Tag: 1.0.0~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e472ccaceb421f6ee83cc74ce90beb781beec37;p=thirdparty%2Flldpd.git build: don't enable sanitizers and safe-stack at the same time They are not compatible. At least on clang, they both try to instrument the same functions. --- diff --git a/configure.ac b/configure.ac index 5afe8f26..f198aa4d 100644 --- a/configure.ac +++ b/configure.ac @@ -109,10 +109,6 @@ if test x"$hardening" != x"no"; then AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2], [LLDP_CPPFLAGS]) - AX_LDFLAGS_OPTION([-fsanitize=safe-stack], [LLDP_BIN_LDFLAGS]) - if test x"$ax_cv_ld_check_flag__fsanitize_safe_stack" != x"no"; then - AX_CFLAGS_GCC_OPTION([-fsanitize=safe-stack], [LLDP_CFLAGS]) - fi fi if test x"$pie" = x"yes"; then AX_CFLAGS_GCC_OPTION([-fPIE], [LLDP_CFLAGS]) @@ -134,6 +130,11 @@ if test x"$sanitizers" != x; then LLDP_CFLAGS="$LLDP_CFLAGS $sanitizers" LLDP_LDFLAGS="$LLDP_LDFLAGS $sanitizers" AC_DEFINE([HAVE_ADDRESS_SANITIZER], 1, [Define if have both address and leak sanitizer]) +elif test x"$hardening" != x"no"; then + AX_LDFLAGS_OPTION([-fsanitize=safe-stack], [LLDP_BIN_LDFLAGS]) + if test x"$ax_cv_ld_check_flag__fsanitize_safe_stack" != x"no"; then + AX_CFLAGS_GCC_OPTION([-fsanitize=safe-stack], [LLDP_CFLAGS]) + fi fi ])