From 2e472ccaceb421f6ee83cc74ce90beb781beec37 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 21 Feb 2018 21:56:12 +0100 Subject: [PATCH] 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. --- configure.ac | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 ]) -- 2.39.5