From 45ba6bf28b75ee3391df83fbfb1060a50dc63d3a Mon Sep 17 00:00:00 2001 From: David Seifert Date: Thu, 3 Feb 2022 15:47:10 +0100 Subject: make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer * `-Werror` can cause issues when a more recent version of GCC compiles an older version: - https://bugs.gentoo.org/229059 - https://bugs.gentoo.org/475350 - https://bugs.gentoo.org/667104 libatomic/ChangeLog: * configure.ac: Support --disable-werror. * configure: Regenerate. libbacktrace/ChangeLog: * configure.ac: Support --disable-werror. * configure: Regenerate. libgomp/ChangeLog: * configure.ac: Support --disable-werror. * configure: Regenerate. libitm/ChangeLog: * configure.ac: Support --disable-werror. * configure: Regenerate. libsanitizer/ChangeLog: * configure.ac: Support --disable-werror. * aclocal.m4: Include also ../config/warnings.m4. * libbacktrace/Makefile.am (WARN_FLAGS): Remove. * configure: Regenerate. * Makefile.in: Regenerate. * asan/Makefile.in: Regenerate. * hwasan/Makefile.in: Regenerate. * interception/Makefile.in: Regenerate. * libbacktrace/Makefile.in: Regenerate. * lsan/Makefile.in: Regenerate. * sanitizer_common/Makefile.in: Regenerate. * tsan/Makefile.in: Regenerate. * ubsan/Makefile.in: Regenerate. Co-Authored-By: Jakub Jelinek --- libbacktrace/configure | 14 ++++++++++---- libbacktrace/configure.ac | 8 ++++---- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'libbacktrace') diff --git a/libbacktrace/configure b/libbacktrace/configure index a2f33c0f35d..17f470a4bec 100755 --- a/libbacktrace/configure +++ b/libbacktrace/configure @@ -801,6 +801,7 @@ with_gnu_ld enable_libtool_lock enable_largefile enable_cet +enable_werror with_system_libunwind enable_host_shared ' @@ -1448,6 +1449,7 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files --enable-cet enable Intel CET in target libraries [default=auto] + --disable-werror disable building with -Werror --enable-host-shared build host code as shared libraries --enable-cet enable Intel CET in host libraries [default=auto] @@ -11509,7 +11511,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11512 "configure" +#line 11514 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11615,7 +11617,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11618 "configure" +#line 11620 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12300,10 +12302,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "${with_target_subdir}"; then - WARN_FLAGS="$WARN_FLAGS -Werror" +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; fi +if test "x$enable_werror" != "xno" && test -n "${with_target_subdir}"; then : + WARN_FLAGS="$WARN_FLAGS -Werror" +fi if test -n "${with_target_subdir}"; then diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac index 0dfd82bc03e..597c9705db8 100644 --- a/libbacktrace/configure.ac +++ b/libbacktrace/configure.ac @@ -145,10 +145,10 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \ -Wmissing-format-attribute -Wcast-qual], [WARN_FLAGS]) -if test -n "${with_target_subdir}"; then - WARN_FLAGS="$WARN_FLAGS -Werror" -fi - +AC_ARG_ENABLE([werror], + [AS_HELP_STRING([--disable-werror], [disable building with -Werror])]) +AS_IF([test "x$enable_werror" != "xno" && test -n "${with_target_subdir}"], + [WARN_FLAGS="$WARN_FLAGS -Werror"]) AC_SUBST(WARN_FLAGS) if test -n "${with_target_subdir}"; then -- cgit v1.2.3