1 |
commit: 14d75ac4afef46923bddbd0fe0b36c549b8b7bc0 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 27 15:51:07 2021 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 27 15:51:07 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=14d75ac4 |
7 |
|
8 |
Fix how gcc version detectioned to make visible CONFIG_GCC_PLUGINS |
9 |
|
10 |
Thanks to Kerin Millar. |
11 |
|
12 |
Bug: https://bugs.gentoo.org/814200 |
13 |
|
14 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
15 |
|
16 |
0000_README | 4 ++ |
17 |
2910_fix-gcc-detection-method.patch | 92 +++++++++++++++++++++++++++++++++++++ |
18 |
2 files changed, 96 insertions(+) |
19 |
|
20 |
diff --git a/0000_README b/0000_README |
21 |
index 0d389ec..e008863 100644 |
22 |
--- a/0000_README |
23 |
+++ b/0000_README |
24 |
@@ -687,6 +687,10 @@ Patch: 2600_enable-key-swapping-for-apple-mac.patch |
25 |
From: https://github.com/free5lot/hid-apple-patched |
26 |
Desc: This hid-apple patch enables swapping of the FN and left Control keys and some additional on some apple keyboards. See bug #622902 |
27 |
|
28 |
+Patch: 2910_fix-gcc-detection-method.patch |
29 |
+From: https://bugs.gentoo.org/814200 |
30 |
+Desc: Fix how gcc version is detected to make visible CONFIG_GCC_PLUGINS. Thanks to Kerin Millar. |
31 |
+ |
32 |
Patch: 2920_sign-file-patch-for-libressl.patch |
33 |
From: https://bugs.gentoo.org/717166 |
34 |
Desc: sign-file: full functionality with modern LibreSSL |
35 |
|
36 |
diff --git a/2910_fix-gcc-detection-method.patch b/2910_fix-gcc-detection-method.patch |
37 |
new file mode 100644 |
38 |
index 0000000..d7ed901 |
39 |
--- /dev/null |
40 |
+++ b/2910_fix-gcc-detection-method.patch |
41 |
@@ -0,0 +1,92 @@ |
42 |
+--- a/scripts/gcc-plugin.sh 2021-09-23 10:18:55.315793245 -0400 |
43 |
++++ /dev/null 2021-10-27 08:48:41.750968153 -0400 |
44 |
+@@ -1,66 +0,0 @@ |
45 |
+-#!/bin/sh |
46 |
+-# SPDX-License-Identifier: GPL-2.0 |
47 |
+-srctree=$(dirname "$0") |
48 |
+- |
49 |
+-SHOW_ERROR= |
50 |
+-if [ "$1" = "--show-error" ] ; then |
51 |
+- SHOW_ERROR=1 |
52 |
+- shift || true |
53 |
+-fi |
54 |
+- |
55 |
+-gccplugins_dir=$($3 -print-file-name=plugin) |
56 |
+-plugincc=$($1 -E -x c++ - -o /dev/null -I"${srctree}"/gcc-plugins -I"${gccplugins_dir}"/include 2>&1 <<EOF |
57 |
+-#include "gcc-common.h" |
58 |
+-#if BUILDING_GCC_VERSION >= 4008 || defined(ENABLE_BUILD_WITH_CXX) |
59 |
+-#warning $2 CXX |
60 |
+-#else |
61 |
+-#warning $1 CC |
62 |
+-#endif |
63 |
+-EOF |
64 |
+-) |
65 |
+- |
66 |
+-if [ $? -ne 0 ] |
67 |
+-then |
68 |
+- if [ -n "$SHOW_ERROR" ] ; then |
69 |
+- echo "${plugincc}" >&2 |
70 |
+- fi |
71 |
+- exit 1 |
72 |
+-fi |
73 |
+- |
74 |
+-case "$plugincc" in |
75 |
+- *"$1 CC"*) |
76 |
+- echo "$1" |
77 |
+- exit 0 |
78 |
+- ;; |
79 |
+- |
80 |
+- *"$2 CXX"*) |
81 |
+- # the c++ compiler needs another test, see below |
82 |
+- ;; |
83 |
+- |
84 |
+- *) |
85 |
+- exit 1 |
86 |
+- ;; |
87 |
+-esac |
88 |
+- |
89 |
+-# we need a c++ compiler that supports the designated initializer GNU extension |
90 |
+-plugincc=$($2 -c -x c++ -std=gnu++98 - -fsyntax-only -I"${srctree}"/gcc-plugins -I"${gccplugins_dir}"/include 2>&1 <<EOF |
91 |
+-#include "gcc-common.h" |
92 |
+-class test { |
93 |
+-public: |
94 |
+- int test; |
95 |
+-} test = { |
96 |
+- .test = 1 |
97 |
+-}; |
98 |
+-EOF |
99 |
+-) |
100 |
+- |
101 |
+-if [ $? -eq 0 ] |
102 |
+-then |
103 |
+- echo "$2" |
104 |
+- exit 0 |
105 |
+-fi |
106 |
+- |
107 |
+-if [ -n "$SHOW_ERROR" ] ; then |
108 |
+- echo "${plugincc}" >&2 |
109 |
+-fi |
110 |
+-exit 1 |
111 |
+--- a/scripts/gcc-plugins/Kconfig 2021-09-23 10:15:50.898216868 -0400 |
112 |
++++ b/scripts/gcc-plugins/Kconfig 2021-10-27 11:44:35.700620974 -0400 |
113 |
+@@ -17,7 +17,8 @@ config HAVE_GCC_PLUGINS |
114 |
+ menuconfig GCC_PLUGINS |
115 |
+ bool "GCC plugins" |
116 |
+ depends on HAVE_GCC_PLUGINS |
117 |
+- depends on PLUGIN_HOSTCC != "" |
118 |
++ depends on CC_IS_GCC |
119 |
++ depends on $(success,test -e $(shell,$(CC) -print-file-name=plugin)/include/plugin-version.h) |
120 |
+ default y |
121 |
+ help |
122 |
+ GCC plugins are loadable modules that provide extra features to the |
123 |
+--- a/scripts/gcc-plugins/Makefile 2021-10-27 10:58:03.960272437 -0400 |
124 |
++++ b/scripts/gcc-plugins/Makefile 2021-10-27 10:59:37.313786319 -0400 |
125 |
+@@ -8,7 +8,7 @@ ifeq ($(PLUGINCC),$(HOSTCC)) |
126 |
+ export HOST_EXTRACFLAGS |
127 |
+ else |
128 |
+ HOSTLIBS := hostcxxlibs |
129 |
+- HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti |
130 |
++ HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++11 -fno-rtti |
131 |
+ HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb |
132 |
+ HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable |
133 |
+ HOST_EXTRACXXFLAGS += -Wno-format-diag |