Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 5.10 #475

Merged
merged 2 commits into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions 0014-gcc-plugin.sh-fix-gcc11-standard-in-plugin-detection.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 650e064b7a2dbc560cdf3eda8b0fc04a7518d7d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?=
<[email protected]>
Date: Sun, 17 Oct 2021 11:05:06 +0200
Subject: [PATCH] gcc-plugin.sh: fix gcc11 standard in plugin detection

Provide also default HOSTCC variable
---
scripts/gcc-plugin.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gcc-plugin.sh b/scripts/gcc-plugin.sh
index b79fd0bea838..a35b7c5a9107 100755
--- a/scripts/gcc-plugin.sh
+++ b/scripts/gcc-plugin.sh
@@ -8,7 +8,7 @@ srctree=$(dirname "$0")
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:-g++} -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:
--
2.31.1

48 changes: 48 additions & 0 deletions 0015-gcc-plugins-fix-gcc-11-indigestion-with-plugins.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From 35ba18ae4d0cbf62f0df23aba6396905e7f428ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Valdis=20Kl=C4=93tnieks?= <[email protected]>
Date: Sat, 26 Dec 2020 13:21:58 -0500
Subject: [PATCH] gcc-plugins: fix gcc 11 indigestion with plugins...

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 <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/82487.1609006918@turing-police
---
scripts/gcc-plugins/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

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

3 changes: 3 additions & 0 deletions kernel.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ BuildRequires: elfutils-libelf-devel
BuildRequires: bison
BuildRequires: flex
BuildRequires: e2fsprogs
BuildRequires: make

# gcc with support for BTI mitigation
%if 0%{?fedora} == 25
Expand Down Expand Up @@ -132,6 +133,8 @@ Patch12: 0013-xen-pcifront-pciback-Update-pciif.h-with-err-and-res.patch
Patch14: 0001-Revert-xen-netback-Check-for-hotplug-status-existenc.patch
Patch15: 0002-Revert-xen-netback-remove-hotplug-status-once-it-has.patch
Patch16: 0001-xen-balloon-fix-cancelled-balloon-action.patch
Patch17: 0014-gcc-plugin.sh-fix-gcc11-standard-in-plugin-detection.patch
Patch18: 0015-gcc-plugins-fix-gcc-11-indigestion-with-plugins.patch

%description
Qubes Dom0 kernel.
Expand Down