From 72084f751303405416938c776f6c1bf5b8842536 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Wed, 7 Jun 2017 16:36:44 -0400 Subject: elfutils: fix building elfutils-native with GCC7 This is heavily based on the oe-core master commit with the same subject, but includes a backport of upstream's fix for the fallthrough warnings rebased to 0.166 (the oe-core patch which targeted 0.168 did not apply), a rebase of the format-truncation patch, and a backport of the upstream format-length patch. Info from OE-Core master patch follows: From OE-Core rev: aaf4c4f3d09ac3897205417eb15e19d54e0c0d05 From: Joshua Lock Backport a fix from upstream for a -Wformat-truncation=2 warning and implement a simple fix for a -Wimplicit-fallthrough warning. Signed-off-by: Joshua Lock Signed-off-by: Richard Purdie (From OE-Core rev: 3b91be97ae8c36cd6bad86fed992efc9800f4c9e) Signed-off-by: Cody P Schafer Signed-off-by: Armin Kuster Signed-off-by: Richard Purdie --- .../elfutils-0.166/Fix_one_GCC7_warning.patch | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch (limited to 'meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch') diff --git a/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch b/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch new file mode 100644 index 0000000000..25f5e14821 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch @@ -0,0 +1,45 @@ +From 8e2ab18b874d1fda06243ad00209d44e2992928a Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Sun, 12 Feb 2017 21:51:34 +0100 +Subject: [PATCH 1/2] libasm: Fix one GCC7 -Wformat-truncation=2 warning. + +Make sure that if we have really lots of labels the tempsym doesn't get +truncated because it is too small to hold the whole name. + +This doesn't enable -Wformat-truncation=2 or fix other "issues" pointed +out by enabling this warning because there are currently some issues +with it. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79448 + +Signed-off-by: Mark Wielaard + +Upstream-Status: Backport (https://sourceware.org/git/?p=elfutils.git;a=commit;h=93c51144c3f664d4e9709da75a1d0fa00ea0fe95) +Signed-off-by: Joshua Lock +--- + libasm/asm_newsym.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/libasm/asm_newsym.c b/libasm/asm_newsym.c +index 7f522910..76482bb2 100644 +--- a/libasm/asm_newsym.c ++++ b/libasm/asm_newsym.c +@@ -1,5 +1,5 @@ + /* Define new symbol for current position in given section. +- Copyright (C) 2002, 2005 Red Hat, Inc. ++ Copyright (C) 2002, 2005, 2017 Red Hat, Inc. + This file is part of elfutils. + Written by Ulrich Drepper , 2002. + +@@ -44,7 +44,9 @@ AsmSym_t * + asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size, + int type, int binding) + { +-#define TEMPSYMLEN 10 ++/* We don't really expect labels with many digits, but in theory it could ++ be 10 digits (plus ".L" and a zero terminator). */ ++#define TEMPSYMLEN 13 + char tempsym[TEMPSYMLEN]; + AsmSym_t *result; + +-- +2.13.0 + -- cgit v1.2.3-54-g00ecf