- update includes for gcc 8 (Valdis Kletnieks)

- update initializers for gcc 8
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 Comment: Kees Cook <kees@outflux.net>
 
 iQIcBAABCgAGBQJaemtoAAoJEIly9N/cbcAmLGEP/jG32+dJKwnttn8vdX3sQRBS
 QnRKVDyX8EO1XSW+TsR4RWm77Hc1XMV8xujDsJhaVBuDPYlhnndNaG5Q9Y+bV0qz
 qYx6oXTktxVImCAOGVyoN9qOA6ArZU9aHBbMvye28JdQKyZZe+6ABzHZVuO1ZsjM
 DX2ySOWWUopB0z8zrxvavdVlnjzsi/dw+7ydyXFP83Ngs9djlykrCmT24ZmOH4mk
 EFqliRBwSsaf8BsEP0UN5aSOW/p4fgaboUwgYpDapiynWCza0/8Pv/VKT5eYEYNO
 rPYO2X3T/C1w/H68HwzDheUsh7xTeparzCyFoUcc1lE3jNy2sjfA4LjDX6XvL2RX
 QdqMwl//+iNopUVRmuhnDq69zUjwD79M8qHba7tsMYml3G2QBpgi3I4hhHrJC9Dr
 cqrVlQcuwqf2Ib3rXV7uVNw/uRjp+NXhVtPxMAMxi9N/4OKiALfQG/EOkHcsAqbf
 MU9H3Tc3RxMDEPJlOpjxLdtk6hSV0GcGAgPcb2qMuffFFR+DBv8YSR8AzcSsTdKF
 HutbN+lHXXSVpIwmcOhNaSP2JegEoGxfwT3e6It7O6kcClV7JGrLbqIbnlw0I6SA
 +fQGk56Q5RFqESoZd3EyUH38nWMaBT6mjid0+i2jJHkMQ0+JRZyD8b5Sya3xrkI8
 95tjHlcLJ2H9fHBgaPl+
 =E0HY
 -----END PGP SIGNATURE-----

Merge tag 'gcc-plugins-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull gcc plugins updates from Kees Cook:

 - update includes for gcc 8 (Valdis Kletnieks)

 - update initializers for gcc 8

* tag 'gcc-plugins-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  gcc-plugins: Use dynamic initializers
  gcc-plugins: Add include required by GCC release 8
This commit is contained in:
Linus Torvalds 2018-02-08 14:37:32 -08:00
commit 4ed8244ef8
4 changed files with 42 additions and 83 deletions

View file

@ -97,6 +97,10 @@
#include "predict.h"
#include "ipa-utils.h"
#if BUILDING_GCC_VERSION >= 8000
#include "stringpool.h"
#endif
#if BUILDING_GCC_VERSION >= 4009
#include "attribs.h"
#include "varasm.h"

View file

@ -255,21 +255,14 @@ static tree handle_latent_entropy_attribute(tree *node, tree name,
return NULL_TREE;
}
static struct attribute_spec latent_entropy_attr = {
.name = "latent_entropy",
.min_length = 0,
.max_length = 0,
.decl_required = true,
.type_required = false,
.function_type_required = false,
.handler = handle_latent_entropy_attribute,
#if BUILDING_GCC_VERSION >= 4007
.affects_type_identity = false
#endif
};
static struct attribute_spec latent_entropy_attr = { };
static void register_attributes(void *event_data __unused, void *data __unused)
{
latent_entropy_attr.name = "latent_entropy";
latent_entropy_attr.decl_required = true;
latent_entropy_attr.handler = handle_latent_entropy_attribute;
register_attribute(&latent_entropy_attr);
}

View file

@ -580,68 +580,35 @@ static void finish_type(void *event_data, void *data)
return;
}
static struct attribute_spec randomize_layout_attr = {
.name = "randomize_layout",
// related to args
.min_length = 0,
.max_length = 0,
.decl_required = false,
// need type declaration
.type_required = true,
.function_type_required = false,
.handler = handle_randomize_layout_attr,
#if BUILDING_GCC_VERSION >= 4007
.affects_type_identity = true
#endif
};
static struct attribute_spec no_randomize_layout_attr = {
.name = "no_randomize_layout",
// related to args
.min_length = 0,
.max_length = 0,
.decl_required = false,
// need type declaration
.type_required = true,
.function_type_required = false,
.handler = handle_randomize_layout_attr,
#if BUILDING_GCC_VERSION >= 4007
.affects_type_identity = true
#endif
};
static struct attribute_spec randomize_considered_attr = {
.name = "randomize_considered",
// related to args
.min_length = 0,
.max_length = 0,
.decl_required = false,
// need type declaration
.type_required = true,
.function_type_required = false,
.handler = handle_randomize_considered_attr,
#if BUILDING_GCC_VERSION >= 4007
.affects_type_identity = false
#endif
};
static struct attribute_spec randomize_performed_attr = {
.name = "randomize_performed",
// related to args
.min_length = 0,
.max_length = 0,
.decl_required = false,
// need type declaration
.type_required = true,
.function_type_required = false,
.handler = handle_randomize_performed_attr,
#if BUILDING_GCC_VERSION >= 4007
.affects_type_identity = false
#endif
};
static struct attribute_spec randomize_layout_attr = { };
static struct attribute_spec no_randomize_layout_attr = { };
static struct attribute_spec randomize_considered_attr = { };
static struct attribute_spec randomize_performed_attr = { };
static void register_attributes(void *event_data, void *data)
{
randomize_layout_attr.name = "randomize_layout";
randomize_layout_attr.type_required = true;
randomize_layout_attr.handler = handle_randomize_layout_attr;
#if BUILDING_GCC_VERSION >= 4007
randomize_layout_attr.affects_type_identity = true;
#endif
no_randomize_layout_attr.name = "no_randomize_layout";
no_randomize_layout_attr.type_required = true;
no_randomize_layout_attr.handler = handle_randomize_layout_attr;
#if BUILDING_GCC_VERSION >= 4007
no_randomize_layout_attr.affects_type_identity = true;
#endif
randomize_considered_attr.name = "randomize_considered";
randomize_considered_attr.type_required = true;
randomize_considered_attr.handler = handle_randomize_considered_attr;
randomize_performed_attr.name = "randomize_performed";
randomize_performed_attr.type_required = true;
randomize_performed_attr.handler = handle_randomize_performed_attr;
register_attribute(&randomize_layout_attr);
register_attribute(&no_randomize_layout_attr);
register_attribute(&randomize_considered_attr);

View file

@ -57,21 +57,16 @@ static tree handle_user_attribute(tree *node, tree name, tree args, int flags, b
return NULL_TREE;
}
static struct attribute_spec user_attr = {
.name = "user",
.min_length = 0,
.max_length = 0,
.decl_required = false,
.type_required = false,
.function_type_required = false,
.handler = handle_user_attribute,
#if BUILDING_GCC_VERSION >= 4007
.affects_type_identity = true
#endif
};
static struct attribute_spec user_attr = { };
static void register_attributes(void *event_data, void *data)
{
user_attr.name = "user";
user_attr.handler = handle_user_attribute;
#if BUILDING_GCC_VERSION >= 4007
user_attr.affects_type_identity = true;
#endif
register_attribute(&user_attr);
}