Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 814200 | Differences between
and this patch

Collapse All | Expand All

(-)a/scripts/gcc-plugin.sh (-2 / +1 lines)
Lines 8-14 srctree=$(dirname "$0") Link Here
8
gccplugins_dir=$($* -print-file-name=plugin)
8
gccplugins_dir=$($* -print-file-name=plugin)
9
9
10
# we need a c++ compiler that supports the designated initializer GNU extension
10
# we need a c++ compiler that supports the designated initializer GNU extension
11
$HOSTCC -c -x c++ -std=gnu++98 - -fsyntax-only -I $srctree/gcc-plugins -I $gccplugins_dir/include 2>/dev/null <<EOF
11
$HOSTCC -c -x c++ -std=gnu++11 - -fsyntax-only -I $srctree/gcc-plugins -I $gccplugins_dir/include 2>/dev/null <<EOF
12
#include "gcc-common.h"
12
#include "gcc-common.h"
13
class test {
13
class test {
14
public:
14
public:
15
- 
16
   gcc-plugins: fix gcc 11 indigestion with plugins...
15
   gcc-plugins: fix gcc 11 indigestion with plugins...
17
   
16
   
18
   Fedora Rawhide has started including gcc 11,and the g++ compiler
17
   Fedora Rawhide has started including gcc 11,and the g++ compiler
19
   throws a wobbly when it hits scripts/gcc-plugins:
18
   throws a wobbly when it hits scripts/gcc-plugins:
20
   
19
   
21
     HOSTCXX scripts/gcc-plugins/latent_entropy_plugin.so
20
     HOSTCXX scripts/gcc-plugins/latent_entropy_plugin.so
22
   In file included from /usr/include/c++/11/type_traits:35,
21
   In file included from /usr/include/c++/11/type_traits:35,
23
                    from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/system.h:244,
22
                    from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/system.h:244,
24
                    from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/gcc-plugin.h:28,
23
                    from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/gcc-plugin.h:28,
25
                    from scripts/gcc-plugins/gcc-common.h:7,
24
                    from scripts/gcc-plugins/gcc-common.h:7,
26
                    from scripts/gcc-plugins/latent_entropy_plugin.c:78:
25
                    from scripts/gcc-plugins/latent_entropy_plugin.c:78:
27
   /usr/include/c++/11/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO
26
   /usr/include/c++/11/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO
28
    C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
27
    C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
29
      32 | #error This file requires compiler and library support \
28
      32 | #error This file requires compiler and library support \
30
   
29
   
31
   In fact, it works just fine with c++11, which has been in gcc since 4.8,
30
   In fact, it works just fine with c++11, which has been in gcc since 4.8,
32
   and we now require 4.9 as a minimum.
31
   and we now require 4.9 as a minimum.
33
   
32
   
34
   Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
33
   Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
35
   Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
34
   Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
36
   Signed-off-by: Kees Cook <keescook@chromium.org>
35
   Signed-off-by: Kees Cook <keescook@chromium.org>
37
   Link: https://lore.kernel.org/r/82487.1609006918@turing-police
36
   Link: https://lore.kernel.org/r/82487.1609006918@turing-police
(-)a/scripts/gcc-plugins/Makefile (-2 / +2 lines)
Lines 22-30 always-y += $(GCC_PLUGIN) Link Here
22
GCC_PLUGINS_DIR = $(shell $(CC) -print-file-name=plugin)
22
GCC_PLUGINS_DIR = $(shell $(CC) -print-file-name=plugin)
23
23
24
plugin_cxxflags	= -Wp,-MMD,$(depfile) $(KBUILD_HOSTCXXFLAGS) -fPIC \
24
plugin_cxxflags	= -Wp,-MMD,$(depfile) $(KBUILD_HOSTCXXFLAGS) -fPIC \
25
		   -I $(GCC_PLUGINS_DIR)/include -I $(obj) -std=gnu++98 \
25
		   -I $(GCC_PLUGINS_DIR)/include -I $(obj) -std=gnu++11 \
26
		   -fno-rtti -fno-exceptions -fasynchronous-unwind-tables \
26
		   -fno-rtti -fno-exceptions -fasynchronous-unwind-tables \
27
		   -ggdb -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat \
27
		   -ggdb -Wno-narrowing -Wno-unused-variable \
28
		   -Wno-format-diag
28
		   -Wno-format-diag
29
29
30
plugin_ldflags	= -shared
30
plugin_ldflags	= -shared

Return to bug 814200