summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2017-04-06 14:23:13 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-10 23:00:43 +0100
commit5784961762205ee000cbbfc115b0b356fd4ea197 (patch)
treecbcecab3c4b12bc760048a9a4170d1cc3be149f3 /meta/recipes-devtools/elfutils
parent34313c404738dce9e4732700e612cfb5a2d5ee58 (diff)
downloadpoky-5784961762205ee000cbbfc115b0b356fd4ea197.tar.gz
elfutils: fix building elfutils-native with GCC7
Backport a fix from upstream for a -Wformat-truncation=2 warning and implement a simple fix for a -Wimplicit-fallthrough warning. (From OE-Core rev: aaf4c4f3d09ac3897205417eb15e19d54e0c0d05) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/elfutils')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.168/Fix_one_GCC7_warning.patch44
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.168/fallthrough.patch36
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.168.bb3
3 files changed, 83 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.168/Fix_one_GCC7_warning.patch b/meta/recipes-devtools/elfutils/elfutils-0.168/Fix_one_GCC7_warning.patch
new file mode 100644
index 0000000000..d88f4ebd0c
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.168/Fix_one_GCC7_warning.patch
@@ -0,0 +1,44 @@
1From 93c51144c3f664d4e9709da75a1d0fa00ea0fe95 Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Sun, 12 Feb 2017 21:51:34 +0100
4Subject: [PATCH] libasm: Fix one GCC7 -Wformat-truncation=2 warning.
5
6Make sure that if we have really lots of labels the tempsym doesn't get
7truncated because it is too small to hold the whole name.
8
9This doesn't enable -Wformat-truncation=2 or fix other "issues" pointed
10out by enabling this warning because there are currently some issues
11with it. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79448
12
13Signed-off-by: Mark Wielaard <mark@klomp.org>
14
15Upstream-Status: Backport (https://sourceware.org/git/?p=elfutils.git;a=commit;h=93c51144c3f664d4e9709da75a1d0fa00ea0fe95)
16Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
17
18---
19 libasm/ChangeLog | 6 +++++-
20 libasm/asm_newsym.c | 6 ++++--
21 2 files changed, 9 insertions(+), 3 deletions(-)
22
23Index: elfutils-0.168/libasm/asm_newsym.c
24===================================================================
25--- elfutils-0.168.orig/libasm/asm_newsym.c
26+++ elfutils-0.168/libasm/asm_newsym.c
27@@ -1,5 +1,5 @@
28 /* Define new symbol for current position in given section.
29- Copyright (C) 2002, 2005, 2016 Red Hat, Inc.
30+ Copyright (C) 2002, 2005, 2016, 2017 Red Hat, Inc.
31 This file is part of elfutils.
32 Written by Ulrich Drepper <drepper@redhat.com>, 2002.
33
34@@ -44,7 +44,9 @@ AsmSym_t *
35 asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size,
36 int type, int binding)
37 {
38-#define TEMPSYMLEN 10
39+/* We don't really expect labels with many digits, but in theory it could
40+ be 10 digits (plus ".L" and a zero terminator). */
41+#define TEMPSYMLEN 13
42 char tempsym[TEMPSYMLEN];
43 AsmSym_t *result;
44
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.168/fallthrough.patch b/meta/recipes-devtools/elfutils/elfutils-0.168/fallthrough.patch
new file mode 100644
index 0000000000..b2623f9d2e
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.168/fallthrough.patch
@@ -0,0 +1,36 @@
1GCC7 adds -Wimplicit-fallthrough to warn when a switch case falls through,
2however this causes warnings (which are promoted to errors) with the elfutils
3patches from Debian for mips and parisc, which use fallthrough's by design.
4
5Explicitly mark the intentional fallthrough switch cases with a comment to
6disable the warnings where the fallthrough behaviour is desired.
7
8Upstream-Status: Pending [debian]
9Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
10
11Index: elfutils-0.168/backends/parisc_retval.c
12===================================================================
13--- elfutils-0.168.orig/backends/parisc_retval.c
14+++ elfutils-0.168/backends/parisc_retval.c
15@@ -166,7 +166,7 @@ parisc_return_value_location_ (Dwarf_Die
16 return nloc_intregpair;
17
18 /* Else fall through. */
19- }
20+ } // fallthrough
21
22 case DW_TAG_structure_type:
23 case DW_TAG_class_type:
24Index: elfutils-0.168/backends/mips_retval.c
25===================================================================
26--- elfutils-0.168.orig/backends/mips_retval.c
27+++ elfutils-0.168/backends/mips_retval.c
28@@ -387,7 +387,7 @@ mips_return_value_location (Dwarf_Die *f
29 else
30 return nloc_intregpair;
31 }
32- }
33+ } // fallthrough
34
35 /* Fallthrough to handle large types */
36
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.168.bb b/meta/recipes-devtools/elfutils/elfutils_0.168.bb
index 9557933faa..3b8f2a3147 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.168.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.168.bb
@@ -17,6 +17,7 @@ SRC_URI += "\
17 file://0001-remove-the-unneed-checking.patch \ 17 file://0001-remove-the-unneed-checking.patch \
18 file://0001-fix-a-stack-usage-warning.patch \ 18 file://0001-fix-a-stack-usage-warning.patch \
19 file://aarch64_uio.patch \ 19 file://aarch64_uio.patch \
20 file://Fix_one_GCC7_warning.patch \
20 file://shadow.patch \ 21 file://shadow.patch \
21" 22"
22 23
@@ -35,6 +36,8 @@ SRC_URI += "\
35 file://debian/hurd_path.patch \ 36 file://debian/hurd_path.patch \
36 file://debian/ignore_strmerge.diff \ 37 file://debian/ignore_strmerge.diff \
37" 38"
39# Fix the patches from Debian with GCC7
40SRC_URI += "file://fallthrough.patch"
38SRC_URI_append_libc-musl = " file://0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch " 41SRC_URI_append_libc-musl = " file://0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch "
39 42
40# The buildsystem wants to generate 2 .h files from source using a binary it just built, 43# The buildsystem wants to generate 2 .h files from source using a binary it just built,