diff options
author | David Seifert <soap@gentoo.org> | 2022-02-03 15:47:10 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-02-03 16:10:18 +0100 |
commit | 45ba6bf28b75ee3391df83fbfb1060a50dc63d3a (patch) | |
tree | 486d5ac3c903b1c6f1ea43c0841e3773d72e8b55 /libsanitizer | |
parent | 1d5c7584fd6e72bfdbede86cef5ff04ae35f9744 (diff) | |
download | gcc-45ba6bf28b75ee3391df83fbfb1060a50dc63d3a.zip gcc-45ba6bf28b75ee3391df83fbfb1060a50dc63d3a.tar.gz gcc-45ba6bf28b75ee3391df83fbfb1060a50dc63d3a.tar.bz2 |
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 <jakub@redhat.com>
Diffstat (limited to 'libsanitizer')
-rw-r--r-- | libsanitizer/Makefile.in | 2 | ||||
-rw-r--r-- | libsanitizer/aclocal.m4 | 1 | ||||
-rw-r--r-- | libsanitizer/asan/Makefile.in | 2 | ||||
-rwxr-xr-x | libsanitizer/configure | 76 | ||||
-rw-r--r-- | libsanitizer/configure.ac | 10 | ||||
-rw-r--r-- | libsanitizer/hwasan/Makefile.in | 2 | ||||
-rw-r--r-- | libsanitizer/interception/Makefile.in | 2 | ||||
-rw-r--r-- | libsanitizer/libbacktrace/Makefile.am | 2 | ||||
-rw-r--r-- | libsanitizer/libbacktrace/Makefile.in | 5 | ||||
-rw-r--r-- | libsanitizer/lsan/Makefile.in | 2 | ||||
-rw-r--r-- | libsanitizer/sanitizer_common/Makefile.in | 2 | ||||
-rw-r--r-- | libsanitizer/tsan/Makefile.in | 2 | ||||
-rw-r--r-- | libsanitizer/ubsan/Makefile.in | 2 |
13 files changed, 103 insertions, 7 deletions
diff --git a/libsanitizer/Makefile.in b/libsanitizer/Makefile.in index 486c792..aab88de 100644 --- a/libsanitizer/Makefile.in +++ b/libsanitizer/Makefile.in @@ -108,6 +108,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ @@ -290,6 +291,7 @@ STRIP = @STRIP@ TSAN_TARGET_DEPENDENT_OBJECTS = @TSAN_TARGET_DEPENDENT_OBJECTS@ VERSION = @VERSION@ VIEW_FILE = @VIEW_FILE@ +WARN_FLAGS = @WARN_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/libsanitizer/aclocal.m4 b/libsanitizer/aclocal.m4 index 85f72c2..6aa1569 100644 --- a/libsanitizer/aclocal.m4 +++ b/libsanitizer/aclocal.m4 @@ -1195,6 +1195,7 @@ m4_include([../config/multi.m4]) m4_include([../config/override.m4]) m4_include([../config/stdint.m4]) m4_include([../config/toolexeclibdir.m4]) +m4_include([../config/warnings.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) m4_include([../ltversion.m4]) diff --git a/libsanitizer/asan/Makefile.in b/libsanitizer/asan/Makefile.in index e00927d..2476fbc 100644 --- a/libsanitizer/asan/Makefile.in +++ b/libsanitizer/asan/Makefile.in @@ -103,6 +103,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ @@ -344,6 +345,7 @@ STRIP = @STRIP@ TSAN_TARGET_DEPENDENT_OBJECTS = @TSAN_TARGET_DEPENDENT_OBJECTS@ VERSION = @VERSION@ VIEW_FILE = @VIEW_FILE@ +WARN_FLAGS = @WARN_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/libsanitizer/configure b/libsanitizer/configure index 08bdbc6..771b135 100755 --- a/libsanitizer/configure +++ b/libsanitizer/configure @@ -639,6 +639,7 @@ EXTRA_CXXFLAGS EXTRA_CFLAGS EXTRA_ASFLAGS get_gcc_base_ver +WARN_FLAGS SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS TSAN_TARGET_DEPENDENT_OBJECTS LIBBACKTRACE_SUPPORTED_FALSE @@ -816,6 +817,7 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock +enable_werror with_gcc_major_version_only enable_cet ' @@ -1469,6 +1471,7 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --disable-werror disable building with -Werror --enable-cet enable Intel CET in target libraries [default=auto] Optional Packages: @@ -12356,7 +12359,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12359 "configure" +#line 12362 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12462,7 +12465,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12465 "configure" +#line 12468 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16827,6 +16830,75 @@ fi +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +WARN_FLAGS= +save_CFLAGS="$CFLAGS" +for real_option in -Wextra -Wall -Wwrite-strings \ + -Wmissing-format-attribute -Wcast-qual; do + # Do the check with the no- prefix removed since gcc silently + # accepts any -Wno-* option on purpose + case $real_option in + -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;; + *) option=$real_option ;; + esac + as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 +$as_echo_n "checking whether $CC supports $option... " >&6; } +if eval \${$as_acx_Woption+:} false; then : + $as_echo_n "(cached) " >&6 +else + CFLAGS="$option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_acx_Woption=yes" +else + eval "$as_acx_Woption=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +eval ac_res=\$$as_acx_Woption + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then : + WARN_FLAGS="$WARN_FLAGS${WARN_FLAGS:+ }$real_option" +fi + done +CFLAGS="$save_CFLAGS" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +if test "x$enable_werror" != "xno"; then : + WARN_FLAGS="$WARN_FLAGS -Werror" +fi + + # Determine what GCC version number to use in filesystem paths. get_gcc_base_ver="cat" diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac index 13cd302..7f1ef39 100644 --- a/libsanitizer/configure.ac +++ b/libsanitizer/configure.ac @@ -400,6 +400,16 @@ fi AC_SUBST([TSAN_TARGET_DEPENDENT_OBJECTS]) AC_SUBST([SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS]) +AC_ARG_ENABLE([werror], + [AS_HELP_STRING([--disable-werror], [disable building with -Werror])]) + +ACX_PROG_CC_WARNING_OPTS([-Wextra -Wall -Wwrite-strings \ + -Wmissing-format-attribute -Wcast-qual], + [WARN_FLAGS]) +AS_IF([test "x$enable_werror" != "xno"], + [WARN_FLAGS="$WARN_FLAGS -Werror"]) +AC_SUBST([WARN_FLAGS]) + # Determine what GCC version number to use in filesystem paths. GCC_BASE_VER diff --git a/libsanitizer/hwasan/Makefile.in b/libsanitizer/hwasan/Makefile.in index 0021e78..67553f3 100644 --- a/libsanitizer/hwasan/Makefile.in +++ b/libsanitizer/hwasan/Makefile.in @@ -101,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ @@ -332,6 +333,7 @@ STRIP = @STRIP@ TSAN_TARGET_DEPENDENT_OBJECTS = @TSAN_TARGET_DEPENDENT_OBJECTS@ VERSION = @VERSION@ VIEW_FILE = @VIEW_FILE@ +WARN_FLAGS = @WARN_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/libsanitizer/interception/Makefile.in b/libsanitizer/interception/Makefile.in index c14d527..bce788a 100644 --- a/libsanitizer/interception/Makefile.in +++ b/libsanitizer/interception/Makefile.in @@ -99,6 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ @@ -262,6 +263,7 @@ STRIP = @STRIP@ TSAN_TARGET_DEPENDENT_OBJECTS = @TSAN_TARGET_DEPENDENT_OBJECTS@ VERSION = @VERSION@ VIEW_FILE = @VIEW_FILE@ +WARN_FLAGS = @WARN_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/libsanitizer/libbacktrace/Makefile.am b/libsanitizer/libbacktrace/Makefile.am index 16accd4..0cf8d21 100644 --- a/libsanitizer/libbacktrace/Makefile.am +++ b/libsanitizer/libbacktrace/Makefile.am @@ -34,8 +34,6 @@ ACLOCAL_AMFLAGS = -I ../.. -I ../../config AM_CPPFLAGS = -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \ -I ../../libgcc -I .. -I $(top_srcdir) -I $(top_srcdir)/../libbacktrace -WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \ - -Wcast-qual -Werror C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition CXX_WARN_FLAGS = $(WARN_FLAGS) -Wno-unused-parameter AM_CFLAGS = $(C_WARN_FLAGS) diff --git a/libsanitizer/libbacktrace/Makefile.in b/libsanitizer/libbacktrace/Makefile.in index f008f8e..ece4f11 100644 --- a/libsanitizer/libbacktrace/Makefile.in +++ b/libsanitizer/libbacktrace/Makefile.in @@ -130,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ @@ -312,6 +313,7 @@ STRIP = @STRIP@ TSAN_TARGET_DEPENDENT_OBJECTS = @TSAN_TARGET_DEPENDENT_OBJECTS@ VERSION = @VERSION@ VIEW_FILE = @VIEW_FILE@ +WARN_FLAGS = @WARN_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -385,9 +387,6 @@ ACLOCAL_AMFLAGS = -I ../.. -I ../../config AM_CPPFLAGS = -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \ -I ../../libgcc -I .. -I $(top_srcdir) -I $(top_srcdir)/../libbacktrace -WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \ - -Wcast-qual -Werror - C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition CXX_WARN_FLAGS = $(WARN_FLAGS) -Wno-unused-parameter AM_CFLAGS = $(C_WARN_FLAGS) $(EXTRA_CFLAGS) diff --git a/libsanitizer/lsan/Makefile.in b/libsanitizer/lsan/Makefile.in index 25ac00c..857f244 100644 --- a/libsanitizer/lsan/Makefile.in +++ b/libsanitizer/lsan/Makefile.in @@ -101,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ @@ -307,6 +308,7 @@ STRIP = @STRIP@ TSAN_TARGET_DEPENDENT_OBJECTS = @TSAN_TARGET_DEPENDENT_OBJECTS@ VERSION = @VERSION@ VIEW_FILE = @VIEW_FILE@ +WARN_FLAGS = @WARN_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/libsanitizer/sanitizer_common/Makefile.in b/libsanitizer/sanitizer_common/Makefile.in index 2f68f22..c4b009fe 100644 --- a/libsanitizer/sanitizer_common/Makefile.in +++ b/libsanitizer/sanitizer_common/Makefile.in @@ -105,6 +105,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ @@ -299,6 +300,7 @@ STRIP = @STRIP@ TSAN_TARGET_DEPENDENT_OBJECTS = @TSAN_TARGET_DEPENDENT_OBJECTS@ VERSION = @VERSION@ VIEW_FILE = @VIEW_FILE@ +WARN_FLAGS = @WARN_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in index a76b8d4..538d2e8 100644 --- a/libsanitizer/tsan/Makefile.in +++ b/libsanitizer/tsan/Makefile.in @@ -102,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ @@ -336,6 +337,7 @@ STRIP = @STRIP@ TSAN_TARGET_DEPENDENT_OBJECTS = @TSAN_TARGET_DEPENDENT_OBJECTS@ VERSION = @VERSION@ VIEW_FILE = @VIEW_FILE@ +WARN_FLAGS = @WARN_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/libsanitizer/ubsan/Makefile.in b/libsanitizer/ubsan/Makefile.in index ad75c67..497e033 100644 --- a/libsanitizer/ubsan/Makefile.in +++ b/libsanitizer/ubsan/Makefile.in @@ -101,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ + $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ @@ -301,6 +302,7 @@ STRIP = @STRIP@ TSAN_TARGET_DEPENDENT_OBJECTS = @TSAN_TARGET_DEPENDENT_OBJECTS@ VERSION = @VERSION@ VIEW_FILE = @VIEW_FILE@ +WARN_FLAGS = @WARN_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ |