From e9f948c72790136656df6056fd9e3698f360e077 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 27 Apr 2021 21:32:54 +0300 Subject: [PATCH] build: Convert warnings into errors when testing for -fstack-clash-protection When building with Clang, if `-fstack-clash-protection` is used with an unsupported target, it may result in hundreds of `-Wunused-command-line-argument` warnings at compile time. This is currently the case when building for at least Darwin using Apple or LLVM Clang. Unsupported targets may also include *BSD, however that is changing; see further discussion in https://reviews.llvm.org/D92245 and https://reviews.freebsd.org/D27366. Note that this option is already skipped for Windows. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d1707dfd64c..c02b2f3cbe5 100644 --- a/configure.ac +++ b/configure.ac @@ -894,7 +894,7 @@ if test x$use_hardening != xno; then dnl See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 for more details. ;; *) - AX_CHECK_COMPILE_FLAG([-fstack-clash-protection],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-clash-protection"]) + AX_CHECK_COMPILE_FLAG([-fstack-clash-protection], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-clash-protection"], [], [$CXXFLAG_WERROR]) ;; esac