]> git.ipfire.org Git - people/arne_f/ipfire-2.x.git/commitdiff
kernel: fix gcc plugin build with gcc-11
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 30 Jun 2021 06:36:10 +0000 (08:36 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 5 Jul 2021 05:42:39 +0000 (07:42 +0200)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
lfs/linux
src/patches/linux/linux-5.10.45-fix_gcc_plugins_with_gcc11.patch [new file with mode: 0644]

index 303de77149422909f931980294a35584e8510144..114936ad4715099eff88307672145f6c2b2df540 100644 (file)
--- a/lfs/linux
+++ b/lfs/linux
@@ -138,6 +138,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        # fix Boot with enabled usercopy hardening
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-5.9-crypto_testmgr_allocate_buffers_with____GFP_COMP.patch
 
+       # fix gcc plugins with gcc11
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-5.10.45-fix_gcc_plugins_with_gcc11.patch
+
 ifeq "$(BUILD_ARCH)" "armv6l"
        # Apply Arm-multiarch kernel patches.
        cd $(DIR_APP) && xzcat $(DIR_DL)/arm-multi-patches-$(ARM_PATCHES).patch.xz | patch -Np1
diff --git a/src/patches/linux/linux-5.10.45-fix_gcc_plugins_with_gcc11.patch b/src/patches/linux/linux-5.10.45-fix_gcc_plugins_with_gcc11.patch
new file mode 100644 (file)
index 0000000..f48239c
--- /dev/null
@@ -0,0 +1,27 @@
+diff -Naur linux-5.10.45.org/scripts/gcc-plugins/Makefile linux-5.10.45/scripts/gcc-plugins/Makefile
+--- linux-5.10.45.org/scripts/gcc-plugins/Makefile     2021-06-18 10:00:06.000000000 +0200
++++ linux-5.10.45/scripts/gcc-plugins/Makefile 2021-06-22 13:36:30.108527243 +0200
+@@ -22,9 +22,9 @@
+ 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
+diff -Naur linux-5.10.45.org/scripts/gcc-plugin.sh linux-5.10.45/scripts/gcc-plugin.sh
+--- linux-5.10.45.org/scripts/gcc-plugin.sh    2021-06-18 10:00:06.000000000 +0200
++++ linux-5.10.45/scripts/gcc-plugin.sh        2021-06-22 17:24:20.138602697 +0200
+@@ -8,7 +8,7 @@
+ gccplugins_dir=$($* -print-file-name=plugin)
+ # we need a c++ compiler that supports the designated initializer GNU extension
+-$HOSTCC -c -x c++ -std=gnu++98 - -fsyntax-only -I $srctree/gcc-plugins -I $gccplugins_dir/include 2>/dev/null <<EOF
++$HOSTCC -c -x c++ -std=gnu++11 - -fsyntax-only -I $srctree/gcc-plugins -I $gccplugins_dir/include 2>/dev/null <<EOF
+ #include "gcc-common.h"
+ class test {
+ public: