upgrade kernel to 5.0.6

This commit is contained in:
Bruce Leidl 2019-04-06 16:11:10 -04:00
parent 559f0d13ef
commit ac1f7db885
11 changed files with 1564 additions and 7645 deletions

View File

@ -5,4 +5,4 @@ CITADEL_IMAGE_VERSION_rootfs = "1"
CITADEL_IMAGE_VERSION_extra = "1" CITADEL_IMAGE_VERSION_extra = "1"
CITADEL_IMAGE_VERSION_kernel = "1" CITADEL_IMAGE_VERSION_kernel = "1"
CITADEL_KERNEL_VERSION = "4.9.135" CITADEL_KERNEL_VERSION = "5.0.6"

View File

@ -1,62 +0,0 @@
DESCRIPTION = "Citadel linux kernel"
SECTION = "kernel"
LICENSE = "GPLv2"
BUILD_LDFLAGS = "-L${STAGING_LIBDIR} \
-Wl,-rpath-link,${STAGING_LIBDIR} \
-Wl,-rpath,${STAGING_LIBDIR} \
-Wl,-O1 \
-Wl,--dynamic-linker=${STAGING_LIBDIR}/ld-linux-x86-64.so.2"
BUILD_CFLAGS = "-O2 -pipe -v"
inherit kernel
EXTRA_OEMAKE = 'HOSTCC="x86_64-oe-linux-gcc --sysroot=${RECIPE_SYSROOT}" HOSTCXX="x86_64-oe-linux-g++ --sysroot=${RECIPE_SYSROOT} -isystem ${STAGING_INCDIR_NATIVE}" HOSTCFLAGS="${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTLDFLAGS="--sysroot=${RECIPE_SYSROOT} ${BUILD_LDFLAGS}"'
# if OVERRIDES contains citadel-powertop, then find defconfig in citadel-powertop dirctory
# This config disables CONFIG_GRKERNSEC_KMEM and enables CONFIG_DEBUG_FS so that
# powertop will work
FILESEXTRAPATHS_prepend_citadel-powertop = "${FILE_DIRNAME}/citadel-powertop:"
LINUX_VERSION_EXTENSION_append_citadel-powertop = "-powertop"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
LINUX_VERSION ?= "${PV}"
LINUX_VERSION_EXTENSION_append = "-citadel"
S = "${WORKDIR}/linux-${LINUX_VERSION}"
do_deploy_append() {
rm ${DEPLOYDIR}/bzImage
ln -sf bzImage-initramfs-${KERNEL_IMAGE_NAME}.bin ${DEPLOYDIR}/bzImage
echo "${PV}" > ${DEPLOYDIR}/kernel.version
}
#
# Replaces function with same name in kernel.bbclass since that implementation
# doesn't pass destination argument to lz4 in which case the decompressed output
# just disappears into thin air it seems.
#
copy_initramfs() {
echo "copy_initramfs override"
mkdir -p ${B}/usr
rm -f ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.cpio.lz4 ${B}/usr/.
lz4 -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio.lz4 ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
ls -al ${B}/usr
echo "Finished copy of initramfs into ./usr"
}
# Don't install kernel into images, see kernel.bbclass
RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
#
# https://github.com/96boards/meta-96boards/issues/81#issuecomment-311256044
# https://github.com/96boards/meta-96boards/blob/master/recipes-kernel/linux/linux-96boards_4.4.bb
#
# coreutils for /usr/bin/seq which pax size overflow gcc plugin uses
DEPENDS += "libgcc openssl coreutils-native lz4-native"
COMPATIBLE_MACHINE = "(intel-corei7-64)"

View File

@ -1,22 +0,0 @@
require citadel-kernel.inc
DAPPER_PATCH = "4.9.135-2018-10-26"
SRC_URI = "\
https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${LINUX_VERSION}.tar.xz;name=kernel \
https://github.com/dapperlinux/dapper-secure-kernel-stable/raw/master/dapper-secure-kernel-patchset-${DAPPER_PATCH}.patch;name=patch \
\
file://defconfig \
file://ignore-sysroot-for-plugin-build.patch \
file://0114-smpboot-reuse-timer-calibration.patch \
file://0116-Initialize-ata-before-graphics.patch \
file://0117-WireGuard.patch \
file://0001-libata-Add-new-med_power_with_dipm-link_power_manage.patch \
"
SRC_URI[kernel.md5sum] = "4d131a974821f35baa784b566b60ba5e"
SRC_URI[kernel.sha256sum] = "e023b0bbe9ea7fc56aa57210342dd18ea3e0900ee207226df1523c6d7df154ce"
SRC_URI[patch.md5sum] = "ebb07d5cc90852c753e677bb2d31f9d9"
SRC_URI[patch.sha256sum] = "529962f3b4d5ffa250f2b90636f1cbb21004fb48e76c2f4d2cc96e2d3fdbb6fe"

View File

@ -1,10 +0,0 @@
require citadel-kernel.inc
SRC_URI[kernel.md5sum] = "60e1a229fb5ffc2a82462ed9400ce3d0"
SRC_URI[kernel.sha256sum] = "24ba70877549a3cf25dc5f12efd260d3e957bce64c087de98baf8968ee514895"
PATCH_DATE_TAG = "20171124142753"
SRC_URI[patch.md5sum] = "3c1521b8ada079fbbca372d5191fa351"
SRC_URI[patch.sha256sum] = "f25398621854074f1a286d97fd39224462c054b568c7ae8181765340a439faf9"

View File

@ -0,0 +1,44 @@
DESCRIPTION = "Citadel linux kernel"
LICENSE = "GPLv2"
SECTION = "kernel"
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
inherit kernel
SRC_URI = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.0.6.tar.xz\
file://defconfig \
"
SRC_URI[md5sum] = "301cf9a7706c750ca76b322eb98bfe15"
SRC_URI[sha256sum] = "9e4a9a8d8a07b7fc696d734f6e822cf43c45cecfe3ab4c089b349bfc701ff413"
LINUX_VERSION ?= "${PV}"
S = "${WORKDIR}/linux-${LINUX_VERSION}"
KERNEL_CONFIG_COMMAND = "oe_runmake_call -C ${S} CC="${KERNEL_CC}" O=${B} olddefconfig"
DEPENDS += "lz4-native"
do_deploy_append() {
rm ${DEPLOYDIR}/bzImage
ln -sf bzImage-initramfs-${KERNEL_IMAGE_NAME}.bin ${DEPLOYDIR}/bzImage
echo "${PV}" > ${DEPLOYDIR}/kernel.version
}
#
# Replaces function with same name in kernel.bbclass since that implementation
# doesn't pass destination argument to lz4 in which case the decompressed output
# just disappears into thin air it seems.
#
copy_initramfs() {
echo "copy_initramfs override"
mkdir -p ${B}/usr
rm -f ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.cpio.lz4 ${B}/usr/.
lz4 -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio.lz4 ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
ls -al ${B}/usr
echo "Finished copy of initramfs into ./usr"
}
# Don't install kernel into images, see kernel.bbclass
RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""

View File

@ -1,804 +0,0 @@
From d1e2a107d2046cd27b061d20881d3b49c24c561a Mon Sep 17 00:00:00 2001
From: David McKinney <mckinney@subgraph.com>
Date: Tue, 11 Sep 2018 19:49:49 +0000
Subject: [PATCH 1/1] More gcc-8 plugin fixes
---
scripts/gcc-plugins/checker_plugin.c | 44 ++++++-------
scripts/gcc-plugins/constify_plugin.c | 20 +++++-
scripts/gcc-plugins/gcc-common.h | 66 +++++++++++++++----
scripts/gcc-plugins/initify_plugin.c | 23 +++++--
scripts/gcc-plugins/latent_entropy_plugin.c | 9 ++-
scripts/gcc-plugins/randomize_layout_plugin.c | 42 ++++++++++--
.../gcc-plugins/rap_plugin/rap_fptr_pass.c | 2 +-
scripts/gcc-plugins/rap_plugin/rap_plugin.c | 11 +++-
scripts/gcc-plugins/rap_plugin/rap_ret_pass.c | 4 +-
.../intentional_overflow.c | 45 ++++++++++---
.../remove_unnecessary_dup.c | 8 +--
.../size_overflow_plugin.c | 22 +++++--
.../size_overflow_transform_core.c | 38 +++++++----
scripts/gcc-plugins/stackleak_plugin.c | 15 ++++-
scripts/gcc-plugins/structleak_plugin.c | 9 ++-
15 files changed, 273 insertions(+), 85 deletions(-)
diff --git a/scripts/gcc-plugins/checker_plugin.c b/scripts/gcc-plugins/checker_plugin.c
index c16753c34967..624a376f6f76 100644
--- a/scripts/gcc-plugins/checker_plugin.c
+++ b/scripts/gcc-plugins/checker_plugin.c
@@ -19,11 +19,11 @@
#include "gcc-common.h"
extern void c_register_addr_space (const char *str, addr_space_t as);
-extern enum machine_mode default_addr_space_pointer_mode (addr_space_t);
-extern enum machine_mode default_addr_space_address_mode (addr_space_t);
-extern bool default_addr_space_valid_pointer_mode(enum machine_mode mode, addr_space_t as);
-extern bool default_addr_space_legitimate_address_p(enum machine_mode mode, rtx mem, bool strict, addr_space_t as);
-extern rtx default_addr_space_legitimize_address(rtx x, rtx oldx, enum machine_mode mode, addr_space_t as);
+extern SCALAR_INT_MODE default_addr_space_pointer_mode (addr_space_t);
+extern SCALAR_INT_MODE default_addr_space_address_mode (addr_space_t);
+extern bool default_addr_space_valid_pointer_mode(SCALAR_INT_MODE mode, addr_space_t as);
+extern bool default_addr_space_legitimate_address_p(MACHINE_MODE mode, rtx mem, bool strict, addr_space_t as);
+extern rtx default_addr_space_legitimize_address(rtx x, rtx oldx, MACHINE_MODE mode, addr_space_t as);
__visible int plugin_is_GPL_compatible;
@@ -44,27 +44,27 @@ static struct plugin_info checker_plugin_info = {
#define ADDR_SPACE_RCU 0
#define ADDR_SPACE_FORCE_RCU 0
-static enum machine_mode checker_addr_space_pointer_mode(addr_space_t addrspace)
+static SCALAR_INT_MODE checker_addr_space_pointer_mode(addr_space_t addrspace)
{
return default_addr_space_pointer_mode(ADDR_SPACE_GENERIC);
}
-static enum machine_mode checker_addr_space_address_mode(addr_space_t addrspace)
+static SCALAR_INT_MODE checker_addr_space_address_mode(addr_space_t addrspace)
{
return default_addr_space_address_mode(ADDR_SPACE_GENERIC);
}
-static bool checker_addr_space_valid_pointer_mode(enum machine_mode mode, addr_space_t as)
+static bool checker_addr_space_valid_pointer_mode(SCALAR_INT_MODE mode, addr_space_t as)
{
return default_addr_space_valid_pointer_mode(mode, as);
}
-static bool checker_addr_space_legitimate_address_p(enum machine_mode mode, rtx mem, bool strict, addr_space_t as)
+static bool checker_addr_space_legitimate_address_p(MACHINE_MODE mode, rtx mem, bool strict, addr_space_t as)
{
return default_addr_space_legitimate_address_p(mode, mem, strict, ADDR_SPACE_GENERIC);
}
-static rtx checker_addr_space_legitimize_address(rtx x, rtx oldx, enum machine_mode mode, addr_space_t as)
+static rtx checker_addr_space_legitimize_address(rtx x, rtx oldx, MACHINE_MODE mode, addr_space_t as)
{
return default_addr_space_legitimize_address(x, oldx, mode, as);
}
@@ -173,21 +173,19 @@ static tree handle_context_attribute(tree *node, tree name, tree args, int flags
return NULL_TREE;
}
-static struct attribute_spec context_attr = {
- .name = "context",
- .min_length = 2,
- .max_length = 3,
- .decl_required = true,
- .type_required = false,
- .function_type_required = false,
- .handler = handle_context_attribute,
-#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = true
-#endif
-};
+static struct attribute_spec context_attr = { };
static void register_attributes(void *event_data, void *data)
{
+ attr.name = "context";
+ context_attr.min_length = 2;
+ context_attr.max_length = 3;
+ context_attr.decl_required = true;
+ context_attr.handler = handle_context_attribute;
+#if BUILDING_GCC_VERSION >= 4007
+ context_attr.affects_type_identity = true;
+#endif
+
register_attribute(&context_attr);
}
@@ -280,7 +278,7 @@ static basic_block verify_context_before(gimple_stmt_iterator *gsi, tree context
cond_bb = e->src;
join_bb = e->dest;
e->flags = EDGE_FALSE_VALUE;
- e->probability = REG_BR_PROB_BASE;
+ e->probability = probability(REG_BR_PROB_BASE);
true_bb = create_empty_bb(EXIT_BLOCK_PTR_FOR_FN(cfun)->prev_bb);
make_edge(cond_bb, true_bb, EDGE_TRUE_VALUE);
diff --git a/scripts/gcc-plugins/constify_plugin.c b/scripts/gcc-plugins/constify_plugin.c
index 42f22097fb16..54680c573b48 100644
--- a/scripts/gcc-plugins/constify_plugin.c
+++ b/scripts/gcc-plugins/constify_plugin.c
@@ -307,10 +307,17 @@ static struct attribute_spec no_const_attr = {
.decl_required = false,
.type_required = false,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = true,
.handler = handle_no_const_attribute,
+#else
#if BUILDING_GCC_VERSION >= 4007
+ .handler = handle_no_const_attribute,
.affects_type_identity = true
-#endif
+#else
+ .handler = handle_no_const_attribute,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static struct attribute_spec do_const_attr = {
@@ -320,10 +327,17 @@ static struct attribute_spec do_const_attr = {
.decl_required = false,
.type_required = false,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = true,
.handler = handle_do_const_attribute,
+#else
#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = true
-#endif
+ .handler = handle_do_const_attribute,
+ .affects_type_identity = true,
+#else
+ .handler = handle_do_const_attribute,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static void register_attributes(void *event_data, void *data)
diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
index 8099dd1793ca..00a203f88a43 100644
--- a/scripts/gcc-plugins/gcc-common.h
+++ b/scripts/gcc-plugins/gcc-common.h
@@ -104,6 +104,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"
@@ -430,13 +434,6 @@ static inline struct cgraph_node *cgraph_alias_target(struct cgraph_node *n)
}
#endif
-#if BUILDING_GCC_VERSION >= 4007 && BUILDING_GCC_VERSION <= 4009
-#define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \
- cgraph_create_edge((caller), (callee), (call_stmt), (count), (freq))
-#define cgraph_create_edge_including_clones(caller, callee, old_call_stmt, call_stmt, count, freq, nest, reason) \
- cgraph_create_edge_including_clones((caller), (callee), (old_call_stmt), (call_stmt), (count), (freq), (reason))
-#endif
-
#if BUILDING_GCC_VERSION <= 4008
#define ENTRY_BLOCK_PTR_FOR_FN(FN) ENTRY_BLOCK_PTR_FOR_FUNCTION(FN)
#define EXIT_BLOCK_PTR_FOR_FN(FN) EXIT_BLOCK_PTR_FOR_FUNCTION(FN)
@@ -785,10 +782,23 @@ static inline const char *get_decl_section_name(const_tree decl)
#define varpool_get_node(decl) varpool_node::get(decl)
#define dump_varpool_node(file, node) (node)->dump(file)
-#define cgraph_create_edge(caller, callee, call_stmt, count, freq, nest) \
- (caller)->create_edge((callee), (call_stmt), (count), (freq))
-#define cgraph_create_edge_including_clones(caller, callee, old_call_stmt, call_stmt, count, freq, nest, reason) \
- (caller)->create_edge_including_clones((callee), (old_call_stmt), (call_stmt), (count), (freq), (reason))
+#if BUILDING_GCC_VERSION >= 8000
+#define cgraph_create_edge(caller, callee, call_stmt, count, freq) \
+ (caller)->create_edge((callee), (call_stmt), (count))
+
+#define cgraph_create_edge_including_clones(caller, callee, \
+ old_call_stmt, call_stmt, count, freq, reason) \
+ (caller)->create_edge_including_clones((callee), \
+ (old_call_stmt), (call_stmt), (count), (reason))
+#else
+#define cgraph_create_edge(caller, callee, call_stmt, count, freq) \
+ (caller)->create_edge((callee), (call_stmt), (count), (freq))
+
+#define cgraph_create_edge_including_clones(caller, callee, \
+ old_call_stmt, call_stmt, count, freq, reason) \
+ (caller)->create_edge_including_clones((callee), \
+ (old_call_stmt), (call_stmt), (count), (freq), (reason))
+#endif
typedef struct cgraph_node *cgraph_node_ptr;
typedef struct cgraph_edge *cgraph_edge_p;
@@ -1025,4 +1035,38 @@ static inline void debug_gimple_stmt(const_gimple s)
get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, preversep, pvolatilep)
#endif
+#if BUILDING_GCC_VERSION < 8000
+#define E_HImode HImode
+#define E_SImode SImode
+#define E_DImode DImode
+#define E_TImode TImode
+#define E_QImode QImode
+#endif
+
+#if BUILDING_GCC_VERSION < 5000
+#define SCALAR_INT_MODE enum machine_mode
+#define MACHINE_MODE enum machine_mode
+#elif BUILDING_GCC_VERSION < 8000
+#define SCALAR_INT_MODE machine_mode
+#define MACHINE_MODE machine_mode
+#else
+#define SCALAR_INT_MODE scalar_int_mode
+#define MACHINE_MODE machine_mode
#endif
+
+#if BUILDING_GCC_VERSION >= 8000
+#define empty_string ""
+
+static inline profile_probability probability(int prob)
+{
+ return profile_probability::from_reg_br_prob_base(prob);
+}
+#else
+static inline int probability(int prob)
+{
+ return prob;
+}
+#endif
+
+#endif
+
diff --git a/scripts/gcc-plugins/initify_plugin.c b/scripts/gcc-plugins/initify_plugin.c
index 1c8d204f9cd3..2185a85d1081 100644
--- a/scripts/gcc-plugins/initify_plugin.c
+++ b/scripts/gcc-plugins/initify_plugin.c
@@ -359,10 +359,17 @@ static struct attribute_spec nocapture_attr = {
.decl_required = true,
.type_required = false,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = false,
.handler = handle_nocapture_attribute,
+#else
#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = false
-#endif
+ .handler = handle_nocapture_attribute,
+ .affects_type_identity = false,
+#else
+ .handler = handle_nocapture_attribute,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static struct attribute_spec unverified_nocapture_attr = {
@@ -373,9 +380,17 @@ static struct attribute_spec unverified_nocapture_attr = {
.type_required = false,
.function_type_required = false,
.handler = handle_unverified_nocapture_attribute,
+#if BUILDING_GCC_VERSION >= 8000
+#else
+ .affects_type_identity = false,
+ .handler = handle_unverified_nocapture_attribute,
#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = false
-#endif
+ .handler = handle_unverified_nocapture_attribute,
+ .affects_type_identity = false,
+#else
+ .handler = handle_unverified_nocapture_attribute,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static void register_attributes(void __unused *event_data, void __unused *data)
diff --git a/scripts/gcc-plugins/latent_entropy_plugin.c b/scripts/gcc-plugins/latent_entropy_plugin.c
index 1de194b63cdd..27f2a8a333b9 100644
--- a/scripts/gcc-plugins/latent_entropy_plugin.c
+++ b/scripts/gcc-plugins/latent_entropy_plugin.c
@@ -250,10 +250,17 @@ static struct attribute_spec latent_entropy_attr = {
.decl_required = true,
.type_required = false,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = false,
.handler = handle_latent_entropy_attribute,
+#else
#if BUILDING_GCC_VERSION >= 4007
+ .handler = handle_latent_entropy_attribute,
.affects_type_identity = false
-#endif
+#else
+ .handler = handle_latent_entropy_attribute,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static void register_attributes(void *event_data __unused, void *data __unused)
diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c
index bbb2c3612b1d..937b852a6cf8 100644
--- a/scripts/gcc-plugins/randomize_layout_plugin.c
+++ b/scripts/gcc-plugins/randomize_layout_plugin.c
@@ -568,10 +568,17 @@ static struct attribute_spec randomize_layout_attr = {
// need type declaration
.type_required = true,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = true,
.handler = handle_randomize_layout_attr,
+#else
#if BUILDING_GCC_VERSION >= 4007
+ .handler = handle_randomize_layout_attr,
.affects_type_identity = true
-#endif
+#else
+ .handler = handle_randomize_layout_attr,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static struct attribute_spec no_randomize_layout_attr = {
@@ -583,10 +590,17 @@ static struct attribute_spec no_randomize_layout_attr = {
// need type declaration
.type_required = true,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = true,
.handler = handle_randomize_layout_attr,
+#else
#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = true
-#endif
+ .handler = handle_randomize_layout_attr,
+ .affects_type_identity = true,
+#else
+ .handler = handle_randomize_layout_attr,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static struct attribute_spec randomize_considered_attr = {
@@ -598,10 +612,17 @@ static struct attribute_spec randomize_considered_attr = {
// need type declaration
.type_required = true,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = false,
.handler = handle_randomize_considered_attr,
+#else
#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = false
-#endif
+ .handler = handle_randomize_considered_attr,
+ .affects_type_identity = false,
+#else
+ .handler = handle_randomize_considered_attr,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static struct attribute_spec randomize_performed_attr = {
@@ -613,10 +634,17 @@ static struct attribute_spec randomize_performed_attr = {
// need type declaration
.type_required = true,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = false,
.handler = handle_randomize_performed_attr,
+#else
#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = false
-#endif
+ .handler = handle_randomize_performed_attr,
+ .affects_type_identity = false,
+#else
+ .handler = handle_randomize_performed_attr,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static void register_attributes(void *event_data, void *data)
diff --git a/scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c b/scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c
index d7dba8b4caa6..3db7283e6ee9 100644
--- a/scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c
+++ b/scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c
@@ -137,7 +137,7 @@ static void rap_instrument_fptr(gimple_stmt_iterator *gsi)
cond_bb = e->src;
join_bb = e->dest;
e->flags = EDGE_FALSE_VALUE;
- e->probability = REG_BR_PROB_BASE;
+ e->probability = probability(REG_BR_PROB_BASE);
true_bb = create_empty_bb(EXIT_BLOCK_PTR_FOR_FN(cfun)->prev_bb);
make_edge(cond_bb, true_bb, EDGE_TRUE_VALUE | EDGE_PRESERVE);
diff --git a/scripts/gcc-plugins/rap_plugin/rap_plugin.c b/scripts/gcc-plugins/rap_plugin/rap_plugin.c
index 713073ebe0ed..56c05aea8d6f 100644
--- a/scripts/gcc-plugins/rap_plugin/rap_plugin.c
+++ b/scripts/gcc-plugins/rap_plugin/rap_plugin.c
@@ -581,10 +581,17 @@ static struct attribute_spec rap_hash_attr = {
.decl_required = false,
.type_required = true,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = true,
.handler = handle_rap_hash_attribute,
+#else
#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = true
-#endif
+ .handler = handle_rap_hash_attribute,
+ .affects_type_identity = true,
+#else
+ .handler = handle_rap_hash_attribute,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static void register_attributes(void *event_data __unused, void *data __unused)
diff --git a/scripts/gcc-plugins/rap_plugin/rap_ret_pass.c b/scripts/gcc-plugins/rap_plugin/rap_ret_pass.c
index 3575980c3d8e..e463134a256e 100644
--- a/scripts/gcc-plugins/rap_plugin/rap_ret_pass.c
+++ b/scripts/gcc-plugins/rap_plugin/rap_ret_pass.c
@@ -109,7 +109,7 @@ static void check_retaddr(gimple_stmt_iterator *gsi, tree new_retaddr)
cond_bb = e->src;
join_bb = e->dest;
e->flags = EDGE_FALSE_VALUE;
- e->probability = REG_BR_PROB_BASE;
+ e->probability = probability(REG_BR_PROB_BASE);
true_bb = create_empty_bb(join_bb);
make_edge(cond_bb, true_bb, EDGE_TRUE_VALUE | EDGE_PRESERVE);
@@ -342,9 +342,11 @@ static unsigned int rap_mark_retloc_execute(void)
emit_label_before(label1, insn);
LABEL_NUSES(label1)++;
+#if BUILDING_GCC_VERSION >= 4007 && BUILDING_GCC_VERSION < 8000
do {
insn = NEXT_INSN(insn);
} while (GET_CODE(insn) == NOTE && NOTE_KIND(insn) == NOTE_INSN_CALL_ARG_LOCATION);
+#endif
emit_label_before(label2, insn);
LABEL_NUSES(label2)++;
}
diff --git a/scripts/gcc-plugins/size_overflow_plugin/intentional_overflow.c b/scripts/gcc-plugins/size_overflow_plugin/intentional_overflow.c
index 26899bd89cf7..789bb9ed6465 100644
--- a/scripts/gcc-plugins/size_overflow_plugin/intentional_overflow.c
+++ b/scripts/gcc-plugins/size_overflow_plugin/intentional_overflow.c
@@ -535,16 +535,16 @@ static bool is_lt_signed_type_max(const_tree rhs)
return true;
switch (TYPE_MODE(type)) {
- case QImode:
+ case E_QImode:
new_type = intQI_type_node;
break;
- case HImode:
+ case E_HImode:
new_type = intHI_type_node;
break;
- case SImode:
+ case E_SImode:
new_type = intSI_type_node;
break;
- case DImode:
+ case E_DImode:
new_type = intDI_type_node;
break;
default:
@@ -628,6 +628,33 @@ tree handle_intentional_overflow(interesting_stmts_t expand_from, bool check_ove
return create_assign(expand_from->visited, stmt, lhs, AFTER_STMT);
}
+static bool compare_bitsize_le(machine_mode arg1, machine_mode arg2)
+{
+#if BUILDING_GCC_VERSION >= 8000
+ return maybe_le(GET_MODE_BITSIZE(arg1), GET_MODE_BITSIZE(arg2));
+#else
+ return (GET_MODE_BITSIZE(arg1) <= GET_MODE_BITSIZE(arg2));
+#endif
+}
+
+static bool compare_bitsize_ge(machine_mode arg1, machine_mode arg2)
+{
+#if BUILDING_GCC_VERSION >= 8000
+ return maybe_ne(GET_MODE_BITSIZE(arg1), GET_MODE_BITSIZE(arg2));
+#else
+ return (GET_MODE_BITSIZE(arg1) != GET_MODE_BITSIZE(arg2));
+#endif
+}
+
+static bool compare_bitsize_ne(machine_mode arg1, machine_mode arg2)
+{
+#if BUILDING_GCC_VERSION >= 8000
+ return maybe_ne(GET_MODE_BITSIZE(arg1), GET_MODE_BITSIZE(arg2));
+#else
+ return (GET_MODE_BITSIZE(arg1) != GET_MODE_BITSIZE(arg2));
+#endif
+}
+
static bool is_subtraction_special(struct visited *visited, const gassign *stmt)
{
gimple rhs1_def_stmt, rhs2_def_stmt;
@@ -657,9 +684,9 @@ static bool is_subtraction_special(struct visited *visited, const gassign *stmt)
rhs2_def_stmt_rhs1_mode = TYPE_MODE(TREE_TYPE(rhs2_def_stmt_rhs1));
rhs1_def_stmt_lhs_mode = TYPE_MODE(TREE_TYPE(rhs1_def_stmt_lhs));
rhs2_def_stmt_lhs_mode = TYPE_MODE(TREE_TYPE(rhs2_def_stmt_lhs));
- if (GET_MODE_BITSIZE(rhs1_def_stmt_rhs1_mode) <= GET_MODE_BITSIZE(rhs1_def_stmt_lhs_mode))
+ if (compare_bitsize_le(rhs1_def_stmt_rhs1_mode, rhs1_def_stmt_lhs_mode))
return false;
- if (GET_MODE_BITSIZE(rhs2_def_stmt_rhs1_mode) <= GET_MODE_BITSIZE(rhs2_def_stmt_lhs_mode))
+ if (compare_bitsize_le(rhs2_def_stmt_rhs1_mode, rhs2_def_stmt_lhs_mode))
return false;
pointer_set_insert(visited->no_cast_check, rhs1_def_stmt);
@@ -922,7 +949,7 @@ void unsigned_signed_cast_intentional_overflow(struct visited *visited, gassign
if (!(TYPE_UNSIGNED(rhs_type) && !TYPE_UNSIGNED(lhs_type)))
return;
- if (GET_MODE_BITSIZE(TYPE_MODE(rhs_type)) != GET_MODE_BITSIZE(TYPE_MODE(lhs_type)))
+ if (compare_bitsize_ne(TYPE_MODE(rhs_type), TYPE_MODE(lhs_type)))
return;
use_num = uses_num(rhs);
if (use_num != 1)
@@ -971,7 +998,7 @@ static bool is_short_cast_neg(const_tree rhs)
return false;
cast_rhs = gimple_assign_rhs1(cast_stmt);
- if (GET_MODE_BITSIZE(TYPE_MODE(TREE_TYPE(cast_rhs))) >= GET_MODE_BITSIZE(TYPE_MODE(TREE_TYPE(rhs))))
+ if (compare_bitsize_ge(TYPE_MODE(TREE_TYPE(cast_rhs)), TYPE_MODE(TREE_TYPE(rhs))))
return false;
neg_cast_stmt = get_def_stmt(cast_rhs);
@@ -1013,7 +1040,7 @@ bool neg_short_add_intentional_overflow(gassign *unary_stmt)
if (!cast_stmt || !gimple_assign_cast_p(cast_stmt))
return false;
cast_rhs = gimple_assign_rhs1(cast_stmt);
- if (GET_MODE_BITSIZE(TYPE_MODE(TREE_TYPE(cast_rhs))) <= GET_MODE_BITSIZE(TYPE_MODE(TREE_TYPE(rhs1))))
+ if (compare_bitsize_le(TYPE_MODE(TREE_TYPE(cast_rhs)), TYPE_MODE(TREE_TYPE(rhs1))))
return false;
// one or two plus expressions
diff --git a/scripts/gcc-plugins/size_overflow_plugin/remove_unnecessary_dup.c b/scripts/gcc-plugins/size_overflow_plugin/remove_unnecessary_dup.c
index 5c268627352e..3c74ee921093 100644
--- a/scripts/gcc-plugins/size_overflow_plugin/remove_unnecessary_dup.c
+++ b/scripts/gcc-plugins/size_overflow_plugin/remove_unnecessary_dup.c
@@ -76,16 +76,16 @@ static tree get_proper_unsigned_half_type(const_tree node)
type = TREE_TYPE(node);
switch (TYPE_MODE(type)) {
- case HImode:
+ case E_HImode:
new_type = unsigned_intQI_type_node;
break;
- case SImode:
+ case E_SImode:
new_type = unsigned_intHI_type_node;
break;
- case DImode:
+ case E_DImode:
new_type = unsigned_intSI_type_node;
break;
- case TImode:
+ case E_TImode:
new_type = unsigned_intDI_type_node;
break;
default:
diff --git a/scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.c b/scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.c
index f2571bfd15d5..00fea0e28640 100644
--- a/scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.c
+++ b/scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.c
@@ -133,10 +133,17 @@ static struct attribute_spec size_overflow_attr = {
.decl_required = true,
.type_required = false,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = false,
.handler = handle_size_overflow_attribute,
+#else
#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = false
-#endif
+ .handler = handle_size_overflow_attribute,
+ .affects_type_identity = false,
+#else
+ .handler = handle_size_overflow_attribute,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static struct attribute_spec intentional_overflow_attr = {
@@ -146,10 +153,17 @@ static struct attribute_spec intentional_overflow_attr = {
.decl_required = true,
.type_required = false,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = false,
.handler = handle_intentional_overflow_attribute,
+#else
#if BUILDING_GCC_VERSION >= 4007
- .affects_type_identity = false
-#endif
+ .handler = handle_intentional_overflow_attribute,
+ .affects_type_identity = false,
+#else
+ .handler = handle_intentional_overflow_attribute,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static void register_attributes(void __unused *event_data, void __unused *data)
diff --git a/scripts/gcc-plugins/size_overflow_plugin/size_overflow_transform_core.c b/scripts/gcc-plugins/size_overflow_plugin/size_overflow_transform_core.c
index 7b24aea403dc..530df0b53451 100644
--- a/scripts/gcc-plugins/size_overflow_plugin/size_overflow_transform_core.c
+++ b/scripts/gcc-plugins/size_overflow_plugin/size_overflow_transform_core.c
@@ -37,20 +37,20 @@ tree get_size_overflow_type(struct visited *visited, const_gimple stmt, const_tr
return TREE_TYPE(node);
switch (TYPE_MODE(type)) {
- case QImode:
- case HImode:
+ case E_QImode:
+ case E_HImode:
new_type = size_overflow_type_SI;
break;
- case SImode:
+ case E_SImode:
new_type = size_overflow_type_DI;
break;
- case DImode:
+ case E_DImode:
if (LONG_TYPE_SIZE == GET_MODE_BITSIZE(SImode))
new_type = TYPE_UNSIGNED(type) ? unsigned_intDI_type_node : intDI_type_node;
else
new_type = size_overflow_type_TI;
break;
- case TImode:
+ case E_TImode:
gcc_assert(!TYPE_UNSIGNED(type));
new_type = size_overflow_type_TI;
break;
@@ -487,7 +487,7 @@ static void insert_cond_result(interesting_stmts_t expand_from, basic_block bb_t
gcc_assert(report_node);
frequency = compute_call_stmt_bb_frequency(current_function_decl, bb_true);
- edge = cgraph_create_edge(get_cnode(current_function_decl), report_node, func_stmt, bb_true->count, frequency, bb_true->loop_depth);
+ edge = cgraph_create_edge(get_cnode(current_function_decl), report_node, func_stmt, bb_true->count, frequency);
gcc_assert(edge != NULL);
}
@@ -507,7 +507,7 @@ static void insert_check_size_overflow(interesting_stmts_t expand_from, gimple s
cond_bb = e->src;
join_bb = e->dest;
e->flags = EDGE_FALSE_VALUE;
- e->probability = REG_BR_PROB_BASE;
+ e->probability = probability(REG_BR_PROB_BASE);
bb_true = create_empty_bb(cond_bb);
make_edge(cond_bb, bb_true, EDGE_TRUE_VALUE);
@@ -631,6 +631,24 @@ static bool handle_unsigned_neg_or_bit_not(interesting_stmts_t expand_from, cons
return true;
}
+static bool compare_bitsize_gt(machine_mode arg1, machine_mode arg2)
+{
+#if BUILDING_GCC_VERSION >= 8000
+ return maybe_gt(GET_MODE_BITSIZE(arg1), GET_MODE_BITSIZE(arg2));
+#else
+ return (GET_MODE_BITSIZE(arg1) > GET_MODE_BITSIZE(arg2));
+#endif
+}
+
+static bool compare_bitsize_eq(machine_mode arg1, machine_mode arg2)
+{
+#if BUILDING_GCC_VERSION >= 8000
+ return maybe_eq(GET_MODE_BITSIZE(arg1), GET_MODE_BITSIZE(arg2));
+#else
+ return (GET_MODE_BITSIZE(arg1) == GET_MODE_BITSIZE(arg2));
+#endif
+}
+
static tree create_cast_overflow_check(interesting_stmts_t expand_from, tree new_rhs1, gassign *stmt)
{
bool cast_lhs, cast_rhs;
@@ -640,8 +658,6 @@ static tree create_cast_overflow_check(interesting_stmts_t expand_from, tree new
const_tree rhs_type = TREE_TYPE(rhs);
enum machine_mode lhs_mode = TYPE_MODE(lhs_type);
enum machine_mode rhs_mode = TYPE_MODE(rhs_type);
- unsigned int lhs_size = GET_MODE_BITSIZE(lhs_mode);
- unsigned int rhs_size = GET_MODE_BITSIZE(rhs_mode);
static bool check_lhs[3][4] = {
// ss su us uu
@@ -670,10 +686,10 @@ static tree create_cast_overflow_check(interesting_stmts_t expand_from, tree new
if (rhs_mode == SImode && !TYPE_UNSIGNED(rhs_type) && (lhs_mode == HImode || lhs_mode == QImode))
return create_assign(expand_from->visited, stmt, lhs, AFTER_STMT);
- if (lhs_size > rhs_size) {
+ if (compare_bitsize_gt(lhs_mode, rhs_mode)) {
cast_lhs = check_lhs[0][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)];
cast_rhs = check_rhs[0][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)];
- } else if (lhs_size == rhs_size) {
+ } else if (compare_bitsize_eq(lhs_mode, rhs_mode)) {
cast_lhs = check_lhs[1][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)];
cast_rhs = check_rhs[1][TYPE_UNSIGNED(rhs_type) + 2 * TYPE_UNSIGNED(lhs_type)];
} else {
diff --git a/scripts/gcc-plugins/stackleak_plugin.c b/scripts/gcc-plugins/stackleak_plugin.c
index f0fdd5e28fdc..3e1710e11121 100644
--- a/scripts/gcc-plugins/stackleak_plugin.c
+++ b/scripts/gcc-plugins/stackleak_plugin.c
@@ -55,7 +55,7 @@ static void stackleak_check_alloca(gimple_stmt_iterator *gsi)
node = cgraph_get_create_node(check_function_decl);
gcc_assert(node);
frequency = compute_call_stmt_bb_frequency(current_function_decl, bb);
- cgraph_create_edge(cgraph_get_node(current_function_decl), node, check_alloca, bb->count, frequency, bb->loop_depth);
+ cgraph_create_edge(cgraph_get_node(current_function_decl), node, track_stack, bb->count, frequency);
}
static void stackleak_add_instrumentation(gimple_stmt_iterator *gsi, bool after)
@@ -156,6 +156,15 @@ static unsigned int stackleak_tree_instrument_execute(void)
return 0;
}
+static bool large_stack_frame(void)
+{
+#if BUILDING_GCC_VERSION >= 8000
+ return maybe_ge(get_frame_size(), track_frame_size);
+#else
+ return (get_frame_size() >= track_frame_size);
+#endif
+}
+
static unsigned int stackleak_final_execute(void)
{
rtx_insn *insn, *next;
@@ -164,7 +173,7 @@ static unsigned int stackleak_final_execute(void)
return 0;
// keep calls only if function frame is big enough
- if (get_frame_size() >= track_frame_size)
+ if (large_stack_frame())
return 0;
// 1. find pax_track_stack calls
@@ -190,7 +199,7 @@ static unsigned int stackleak_final_execute(void)
// warning(0, "track_frame_size: %d %ld %d", cfun->calls_alloca, get_frame_size(), track_frame_size);
// 2. delete call
delete_insn_and_edges(insn);
-#if BUILDING_GCC_VERSION >= 4007
+#if BUILDING_GCC_VERSION >= 4007 && BUILDING_GCC_VERSION < 8000
if (GET_CODE(next) == NOTE && NOTE_KIND(next) == NOTE_INSN_CALL_ARG_LOCATION) {
insn = next;
next = NEXT_INSN(insn);
diff --git a/scripts/gcc-plugins/structleak_plugin.c b/scripts/gcc-plugins/structleak_plugin.c
index d5609abdeb08..bf0e66142411 100644
--- a/scripts/gcc-plugins/structleak_plugin.c
+++ b/scripts/gcc-plugins/structleak_plugin.c
@@ -55,10 +55,17 @@ static struct attribute_spec user_attr = {
.decl_required = false,
.type_required = false,
.function_type_required = false,
+#if BUILDING_GCC_VERSION >= 8000
+ .affects_type_identity = true,
.handler = handle_user_attribute,
+#else
#if BUILDING_GCC_VERSION >= 4007
+ .handler = handle_user_attribute,
.affects_type_identity = true
-#endif
+#else
+ .handler = handle_user_attribute,
+#endif /* >= 4007 */
+#endif /* >= 8000 */
};
static void register_attributes(void *event_data __unused, void *data __unused)
--
2.18.0

View File

@ -1,43 +0,0 @@
From ad343a98e74e85aa91d844310e797f96fee6983b Mon Sep 17 00:00:00 2001
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Date: Tue, 6 Feb 2018 15:37:52 -0800
Subject: tools/lib/subcmd/pager.c: do not alias select() params
Use a separate fd set for select()-s exception fds param to fix the
following gcc warning:
pager.c:36:12: error: passing argument 2 to restrict-qualified parameter aliases with argument 4 [-Werror=restrict]
select(1, &in, NULL, &in, NULL);
^~~ ~~~
Link: http://lkml.kernel.org/r/20180101105626.7168-1-sergey.senozhatsky@gmail.com
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
tools/lib/subcmd/pager.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/lib/subcmd/pager.c b/tools/lib/subcmd/pager.c
index 5ba754d17952..9997a8805a82 100644
--- a/tools/lib/subcmd/pager.c
+++ b/tools/lib/subcmd/pager.c
@@ -30,10 +30,13 @@ static void pager_preexec(void)
* have real input
*/
fd_set in;
+ fd_set exception;
FD_ZERO(&in);
+ FD_ZERO(&exception);
FD_SET(0, &in);
- select(1, &in, NULL, &in, NULL);
+ FD_SET(0, &exception);
+ select(1, &in, NULL, &exception, NULL);
setenv("LESS", "FRSX", 0);
}
--
cgit 1.2-0.3.lf.el7

View File

@ -1,47 +0,0 @@
From 854e55ad289ef8888e7991f0ada85d5846f5afb9 Mon Sep 17 00:00:00 2001
From: Josh Poimboeuf <jpoimboe@redhat.com>
Date: Thu, 15 Mar 2018 22:11:54 -0500
Subject: objtool, perf: Fix GCC 8 -Wrestrict error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Starting with recent GCC 8 builds, objtool and perf fail to build with
the following error:
../str_error_r.c: In function str_error_r:
../str_error_r.c:25:3: error: passing argument 1 to restrict-qualified parameter aliases with argument 5 [-Werror=restrict]
snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err);
The code seems harmless, but there's probably no benefit in printing the
'buf' pointer in this situation anyway, so just remove it to make GCC
happy.
Reported-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20180316031154.juk2uncs7baffctp@treble
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/str_error_r.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/str_error_r.c b/tools/lib/str_error_r.c
index d6d65537b0d9..6aad8308a0ac 100644
--- a/tools/lib/str_error_r.c
+++ b/tools/lib/str_error_r.c
@@ -22,6 +22,6 @@ char *str_error_r(int errnum, char *buf, size_t buflen)
{
int err = strerror_r(errnum, buf, buflen);
if (err)
- snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err);
+ snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, [buf], %zd)=%d", errnum, buflen, err);
return buf;
}
--
cgit 1.2-0.3.lf.el7

File diff suppressed because it is too large Load Diff

View File

@ -1,187 +0,0 @@
diff -Nru a/scripts/gcc-plugins/checker_plugin.c b/scripts/gcc-plugins/checker_plugin.c
--- a/scripts/gcc-plugins/checker_plugin.c 2019-01-08 17:19:45.113540981 -0500
+++ b/scripts/gcc-plugins/checker_plugin.c 2019-01-15 12:52:45.604592209 -0500
@@ -457,7 +457,7 @@
// PASS_INFO(context, "ssa", 1, PASS_POS_INSERT_AFTER);
PASS_INFO(context, "phiprop", 1, PASS_POS_INSERT_AFTER);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/colorize_plugin.c b/scripts/gcc-plugins/colorize_plugin.c
--- a/scripts/gcc-plugins/colorize_plugin.c 2019-01-08 17:19:45.113540981 -0500
+++ b/scripts/gcc-plugins/colorize_plugin.c 2019-01-15 12:52:45.605592245 -0500
@@ -121,7 +121,7 @@
PASS_INFO(colorize_rearm, "*free_lang_data", 1, PASS_POS_INSERT_AFTER);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/constify_plugin.c b/scripts/gcc-plugins/constify_plugin.c
--- a/scripts/gcc-plugins/constify_plugin.c 2019-01-08 17:19:45.114540987 -0500
+++ b/scripts/gcc-plugins/constify_plugin.c 2019-01-15 12:52:45.606592280 -0500
@@ -536,7 +536,7 @@
PASS_INFO(check_local_variables, "ssa", 1, PASS_POS_INSERT_BEFORE);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/cyc_complexity_plugin.c b/scripts/gcc-plugins/cyc_complexity_plugin.c
--- a/scripts/gcc-plugins/cyc_complexity_plugin.c 2019-01-08 17:19:45.114540987 -0500
+++ b/scripts/gcc-plugins/cyc_complexity_plugin.c 2019-01-15 12:52:45.607592316 -0500
@@ -55,7 +55,7 @@
PASS_INFO(cyc_complexity, "ssa", 1, PASS_POS_INSERT_AFTER);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
--- a/scripts/gcc-plugins/gcc-common.h 2019-01-08 17:19:45.114540987 -0500
+++ b/scripts/gcc-plugins/gcc-common.h 2019-01-15 12:52:45.613592529 -0500
@@ -193,6 +193,26 @@
return cstr;
}
+static inline bool plugin_version_check_buildhack(struct plugin_gcc_version *gcc_version,
+ struct plugin_gcc_version *plugin_version)
+{
+
+ if (!gcc_version || !plugin_version)
+ return false;
+
+ if (strcmp (gcc_version->basever, plugin_version->basever))
+ return false;
+ if (strcmp (gcc_version->datestamp, plugin_version->datestamp))
+ return false;
+ if (strcmp (gcc_version->devphase, plugin_version->devphase))
+ return false;
+ if (strcmp (gcc_version->revision, plugin_version->revision))
+ return false;
+ // if (strcmp (gcc_version->configuration_arguments, plugin_version->configuration_arguments))
+ // return false;
+ return true;
+}
+
static inline void error_gcc_version(struct plugin_gcc_version *version)
{
error(G_("incompatible gcc/plugin versions: need %s %s %s %s but have %s %s %s %s"),
diff -Nru a/scripts/gcc-plugins/initify_plugin.c b/scripts/gcc-plugins/initify_plugin.c
--- a/scripts/gcc-plugins/initify_plugin.c 2019-01-08 17:19:45.115540993 -0500
+++ b/scripts/gcc-plugins/initify_plugin.c 2019-01-15 12:52:45.614592565 -0500
@@ -1819,7 +1819,7 @@
PASS_INFO(initify, "inline", 1, PASS_POS_INSERT_AFTER);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/kallocstat_plugin.c b/scripts/gcc-plugins/kallocstat_plugin.c
--- a/scripts/gcc-plugins/kallocstat_plugin.c 2019-01-08 17:19:45.115540993 -0500
+++ b/scripts/gcc-plugins/kallocstat_plugin.c 2019-01-15 12:52:45.614592565 -0500
@@ -119,7 +119,7 @@
PASS_INFO(kallocstat, "ssa", 1, PASS_POS_INSERT_AFTER);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/kernexec_plugin.c b/scripts/gcc-plugins/kernexec_plugin.c
--- a/scripts/gcc-plugins/kernexec_plugin.c 2019-01-08 17:19:45.115540993 -0500
+++ b/scripts/gcc-plugins/kernexec_plugin.c 2019-01-15 12:52:45.615592601 -0500
@@ -360,7 +360,7 @@
PASS_INFO(kernexec_fptr, "pre", 1, PASS_POS_INSERT_AFTER);
PASS_INFO(kernexec_retaddr, "pro_and_epilogue", 1, PASS_POS_INSERT_AFTER);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/latent_entropy_plugin.c b/scripts/gcc-plugins/latent_entropy_plugin.c
--- a/scripts/gcc-plugins/latent_entropy_plugin.c 2019-01-08 17:19:45.116540999 -0500
+++ b/scripts/gcc-plugins/latent_entropy_plugin.c 2019-01-15 12:52:45.615592601 -0500
@@ -577,7 +577,7 @@
PASS_INFO(latent_entropy, "optimized", 1, PASS_POS_INSERT_BEFORE);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c
--- a/scripts/gcc-plugins/randomize_layout_plugin.c 2019-01-08 17:19:45.116540999 -0500
+++ b/scripts/gcc-plugins/randomize_layout_plugin.c 2019-01-15 12:52:45.616592636 -0500
@@ -859,7 +859,7 @@
find_bad_casts_pass_info.ref_pass_instance_number = 1;
find_bad_casts_pass_info.pos_op = PASS_POS_INSERT_AFTER;
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error(G_("incompatible gcc/plugin versions"));
return 1;
}
Binary files a/scripts/gcc-plugins/rap_plugin/rap_plugin.so and b/scripts/gcc-plugins/rap_plugin/rap_plugin.so differ
diff -Nru a/scripts/gcc-plugins/sancov_plugin.c b/scripts/gcc-plugins/sancov_plugin.c
--- a/scripts/gcc-plugins/sancov_plugin.c 2019-01-08 17:19:45.117541005 -0500
+++ b/scripts/gcc-plugins/sancov_plugin.c 2019-01-15 12:52:45.617592672 -0500
@@ -114,7 +114,7 @@
PASS_INFO(sancov, "nrv", 1, PASS_POS_INSERT_BEFORE);
#endif
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.c b/scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.c
--- a/scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.c 2019-01-08 17:19:45.185541401 -0500
+++ b/scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.c 2019-01-15 12:52:45.617592672 -0500
@@ -232,7 +232,7 @@
PASS_INFO(disable_ubsan_si_overflow, "ubsan", 1, PASS_POS_REPLACE);
#endif
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/stackleak_plugin.c b/scripts/gcc-plugins/stackleak_plugin.c
--- a/scripts/gcc-plugins/stackleak_plugin.c 2019-01-08 17:19:45.186541407 -0500
+++ b/scripts/gcc-plugins/stackleak_plugin.c 2019-01-15 12:52:45.618592708 -0500
@@ -313,7 +313,7 @@
PASS_INFO(stackleak_tree_instrument, "optimized", 1, PASS_POS_INSERT_BEFORE);
PASS_INFO(stackleak_final, "final", 1, PASS_POS_INSERT_BEFORE);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}
diff -Nru a/scripts/gcc-plugins/structleak_plugin.c b/scripts/gcc-plugins/structleak_plugin.c
--- a/scripts/gcc-plugins/structleak_plugin.c 2019-01-08 17:19:45.186541407 -0500
+++ b/scripts/gcc-plugins/structleak_plugin.c 2019-01-15 12:52:45.620592779 -0500
@@ -201,7 +201,7 @@
PASS_INFO(structleak, "early_optimizations", 1, PASS_POS_INSERT_BEFORE);
- if (!plugin_default_version_check(version, &gcc_version)) {
+ if (!plugin_version_check_buildhack(version, &gcc_version)) {
error_gcc_version(version);
return 1;
}