]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-small_fixes.patch
- fix building randstruct plugin with gcc 8
[packages/kernel.git] / kernel-small_fixes.patch
1 --- linux-2.6.33/scripts/mod/modpost.c~ 2010-02-24 19:52:17.000000000 +0100
2 +++ linux-2.6.33/scripts/mod/modpost.c  2010-03-07 14:26:47.242168558 +0100
3 @@ -15,7 +15,8 @@
4  #include <stdio.h>
5  #include <ctype.h>
6  #include "modpost.h"
7 -#include "../../include/generated/autoconf.h"
8 +// PLD architectures don't use CONFIG_SYMBOL_PREFIX
9 +//#include "../../include/generated/autoconf.h"
10  #include "../../include/linux/license.h"
11  
12  /* Some toolchains use a `_' prefix for all user symbols. */
13
14 --- linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh~       2011-07-22 04:17:23.000000000 +0200
15 +++ linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh        2011-08-25 21:26:04.799150642 +0200
16 @@ -9,6 +9,12 @@
17                         $cc -print-file-name=lib${lib}.${ext} | grep -q /
18                         if [ $? -eq 0 ]; then
19                                 echo "-l${lib}"
20 +                               for libt in tinfow tinfo ; do
21 +                                       $cc -print-file-name=lib${libt}.${ext} | grep -q /
22 +                                       if [ $? -eq 0 ]; then
23 +                                               echo "-l${libt}"
24 +                                       fi
25 +                               done
26                                 exit
27                         fi
28                 done
29 commit 80d172431696482d9acd8d2c4ea78fed8956e2a1
30 Author: valdis.kletnieks@vt.edu <valdis.kletnieks@vt.edu>
31 Date:   Sun Feb 4 12:01:43 2018 -0500
32
33     gcc-plugins: Add include required by GCC release 8
34     
35     GCC requires another #include to get the gcc-plugins to build cleanly.
36     
37     Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
38     Signed-off-by: Kees Cook <keescook@chromium.org>
39
40 diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
41 index ffd1dfaa1cc1..f46750053377 100644
42 --- a/scripts/gcc-plugins/gcc-common.h
43 +++ b/scripts/gcc-plugins/gcc-common.h
44 @@ -97,6 +97,10 @@
45  #include "predict.h"
46  #include "ipa-utils.h"
47  
48 +#if BUILDING_GCC_VERSION >= 8000
49 +#include "stringpool.h"
50 +#endif
51 +
52  #if BUILDING_GCC_VERSION >= 4009
53  #include "attribs.h"
54  #include "varasm.h"
55 diff -ur linux-4.14/scripts/gcc-plugins/latent_entropy_plugin.c linux-4.17/scripts/gcc-plugins/latent_entropy_plugin.c
56 --- linux-4.14/scripts/gcc-plugins/latent_entropy_plugin.c      2017-11-12 19:46:13.000000000 +0100
57 +++ linux-4.17/scripts/gcc-plugins/latent_entropy_plugin.c      2018-06-03 23:15:21.000000000 +0200
58 @@ -255,21 +255,14 @@
59         return NULL_TREE;
60  }
61  
62 -static struct attribute_spec latent_entropy_attr = {
63 -       .name                           = "latent_entropy",
64 -       .min_length                     = 0,
65 -       .max_length                     = 0,
66 -       .decl_required                  = true,
67 -       .type_required                  = false,
68 -       .function_type_required         = false,
69 -       .handler                        = handle_latent_entropy_attribute,
70 -#if BUILDING_GCC_VERSION >= 4007
71 -       .affects_type_identity          = false
72 -#endif
73 -};
74 +static struct attribute_spec latent_entropy_attr = { };
75  
76  static void register_attributes(void *event_data __unused, void *data __unused)
77  {
78 +       latent_entropy_attr.name                = "latent_entropy";
79 +       latent_entropy_attr.decl_required       = true;
80 +       latent_entropy_attr.handler             = handle_latent_entropy_attribute;
81 +
82         register_attribute(&latent_entropy_attr);
83  }
84  
85 diff -ur linux-4.14/scripts/gcc-plugins/randomize_layout_plugin.c linux-4.17/scripts/gcc-plugins/randomize_layout_plugin.c
86 --- linux-4.14/scripts/gcc-plugins/randomize_layout_plugin.c    2017-11-12 19:46:13.000000000 +0100
87 +++ linux-4.17/scripts/gcc-plugins/randomize_layout_plugin.c    2018-06-03 23:15:21.000000000 +0200
88 @@ -52,8 +52,8 @@
89         { "net/unix/af_unix.c", "unix_skb_parms", "char" },
90         /* big_key payload.data struct splashing */
91         { "security/keys/big_key.c", "path", "void *" },
92 -       /* walk struct security_hook_heads as an array of struct list_head */
93 -       { "security/security.c", "list_head", "security_hook_heads" },
94 +       /* walk struct security_hook_heads as an array of struct hlist_head */
95 +       { "security/security.c", "hlist_head", "security_hook_heads" },
96         { }
97  };
98  
99 @@ -580,68 +580,35 @@
100         return;
101  }
102  
103 -static struct attribute_spec randomize_layout_attr = {
104 -       .name           = "randomize_layout",
105 -       // related to args
106 -       .min_length     = 0,
107 -       .max_length     = 0,
108 -       .decl_required  = false,
109 -       // need type declaration
110 -       .type_required  = true,
111 -       .function_type_required = false,
112 -       .handler                = handle_randomize_layout_attr,
113 -#if BUILDING_GCC_VERSION >= 4007
114 -       .affects_type_identity  = true
115 -#endif
116 -};
117 +static struct attribute_spec randomize_layout_attr = { };
118 +static struct attribute_spec no_randomize_layout_attr = { };
119 +static struct attribute_spec randomize_considered_attr = { };
120 +static struct attribute_spec randomize_performed_attr = { };
121  
122 -static struct attribute_spec no_randomize_layout_attr = {
123 -       .name           = "no_randomize_layout",
124 -       // related to args
125 -       .min_length     = 0,
126 -       .max_length     = 0,
127 -       .decl_required  = false,
128 -       // need type declaration
129 -       .type_required  = true,
130 -       .function_type_required = false,
131 -       .handler                = handle_randomize_layout_attr,
132 +static void register_attributes(void *event_data, void *data)
133 +{
134 +       randomize_layout_attr.name              = "randomize_layout";
135 +       randomize_layout_attr.type_required     = true;
136 +       randomize_layout_attr.handler           = handle_randomize_layout_attr;
137  #if BUILDING_GCC_VERSION >= 4007
138 -       .affects_type_identity  = true
139 +       randomize_layout_attr.affects_type_identity = true;
140  #endif
141 -};
142  
143 -static struct attribute_spec randomize_considered_attr = {
144 -       .name           = "randomize_considered",
145 -       // related to args
146 -       .min_length     = 0,
147 -       .max_length     = 0,
148 -       .decl_required  = false,
149 -       // need type declaration
150 -       .type_required  = true,
151 -       .function_type_required = false,
152 -       .handler                = handle_randomize_considered_attr,
153 +       no_randomize_layout_attr.name           = "no_randomize_layout";
154 +       no_randomize_layout_attr.type_required  = true;
155 +       no_randomize_layout_attr.handler        = handle_randomize_layout_attr;
156  #if BUILDING_GCC_VERSION >= 4007
157 -       .affects_type_identity  = false
158 +       no_randomize_layout_attr.affects_type_identity = true;
159  #endif
160 -};
161  
162 -static struct attribute_spec randomize_performed_attr = {
163 -       .name           = "randomize_performed",
164 -       // related to args
165 -       .min_length     = 0,
166 -       .max_length     = 0,
167 -       .decl_required  = false,
168 -       // need type declaration
169 -       .type_required  = true,
170 -       .function_type_required = false,
171 -       .handler                = handle_randomize_performed_attr,
172 -#if BUILDING_GCC_VERSION >= 4007
173 -       .affects_type_identity  = false
174 -#endif
175 -};
176 +       randomize_considered_attr.name          = "randomize_considered";
177 +       randomize_considered_attr.type_required = true;
178 +       randomize_considered_attr.handler       = handle_randomize_considered_attr;
179 +
180 +       randomize_performed_attr.name           = "randomize_performed";
181 +       randomize_performed_attr.type_required  = true;
182 +       randomize_performed_attr.handler        = handle_randomize_performed_attr;
183  
184 -static void register_attributes(void *event_data, void *data)
185 -{
186         register_attribute(&randomize_layout_attr);
187         register_attribute(&no_randomize_layout_attr);
188         register_attribute(&randomize_considered_attr);
189 diff -ur linux-4.14/scripts/gcc-plugins/structleak_plugin.c linux-4.17/scripts/gcc-plugins/structleak_plugin.c
190 --- linux-4.14/scripts/gcc-plugins/structleak_plugin.c  2017-11-12 19:46:13.000000000 +0100
191 +++ linux-4.17/scripts/gcc-plugins/structleak_plugin.c  2018-06-03 23:15:21.000000000 +0200
192 @@ -57,21 +57,16 @@
193         return NULL_TREE;
194  }
195  
196 -static struct attribute_spec user_attr = {
197 -       .name                   = "user",
198 -       .min_length             = 0,
199 -       .max_length             = 0,
200 -       .decl_required          = false,
201 -       .type_required          = false,
202 -       .function_type_required = false,
203 -       .handler                = handle_user_attribute,
204 -#if BUILDING_GCC_VERSION >= 4007
205 -       .affects_type_identity  = true
206 -#endif
207 -};
208 +static struct attribute_spec user_attr = { };
209  
210  static void register_attributes(void *event_data, void *data)
211  {
212 +       user_attr.name                  = "user";
213 +       user_attr.handler               = handle_user_attribute;
214 +#if BUILDING_GCC_VERSION >= 4007
215 +       user_attr.affects_type_identity = true;
216 +#endif
217 +
218         register_attribute(&user_attr);
219  }
220  
This page took 0.045689 seconds and 4 git commands to generate.