* [PATCH v2] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
@ 2022-02-03 11:08 David Seifert
2022-02-03 11:23 ` Jonathan Wakely
0 siblings, 1 reply; 11+ messages in thread
From: David Seifert @ 2022-02-03 11:08 UTC (permalink / raw)
To: gcc-patches; +Cc: jakub, David Seifert
* `-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/configure.ac | 6 ++++--
libbacktrace/configure.ac | 7 ++++---
libgo/configure.ac | 8 ++++----
libgomp/configure.ac | 6 ++++--
libitm/configure.ac | 6 ++++--
libsanitizer/configure.ac | 9 +++++++++
libsanitizer/libbacktrace/Makefile.am | 2 --
7 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/libatomic/configure.ac b/libatomic/configure.ac
index f350b9b3509..c715d06fe8b 100644
--- a/libatomic/configure.ac
+++ b/libatomic/configure.ac
@@ -251,10 +251,12 @@ LIBAT_ENABLE_SYMVERS
CFLAGS="$save_CFLAGS"
AC_CACHE_SAVE
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
# Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+])
# Add CET specific flags if CET is enabled
GCC_CET_FLAGS(CET_FLAGS)
diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac
index 0dfd82bc03e..f18de946597 100644
--- a/libbacktrace/configure.ac
+++ b/libbacktrace/configure.ac
@@ -145,10 +145,11 @@ 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
+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"
-fi
-
+])
AC_SUBST(WARN_FLAGS)
if test -n "${with_target_subdir}"; then
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 1f4f32dae2b..11dd9a7fc21 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -62,11 +62,11 @@ AC_PROG_AWK
WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'
AC_SUBST(WARN_FLAGS)
-AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror],
- [turns on -Werror @<:@default=yes@:>@])])
-if test "x$enable_werror" != "xno"; then
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
WERROR="-Werror"
-fi
+])
AC_SUBST(WERROR)
glibgo_toolexecdir=no
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index bfb613b91f0..9b77c8f44e8 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -121,10 +121,12 @@ AC_SUBST(CFLAGS)
# in both places for now and restore CFLAGS at the end of config.
save_CFLAGS="$CFLAGS"
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
# Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+])
# Find other programs we need.
AC_CHECK_TOOL(AR, ar)
diff --git a/libitm/configure.ac b/libitm/configure.ac
index ac81b146845..616158f5c43 100644
--- a/libitm/configure.ac
+++ b/libitm/configure.ac
@@ -261,10 +261,12 @@ GCC_CHECK_ELF_STYLE_WEAKREF
CFLAGS="$save_CFLAGS"
AC_CACHE_SAVE
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
# Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+])
XCFLAGS="$XCFLAGS $XPCFLAGS"
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index 13cd302030d..432f05d160a 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -400,6 +400,15 @@ 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])])
+
+WARN_FLAGS="-Wextra -Wall -Wwrite-strings -Wmissing-format-attribute -Wcast-qual"
+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/libbacktrace/Makefile.am b/libsanitizer/libbacktrace/Makefile.am
index 16accd468df..0cf8d2104c0 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)
--
2.35.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 11:08 [PATCH v2] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer David Seifert
@ 2022-02-03 11:23 ` Jonathan Wakely
2022-02-03 11:27 ` David Seifert
2022-02-03 11:30 ` [PATCH v3] " David Seifert
0 siblings, 2 replies; 11+ messages in thread
From: Jonathan Wakely @ 2022-02-03 11:23 UTC (permalink / raw)
To: David Seifert; +Cc: gcc-patches, jakub
On 03/02/22 12:08 +0100, David Seifert wrote:
>* `-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
Honouring --disable-werror everywhere seems reasonable to me (but I
can't approve it).
It will need a ChangeLog in the Git commit message, of the form:
libatomic/ChangeLog:
* libatomic/configure.ac: Support --disable-werror.
* libatomic/configure: Regenerate.
libbacktrace/ChangeLog:
* libbacktrace/configure.ac: Support --disable-werror.
* libbacktrace/configure: Regenerate.
libgo/ChangeLog:
* libgo/configure.ac: Support --disable-werror.
* libgo/configure: Regenerate.
libgomp/ChangeLog:
* libgomp/configure.ac: Support --disable-werror.
* libgomp/configure: Regenerate.
libitm/ChangeLog:
* libitm/configure.ac: Support --disable-werror.
* libitm/configure: Regenerate.
libsanitizer/ChangeLog:
* libsanitizer/configure.ac: Support --disable-werror.
* libsanitizer/libbacktrace/Makefile.am (WARN_FLAGS): Remove.
And if you don't have an FSF assignment on file for GCC, you can
contribute it under the terms of https://gcc.gnu.org/dco.html (and if
you want to do that, please add the Signed-off-by: tag to indicate
you've understood those terms and agreed to them).
Is the hunk below removing the warning flags so that they use the ones
from the parent directory?
>diff --git a/libsanitizer/libbacktrace/Makefile.am b/libsanitizer/libbacktrace/Makefile.am
>index 16accd468df..0cf8d2104c0 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)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 11:23 ` Jonathan Wakely
@ 2022-02-03 11:27 ` David Seifert
2022-02-03 11:30 ` [PATCH v3] " David Seifert
1 sibling, 0 replies; 11+ messages in thread
From: David Seifert @ 2022-02-03 11:27 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc-patches, jakub
On Thu, 2022-02-03 at 11:23 +0000, Jonathan Wakely wrote:
> On 03/02/22 12:08 +0100, David Seifert wrote:
> > * `-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
>
> Honouring --disable-werror everywhere seems reasonable to me (but I
> can't approve it).
>
> It will need a ChangeLog in the Git commit message, of the form:
>
> libatomic/ChangeLog:
>
> * libatomic/configure.ac: Support --disable-werror.
> * libatomic/configure: Regenerate.
>
> libbacktrace/ChangeLog:
>
> * libbacktrace/configure.ac: Support --disable-werror.
> * libbacktrace/configure: Regenerate.
>
> libgo/ChangeLog:
>
> * libgo/configure.ac: Support --disable-werror.
> * libgo/configure: Regenerate.
>
> libgomp/ChangeLog:
>
> * libgomp/configure.ac: Support --disable-werror.
> * libgomp/configure: Regenerate.
>
> libitm/ChangeLog:
>
> * libitm/configure.ac: Support --disable-werror.
> * libitm/configure: Regenerate.
>
> libsanitizer/ChangeLog:
>
> * libsanitizer/configure.ac: Support --disable-werror.
> * libsanitizer/libbacktrace/Makefile.am (WARN_FLAGS): Remove.
>
>
> And if you don't have an FSF assignment on file for GCC, you can
> contribute it under the terms of https://gcc.gnu.org/dco.html (and if
> you want to do that, please add the Signed-off-by: tag to indicate
> you've understood those terms and agreed to them).
>
>
> Is the hunk below removing the warning flags so that they use the ones
> from the parent directory?
correct
> > diff --git a/libsanitizer/libbacktrace/Makefile.am
> > b/libsanitizer/libbacktrace/Makefile.am
> > index 16accd468df..0cf8d2104c0 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)
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 11:23 ` Jonathan Wakely
2022-02-03 11:27 ` David Seifert
@ 2022-02-03 11:30 ` David Seifert
2022-02-03 11:50 ` Jakub Jelinek
1 sibling, 1 reply; 11+ messages in thread
From: David Seifert @ 2022-02-03 11:30 UTC (permalink / raw)
To: gcc-patches; +Cc: jakub, David Seifert
* `-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:
* libatomic/configure.ac: Support --disable-werror.
* libatomic/configure: Regenerate.
libbacktrace/ChangeLog:
* libbacktrace/configure.ac: Support --disable-werror.
* libbacktrace/configure: Regenerate.
libgo/ChangeLog:
* libgo/configure.ac: Support --disable-werror.
* libgo/configure: Regenerate.
libgomp/ChangeLog:
* libgomp/configure.ac: Support --disable-werror.
* libgomp/configure: Regenerate.
libitm/ChangeLog:
* libitm/configure.ac: Support --disable-werror.
* libitm/configure: Regenerate.
libsanitizer/ChangeLog:
* libsanitizer/configure.ac: Support --disable-werror.
* libsanitizer/libbacktrace/Makefile.am (WARN_FLAGS): Remove.
---
libatomic/configure.ac | 6 ++++--
libbacktrace/configure.ac | 7 ++++---
libgo/configure.ac | 8 ++++----
libgomp/configure.ac | 6 ++++--
libitm/configure.ac | 6 ++++--
libsanitizer/configure.ac | 9 +++++++++
libsanitizer/libbacktrace/Makefile.am | 2 --
7 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/libatomic/configure.ac b/libatomic/configure.ac
index f350b9b3509..c715d06fe8b 100644
--- a/libatomic/configure.ac
+++ b/libatomic/configure.ac
@@ -251,10 +251,12 @@ LIBAT_ENABLE_SYMVERS
CFLAGS="$save_CFLAGS"
AC_CACHE_SAVE
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
# Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+])
# Add CET specific flags if CET is enabled
GCC_CET_FLAGS(CET_FLAGS)
diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac
index 0dfd82bc03e..f18de946597 100644
--- a/libbacktrace/configure.ac
+++ b/libbacktrace/configure.ac
@@ -145,10 +145,11 @@ 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
+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"
-fi
-
+])
AC_SUBST(WARN_FLAGS)
if test -n "${with_target_subdir}"; then
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 1f4f32dae2b..11dd9a7fc21 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -62,11 +62,11 @@ AC_PROG_AWK
WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'
AC_SUBST(WARN_FLAGS)
-AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror],
- [turns on -Werror @<:@default=yes@:>@])])
-if test "x$enable_werror" != "xno"; then
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
WERROR="-Werror"
-fi
+])
AC_SUBST(WERROR)
glibgo_toolexecdir=no
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index bfb613b91f0..9b77c8f44e8 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -121,10 +121,12 @@ AC_SUBST(CFLAGS)
# in both places for now and restore CFLAGS at the end of config.
save_CFLAGS="$CFLAGS"
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
# Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+])
# Find other programs we need.
AC_CHECK_TOOL(AR, ar)
diff --git a/libitm/configure.ac b/libitm/configure.ac
index ac81b146845..616158f5c43 100644
--- a/libitm/configure.ac
+++ b/libitm/configure.ac
@@ -261,10 +261,12 @@ GCC_CHECK_ELF_STYLE_WEAKREF
CFLAGS="$save_CFLAGS"
AC_CACHE_SAVE
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
# Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+])
XCFLAGS="$XCFLAGS $XPCFLAGS"
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index 13cd302030d..432f05d160a 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -400,6 +400,15 @@ 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])])
+
+WARN_FLAGS="-Wextra -Wall -Wwrite-strings -Wmissing-format-attribute -Wcast-qual"
+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/libbacktrace/Makefile.am b/libsanitizer/libbacktrace/Makefile.am
index 16accd468df..0cf8d2104c0 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)
--
2.35.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 11:30 ` [PATCH v3] " David Seifert
@ 2022-02-03 11:50 ` Jakub Jelinek
2022-02-03 11:59 ` David Seifert
0 siblings, 1 reply; 11+ messages in thread
From: Jakub Jelinek @ 2022-02-03 11:50 UTC (permalink / raw)
To: David Seifert; +Cc: gcc-patches
On Thu, Feb 03, 2022 at 12:30:11PM +0100, David Seifert wrote:
> * `-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:
>
> * libatomic/configure.ac: Support --disable-werror.
> * libatomic/configure: Regenerate.
>
> libbacktrace/ChangeLog:
>
> * libbacktrace/configure.ac: Support --disable-werror.
> * libbacktrace/configure: Regenerate.
>
> libgo/ChangeLog:
>
> * libgo/configure.ac: Support --disable-werror.
> * libgo/configure: Regenerate.
>
> libgomp/ChangeLog:
>
> * libgomp/configure.ac: Support --disable-werror.
> * libgomp/configure: Regenerate.
>
> libitm/ChangeLog:
>
> * libitm/configure.ac: Support --disable-werror.
> * libitm/configure: Regenerate.
>
> libsanitizer/ChangeLog:
>
> * libsanitizer/configure.ac: Support --disable-werror.
> * libsanitizer/libbacktrace/Makefile.am (WARN_FLAGS): Remove.
As Jonathan wrote, if you don't have a copyright assignment on file,
we need either that copyright assignment or the patch needs to be
submitted according to https://gcc.gnu.org/dco.html which is
expressed by Signed-off-by line in the mail and commit message.
> --- a/libsanitizer/configure.ac
> +++ b/libsanitizer/configure.ac
> @@ -400,6 +400,15 @@ 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])])
> +
> +WARN_FLAGS="-Wextra -Wall -Wwrite-strings -Wmissing-format-attribute -Wcast-qual"
This should be using
ACX_PROG_CC_WARNING_OPTS([-Wextra -Wall -Wwrite-strings \
-Wmissing-format-attribute -Wcast-qual],
[WARN_FLAGS])
instead.
Otherwise LGTM.
Jakub
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 11:50 ` Jakub Jelinek
@ 2022-02-03 11:59 ` David Seifert
2022-02-03 12:06 ` Jakub Jelinek
2022-02-04 2:09 ` [PATCH v3] " Hans-Peter Nilsson
0 siblings, 2 replies; 11+ messages in thread
From: David Seifert @ 2022-02-03 11:59 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc-patches
On Thu, 2022-02-03 at 12:50 +0100, Jakub Jelinek wrote:
> On Thu, Feb 03, 2022 at 12:30:11PM +0100, David Seifert wrote:
> > * `-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:
> >
> > * libatomic/configure.ac: Support --disable-werror.
> > * libatomic/configure: Regenerate.
> >
> > libbacktrace/ChangeLog:
> >
> > * libbacktrace/configure.ac: Support --disable-werror.
> > * libbacktrace/configure: Regenerate.
> >
> > libgo/ChangeLog:
> >
> > * libgo/configure.ac: Support --disable-werror.
> > * libgo/configure: Regenerate.
> >
> > libgomp/ChangeLog:
> >
> > * libgomp/configure.ac: Support --disable-werror.
> > * libgomp/configure: Regenerate.
> >
> > libitm/ChangeLog:
> >
> > * libitm/configure.ac: Support --disable-werror.
> > * libitm/configure: Regenerate.
> >
> > libsanitizer/ChangeLog:
> >
> > * libsanitizer/configure.ac: Support --disable-werror.
> > * libsanitizer/libbacktrace/Makefile.am (WARN_FLAGS):
> > Remove.
>
> As Jonathan wrote, if you don't have a copyright assignment on file,
> we need either that copyright assignment or the patch needs to be
> submitted according to https://gcc.gnu.org/dco.html which is
> expressed by Signed-off-by line in the mail and commit message.
>
I have an FSF copyright assignment, is there anything you need me to do
to this end?
> > --- a/libsanitizer/configure.ac
> > +++ b/libsanitizer/configure.ac
> > @@ -400,6 +400,15 @@ 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])])
> > +
> > +WARN_FLAGS="-Wextra -Wall -Wwrite-strings -Wmissing-format-
> > attribute -Wcast-qual"
>
> This should be using
> ACX_PROG_CC_WARNING_OPTS([-Wextra -Wall -Wwrite-strings \
> -Wmissing-format-attribute -Wcast-qual],
> [WARN_FLAGS])
> instead.
>
> Otherwise LGTM.
>
> Jakub
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 11:59 ` David Seifert
@ 2022-02-03 12:06 ` Jakub Jelinek
2022-02-03 14:06 ` [PATCH v4] " David Seifert
2022-02-04 2:09 ` [PATCH v3] " Hans-Peter Nilsson
1 sibling, 1 reply; 11+ messages in thread
From: Jakub Jelinek @ 2022-02-03 12:06 UTC (permalink / raw)
To: David Seifert; +Cc: gcc-patches
On Thu, Feb 03, 2022 at 12:59:43PM +0100, David Seifert wrote:
> I have an FSF copyright assignment, is there anything you need me to do
> to this end?
Ok.
> > > --- a/libsanitizer/configure.ac
> > > +++ b/libsanitizer/configure.ac
> > > @@ -400,6 +400,15 @@ 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])])
> > > +
> > > +WARN_FLAGS="-Wextra -Wall -Wwrite-strings -Wmissing-format-
> > > attribute -Wcast-qual"
> >
> > This should be using
> > ACX_PROG_CC_WARNING_OPTS([-Wextra -Wall -Wwrite-strings \
> > -Wmissing-format-attribute -Wcast-qual],
> > [WARN_FLAGS])
> > instead.
Then just this change and a note where and how it has been tested,
I can commit it afterwards for you.
Jakub
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 12:06 ` Jakub Jelinek
@ 2022-02-03 14:06 ` David Seifert
2022-02-03 15:16 ` Jakub Jelinek
2022-02-22 22:57 ` Ian Lance Taylor
0 siblings, 2 replies; 11+ messages in thread
From: David Seifert @ 2022-02-03 14:06 UTC (permalink / raw)
To: gcc-patches; +Cc: jakub, David Seifert
* `-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
Bootstrapped/regtested x86_64-linux, tested without --disable-werror and
with ./configure --disable-werror, the latter removing -Werror as expected.
libatomic/ChangeLog:
* libatomic/configure.ac: Support --disable-werror.
* libatomic/configure: Regenerate.
libbacktrace/ChangeLog:
* libbacktrace/configure.ac: Support --disable-werror.
* libbacktrace/configure: Regenerate.
libgo/ChangeLog:
* libgo/configure.ac: Support --disable-werror.
* libgo/configure: Regenerate.
libgomp/ChangeLog:
* libgomp/configure.ac: Support --disable-werror.
* libgomp/configure: Regenerate.
libitm/ChangeLog:
* libitm/configure.ac: Support --disable-werror.
* libitm/configure: Regenerate.
libsanitizer/ChangeLog:
* libsanitizer/configure.ac: Support --disable-werror.
* libsanitizer/libbacktrace/Makefile.am (WARN_FLAGS): Remove.
---
libatomic/configure.ac | 6 ++++--
libbacktrace/configure.ac | 7 ++++---
libgo/configure.ac | 8 ++++----
libgomp/configure.ac | 6 ++++--
libitm/configure.ac | 6 ++++--
libsanitizer/configure.ac | 11 +++++++++++
libsanitizer/libbacktrace/Makefile.am | 2 --
7 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/libatomic/configure.ac b/libatomic/configure.ac
index f350b9b3509..c715d06fe8b 100644
--- a/libatomic/configure.ac
+++ b/libatomic/configure.ac
@@ -251,10 +251,12 @@ LIBAT_ENABLE_SYMVERS
CFLAGS="$save_CFLAGS"
AC_CACHE_SAVE
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
# Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+])
# Add CET specific flags if CET is enabled
GCC_CET_FLAGS(CET_FLAGS)
diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac
index 0dfd82bc03e..f18de946597 100644
--- a/libbacktrace/configure.ac
+++ b/libbacktrace/configure.ac
@@ -145,10 +145,11 @@ 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
+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"
-fi
-
+])
AC_SUBST(WARN_FLAGS)
if test -n "${with_target_subdir}"; then
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 1f4f32dae2b..11dd9a7fc21 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -62,11 +62,11 @@ AC_PROG_AWK
WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'
AC_SUBST(WARN_FLAGS)
-AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror],
- [turns on -Werror @<:@default=yes@:>@])])
-if test "x$enable_werror" != "xno"; then
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
WERROR="-Werror"
-fi
+])
AC_SUBST(WERROR)
glibgo_toolexecdir=no
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index bfb613b91f0..9b77c8f44e8 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -121,10 +121,12 @@ AC_SUBST(CFLAGS)
# in both places for now and restore CFLAGS at the end of config.
save_CFLAGS="$CFLAGS"
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
# Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+])
# Find other programs we need.
AC_CHECK_TOOL(AR, ar)
diff --git a/libitm/configure.ac b/libitm/configure.ac
index ac81b146845..616158f5c43 100644
--- a/libitm/configure.ac
+++ b/libitm/configure.ac
@@ -261,10 +261,12 @@ GCC_CHECK_ELF_STYLE_WEAKREF
CFLAGS="$save_CFLAGS"
AC_CACHE_SAVE
+AC_ARG_ENABLE([werror], [
+ AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
# Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"], [
XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+])
XCFLAGS="$XCFLAGS $XPCFLAGS"
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index 13cd302030d..e422a36333c 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -400,6 +400,17 @@ 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/libbacktrace/Makefile.am b/libsanitizer/libbacktrace/Makefile.am
index 16accd468df..0cf8d2104c0 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)
--
2.35.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 14:06 ` [PATCH v4] " David Seifert
@ 2022-02-03 15:16 ` Jakub Jelinek
2022-02-22 22:57 ` Ian Lance Taylor
1 sibling, 0 replies; 11+ messages in thread
From: Jakub Jelinek @ 2022-02-03 15:16 UTC (permalink / raw)
To: David Seifert; +Cc: gcc-patches
On Thu, Feb 03, 2022 at 03:06:07PM +0100, David Seifert wrote:
> * `-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
Now committed as https://gcc.gnu.org/r12-7027-g45ba6bf28b75ee33
but I had to make quite a few changes, most importantly
ACX_PROG_CC_WARNING_OPTS wasn't defined so it remained as is, had to adjust
aclocal.m4. Also, split the cases that were adding -Wall -Werror
together to add -Wall if gcc and -Werror if gcc and not --disable-werror.
And the --help texts had really weird formatting, so had to tweak that too.
Jakub
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 11:59 ` David Seifert
2022-02-03 12:06 ` Jakub Jelinek
@ 2022-02-04 2:09 ` Hans-Peter Nilsson
1 sibling, 0 replies; 11+ messages in thread
From: Hans-Peter Nilsson @ 2022-02-04 2:09 UTC (permalink / raw)
To: David Seifert; +Cc: Jakub Jelinek, gcc-patches
On Thu, 3 Feb 2022, David Seifert via Gcc-patches wrote:
> On Thu, 2022-02-03 at 12:50 +0100, Jakub Jelinek wrote:
> > On Thu, Feb 03, 2022 at 12:30:11PM +0100, David Seifert wrote:
> > > * `-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:
> > >
> > > ??????? * libatomic/configure.ac: Support --disable-werror.
> > > ??????? * libatomic/configure: Regenerate.
> > >
> > > libbacktrace/ChangeLog:
> > >
> > > ??????? * libbacktrace/configure.ac: Support --disable-werror.
> > > ??????? * libbacktrace/configure: Regenerate.
> > >
> > > libgo/ChangeLog:
> > >
> > > ??????? * libgo/configure.ac: Support --disable-werror.
> > > ??????? * libgo/configure: Regenerate.
> > >
> > > libgomp/ChangeLog:
> > >
> > > ??????? * libgomp/configure.ac: Support --disable-werror.
> > > ??????? * libgomp/configure: Regenerate.
> > >
> > > libitm/ChangeLog:
> > >
> > > ??????? * libitm/configure.ac: Support --disable-werror.
> > > ??????? * libitm/configure: Regenerate.
> > >
> > > libsanitizer/ChangeLog:
> > >
> > > ??????? * libsanitizer/configure.ac: Support --disable-werror.
> > > ??????? * libsanitizer/libbacktrace/Makefile.am (WARN_FLAGS):
> > > Remove.
> >
> > As Jonathan wrote, if you don't have a copyright assignment on file,
> > we need either that copyright assignment or the patch needs to be
> > submitted according to https://gcc.gnu.org/dco.html?which is
> > expressed by Signed-off-by line in the mail and commit message.
> >
>
> I have an FSF copyright assignment, is there anything you need me to do
> to this end?
Perhaps that assignment is still being processed, or under
another name not matching Seifert? I couldn't find an entry
case-insensitively matching that in a freshly retrieved
copyright.list.
brgds, H-P
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
2022-02-03 14:06 ` [PATCH v4] " David Seifert
2022-02-03 15:16 ` Jakub Jelinek
@ 2022-02-22 22:57 ` Ian Lance Taylor
1 sibling, 0 replies; 11+ messages in thread
From: Ian Lance Taylor @ 2022-02-22 22:57 UTC (permalink / raw)
To: David Seifert; +Cc: gcc-patches, jakub
On Thu, Feb 3, 2022 at 6:07 AM David Seifert via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> * `-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
>
> Bootstrapped/regtested x86_64-linux, tested without --disable-werror and
> with ./configure --disable-werror, the latter removing -Werror as expected.
>
> libgo/ChangeLog:
>
> * libgo/configure.ac: Support --disable-werror.
> * libgo/configure: Regenerate.
Just a note that the libgo directory is copied from upstream sources,
and should not be changed directly in the GCC repo. See
libgo/README.gcc. I'll take care of this discrepancy. Thanks.
Ian
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2022-02-22 22:57 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03 11:08 [PATCH v2] Make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer David Seifert
2022-02-03 11:23 ` Jonathan Wakely
2022-02-03 11:27 ` David Seifert
2022-02-03 11:30 ` [PATCH v3] " David Seifert
2022-02-03 11:50 ` Jakub Jelinek
2022-02-03 11:59 ` David Seifert
2022-02-03 12:06 ` Jakub Jelinek
2022-02-03 14:06 ` [PATCH v4] " David Seifert
2022-02-03 15:16 ` Jakub Jelinek
2022-02-22 22:57 ` Ian Lance Taylor
2022-02-04 2:09 ` [PATCH v3] " Hans-Peter Nilsson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).