kernel: fix gcc plugin build with gcc-11

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
Arne Fitzenreiter
2021-06-30 08:36:10 +02:00
parent 178eaf31cf
commit 4ff8a22566
2 changed files with 30 additions and 0 deletions

View File

@@ -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

View File

@@ -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: