All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gcc-plugins:  fix gcc 11 indigestion with plugins...
@ 2020-12-26 18:21 Valdis Klētnieks
  2021-01-05 15:26 ` Josh Poimboeuf
  2021-01-06 23:09 ` Kees Cook
  0 siblings, 2 replies; 10+ messages in thread
From: Valdis Klētnieks @ 2020-12-26 18:21 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-hardening, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1705 bytes --]

Fedora Rawhide has started including gcc 11,and the g++ compiler
throws a wobbly when it hits scripts/gcc-plugins:

  HOSTCXX scripts/gcc-plugins/latent_entropy_plugin.so
In file included from /usr/include/c++/11/type_traits:35,
                 from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/system.h:244,
                 from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/gcc-plugin.h:28,
                 from scripts/gcc-plugins/gcc-common.h:7,
                 from scripts/gcc-plugins/latent_entropy_plugin.c:78:
/usr/include/c++/11/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO
 C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
   32 | #error This file requires compiler and library support \

In fact, it works just fine with c++11, which has been in gcc since 4.8,
and we now require 4.9 as a minimum.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>

diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile
index d66949bfeba4..b5487cce69e8 100644
--- a/scripts/gcc-plugins/Makefile
+++ b/scripts/gcc-plugins/Makefile
@@ -22,9 +22,9 @@ always-y += $(GCC_PLUGIN)
 GCC_PLUGINS_DIR = $(shell $(CC) -print-file-name=plugin)

 plugin_cxxflags	= -Wp,-MMD,$(depfile) $(KBUILD_HOSTCXXFLAGS) -fPIC \
-		   -I $(GCC_PLUGINS_DIR)/include -I $(obj) -std=gnu++98 \
+		   -I $(GCC_PLUGINS_DIR)/include -I $(obj) -std=gnu++11 \
 		   -fno-rtti -fno-exceptions -fasynchronous-unwind-tables \
-		   -ggdb -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat \
+		   -ggdb -Wno-narrowing -Wno-unused-variable \
 		   -Wno-format-diag

 plugin_ldflags	= -shared



[-- Attachment #2: Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] gcc-plugins:  fix gcc 11 indigestion with plugins...
  2020-12-26 18:21 [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins Valdis Klētnieks
@ 2021-01-05 15:26 ` Josh Poimboeuf
  2021-01-06 23:09 ` Kees Cook
  1 sibling, 0 replies; 10+ messages in thread
From: Josh Poimboeuf @ 2021-01-05 15:26 UTC (permalink / raw)
  To: Valdis Klētnieks; +Cc: Kees Cook, linux-hardening, linux-kernel

On Sat, Dec 26, 2020 at 01:21:58PM -0500, Valdis Klētnieks wrote:
> Fedora Rawhide has started including gcc 11,and the g++ compiler
> throws a wobbly when it hits scripts/gcc-plugins:
> 
>   HOSTCXX scripts/gcc-plugins/latent_entropy_plugin.so
> In file included from /usr/include/c++/11/type_traits:35,
>                  from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/system.h:244,
>                  from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/gcc-plugin.h:28,
>                  from scripts/gcc-plugins/gcc-common.h:7,
>                  from scripts/gcc-plugins/latent_entropy_plugin.c:78:
> /usr/include/c++/11/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO
>  C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
>    32 | #error This file requires compiler and library support \
> 
> In fact, it works just fine with c++11, which has been in gcc since 4.8,
> and we now require 4.9 as a minimum.
> 
> Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>

I'm also needing this.

Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>

-- 
Josh


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins...
  2020-12-26 18:21 [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins Valdis Klētnieks
  2021-01-05 15:26 ` Josh Poimboeuf
@ 2021-01-06 23:09 ` Kees Cook
  2021-01-11  9:47   ` Geert Uytterhoeven
  1 sibling, 1 reply; 10+ messages in thread
From: Kees Cook @ 2021-01-06 23:09 UTC (permalink / raw)
  To: Valdis Klētnieks
  Cc: Kees Cook, linux-hardening, linux-kernel, Josh Poimboeuf

On Sat, 26 Dec 2020 13:21:58 -0500, Valdis Klētnieks wrote:
> Fedora Rawhide has started including gcc 11,and the g++ compiler
> throws a wobbly when it hits scripts/gcc-plugins:
> 
>   HOSTCXX scripts/gcc-plugins/latent_entropy_plugin.so
> In file included from /usr/include/c++/11/type_traits:35,
>                  from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/system.h:244,
>                  from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/gcc-plugin.h:28,
>                  from scripts/gcc-plugins/gcc-common.h:7,
>                  from scripts/gcc-plugins/latent_entropy_plugin.c:78:
> /usr/include/c++/11/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO
>  C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
>    32 | #error This file requires compiler and library support \
> 
> [...]

Applied to for-linus/gcc-plugins, thanks!

[1/1] gcc-plugins: fix gcc 11 indigestion with plugins...
      https://git.kernel.org/kees/c/67a5a6801305

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins...
  2021-01-06 23:09 ` Kees Cook
@ 2021-01-11  9:47   ` Geert Uytterhoeven
  2021-01-11 10:56     ` Valdis Klētnieks
  0 siblings, 1 reply; 10+ messages in thread
From: Geert Uytterhoeven @ 2021-01-11  9:47 UTC (permalink / raw)
  To: Kees Cook
  Cc: Valdis Klētnieks, linux-hardening,
	Linux Kernel Mailing List, Josh Poimboeuf

Hi Kees, Valdis,

On Thu, Jan 7, 2021 at 12:11 AM Kees Cook <keescook@chromium.org> wrote:
> On Sat, 26 Dec 2020 13:21:58 -0500, Valdis Klētnieks wrote:
> > Fedora Rawhide has started including gcc 11,and the g++ compiler
> > throws a wobbly when it hits scripts/gcc-plugins:
> >
> >   HOSTCXX scripts/gcc-plugins/latent_entropy_plugin.so
> > In file included from /usr/include/c++/11/type_traits:35,
> >                  from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/system.h:244,
> >                  from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/gcc-plugin.h:28,
> >                  from scripts/gcc-plugins/gcc-common.h:7,
> >                  from scripts/gcc-plugins/latent_entropy_plugin.c:78:
> > /usr/include/c++/11/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO
> >  C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
> >    32 | #error This file requires compiler and library support \
> >
> > [...]
>
> Applied to for-linus/gcc-plugins, thanks!
>
> [1/1] gcc-plugins: fix gcc 11 indigestion with plugins...
>       https://git.kernel.org/kees/c/67a5a6801305

I guess this is the cause of the new "warning: invalid suffix on
literal; C++11 requires a space between literal and string macro
[-Wliteral-suffix]" with gcc 4.9 or 5.4?

https://lore.kernel.org/lkml/20210111094343.3948339-1-geert@linux-m68k.org

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins...
  2021-01-11  9:47   ` Geert Uytterhoeven
@ 2021-01-11 10:56     ` Valdis Klētnieks
  2021-01-11 11:02       ` Geert Uytterhoeven
  0 siblings, 1 reply; 10+ messages in thread
From: Valdis Klētnieks @ 2021-01-11 10:56 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Kees Cook, linux-hardening, Linux Kernel Mailing List, Josh Poimboeuf

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

On Mon, 11 Jan 2021 10:47:23 +0100, Geert Uytterhoeven said:

> I guess this is the cause of the new "warning: invalid suffix on
> literal; C++11 requires a space between literal and string macro
> [-Wliteral-suffix]" with gcc 4.9 or 5.4?

Well, we fixed a #error, and picked up a warning.  That's progress. ;)

It's probably related. I'm just having a hard time understanding why 4.9 and 5.4
whine about the lack of a space, while 8.3 and 11 didn't complain...

I'll see if I can cook up a patch that newer gcc are still happy with.  You able
to easily test with 4.9 or 5.4?




[-- Attachment #2: Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins...
  2021-01-11 10:56     ` Valdis Klētnieks
@ 2021-01-11 11:02       ` Geert Uytterhoeven
  2021-01-11 12:31         ` Valdis Klētnieks
  0 siblings, 1 reply; 10+ messages in thread
From: Geert Uytterhoeven @ 2021-01-11 11:02 UTC (permalink / raw)
  To: Valdis Klētnieks
  Cc: Kees Cook, linux-hardening, Linux Kernel Mailing List, Josh Poimboeuf

Hi Valdis,

On Mon, Jan 11, 2021 at 11:57 AM Valdis Klētnieks
<valdis.kletnieks@vt.edu> wrote:
> On Mon, 11 Jan 2021 10:47:23 +0100, Geert Uytterhoeven said:
> > I guess this is the cause of the new "warning: invalid suffix on
> > literal; C++11 requires a space between literal and string macro
> > [-Wliteral-suffix]" with gcc 4.9 or 5.4?
>
> Well, we fixed a #error, and picked up a warning.  That's progress. ;)
>
> It's probably related. I'm just having a hard time understanding why 4.9 and 5.4
> whine about the lack of a space, while 8.3 and 11 didn't complain...
>
> I'll see if I can cook up a patch that newer gcc are still happy with.  You able
> to easily test with 4.9 or 5.4?

No, I don't have 4.9 or 5.4 cross-compilers anymore.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins...
  2021-01-11 11:02       ` Geert Uytterhoeven
@ 2021-01-11 12:31         ` Valdis Klētnieks
  2021-01-11 13:37           ` Josh Poimboeuf
  0 siblings, 1 reply; 10+ messages in thread
From: Valdis Klētnieks @ 2021-01-11 12:31 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Kees Cook, linux-hardening, Linux Kernel Mailing List, Josh Poimboeuf

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

On Mon, 11 Jan 2021 05:56:59 -0500, I said:

> > It's probably related. I'm just having a hard time understanding why 4.9 and 5.4
> > whine about the lack of a space, while 8.3 and 11 didn't complain...

So after more digging, at least some clarity has surfaced.

It looks like it's not a kernel source tree issue, it's a g++ issue fixed in g++ 6 and later.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69959

And it looks like there was an intent to backport it to 4.9 and 5.4:
https://gcc.gnu.org/legacy-ml/gcc-patches/2016-02/msg01409.html

The bugtracker doesn't show an equivalent for 69959 being closed against 4.9.x or 5.[56],

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63254 has a patch for one of the
gcc-supplied files that tosses the warning, but that way lies madness...

Not sure what we want to do here - the main alternatives I see are:

Tell people still using 4.9/5.4 to either live with the warning or upgrade to 6 or later

Make the flag a variable and pass either -std=gnu++98 or -std=gnu++11
depending on the output of 'g++ --version'

What say the peanut gallery?

[-- Attachment #2: Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins...
  2021-01-11 12:31         ` Valdis Klētnieks
@ 2021-01-11 13:37           ` Josh Poimboeuf
  2021-01-11 19:48             ` Kees Cook
  0 siblings, 1 reply; 10+ messages in thread
From: Josh Poimboeuf @ 2021-01-11 13:37 UTC (permalink / raw)
  To: Valdis Klētnieks
  Cc: Geert Uytterhoeven, Kees Cook, linux-hardening,
	Linux Kernel Mailing List

On Mon, Jan 11, 2021 at 07:31:17AM -0500, Valdis Klētnieks wrote:
> On Mon, 11 Jan 2021 05:56:59 -0500, I said:
> 
> > > It's probably related. I'm just having a hard time understanding why 4.9 and 5.4
> > > whine about the lack of a space, while 8.3 and 11 didn't complain...
> 
> So after more digging, at least some clarity has surfaced.
> 
> It looks like it's not a kernel source tree issue, it's a g++ issue fixed in g++ 6 and later.
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69959
> 
> And it looks like there was an intent to backport it to 4.9 and 5.4:
> https://gcc.gnu.org/legacy-ml/gcc-patches/2016-02/msg01409.html
> 
> The bugtracker doesn't show an equivalent for 69959 being closed against 4.9.x or 5.[56],
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63254 has a patch for one of the
> gcc-supplied files that tosses the warning, but that way lies madness...
> 
> Not sure what we want to do here - the main alternatives I see are:
> 
> Tell people still using 4.9/5.4 to either live with the warning or upgrade to 6 or later
> 
> Make the flag a variable and pass either -std=gnu++98 or -std=gnu++11
> depending on the output of 'g++ --version'
> 
> What say the peanut gallery?

I think putting the flag in a variable (based on call cc-ifversion)
should be easy enough, then we can put this little saga behind us and
pretend it never happened :-)

-- 
Josh


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins...
  2021-01-11 13:37           ` Josh Poimboeuf
@ 2021-01-11 19:48             ` Kees Cook
  2021-01-11 19:55               ` Valdis Klētnieks
  0 siblings, 1 reply; 10+ messages in thread
From: Kees Cook @ 2021-01-11 19:48 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Valdis Klētnieks, Geert Uytterhoeven, linux-hardening,
	Linux Kernel Mailing List

On Mon, Jan 11, 2021 at 07:37:19AM -0600, Josh Poimboeuf wrote:
> On Mon, Jan 11, 2021 at 07:31:17AM -0500, Valdis Klētnieks wrote:
> > On Mon, 11 Jan 2021 05:56:59 -0500, I said:
> > 
> > > > It's probably related. I'm just having a hard time understanding why 4.9 and 5.4
> > > > whine about the lack of a space, while 8.3 and 11 didn't complain...
> > 
> > So after more digging, at least some clarity has surfaced.
> > 
> > It looks like it's not a kernel source tree issue, it's a g++ issue fixed in g++ 6 and later.
> > 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69959
> > 
> > And it looks like there was an intent to backport it to 4.9 and 5.4:
> > https://gcc.gnu.org/legacy-ml/gcc-patches/2016-02/msg01409.html
> > 
> > The bugtracker doesn't show an equivalent for 69959 being closed against 4.9.x or 5.[56],
> > 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63254 has a patch for one of the
> > gcc-supplied files that tosses the warning, but that way lies madness...
> > 
> > Not sure what we want to do here - the main alternatives I see are:
> > 
> > Tell people still using 4.9/5.4 to either live with the warning or upgrade to 6 or later
> > 
> > Make the flag a variable and pass either -std=gnu++98 or -std=gnu++11
> > depending on the output of 'g++ --version'
> > 
> > What say the peanut gallery?
> 
> I think putting the flag in a variable (based on call cc-ifversion)
> should be easy enough, then we can put this little saga behind us and
> pretend it never happened :-)

Yeah, that seems best. Valdis, can you send a patch for this?

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins...
  2021-01-11 19:48             ` Kees Cook
@ 2021-01-11 19:55               ` Valdis Klētnieks
  0 siblings, 0 replies; 10+ messages in thread
From: Valdis Klētnieks @ 2021-01-11 19:55 UTC (permalink / raw)
  To: Kees Cook
  Cc: Josh Poimboeuf, Geert Uytterhoeven, linux-hardening,
	Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

On Mon, 11 Jan 2021 11:48:32 -0800, Kees Cook said:
> On Mon, Jan 11, 2021 at 07:37:19AM -0600, Josh Poimboeuf wrote:

> > I think putting the flag in a variable (based on call cc-ifversion)
> > should be easy enough, then we can put this little saga behind us and
> > pretend it never happened :-)
>
> Yeah, that seems best. Valdis, can you send a patch for this?

Yep, I'll send one shortly...

[-- Attachment #2: Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-11 19:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-26 18:21 [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins Valdis Klētnieks
2021-01-05 15:26 ` Josh Poimboeuf
2021-01-06 23:09 ` Kees Cook
2021-01-11  9:47   ` Geert Uytterhoeven
2021-01-11 10:56     ` Valdis Klētnieks
2021-01-11 11:02       ` Geert Uytterhoeven
2021-01-11 12:31         ` Valdis Klētnieks
2021-01-11 13:37           ` Josh Poimboeuf
2021-01-11 19:48             ` Kees Cook
2021-01-11 19:55               ` Valdis Klētnieks

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.