[OE-core] [sumo][PATCH 1/4] elfutils(-native): Add backported patch to fix build with host gcc9

Andreas Müller schnitzeltony at gmail.com
Tue Sep 24 10:59:22 UTC 2019


Signed-off-by: Andreas Müller <schnitzeltony at gmail.com>
---
 .../elfutils/elfutils_0.170.bb                |  1 +
 ...-fsize-and-msize-with-const-attribut.patch | 42 +++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 meta/recipes-devtools/elfutils/files/0009-libelf-Mark-both-fsize-and-msize-with-const-attribut.patch

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.170.bb b/meta/recipes-devtools/elfutils/elfutils_0.170.bb
index 14ac22ee643..48f14286203 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.170.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.170.bb
@@ -25,6 +25,7 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
            file://debian/0003-Add-mips-n64-relocation-format-hack.patch \
            file://0001-Use-fallthrough-attribute.patch \
            file://0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch \
+           file://0009-libelf-Mark-both-fsize-and-msize-with-const-attribut.patch \
            "
 SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch"
 SRC_URI[md5sum] = "03599aee98c9b726c7a732a2dd0245d5"
diff --git a/meta/recipes-devtools/elfutils/files/0009-libelf-Mark-both-fsize-and-msize-with-const-attribut.patch b/meta/recipes-devtools/elfutils/files/0009-libelf-Mark-both-fsize-and-msize-with-const-attribut.patch
new file mode 100644
index 00000000000..b5f8fd417aa
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0009-libelf-Mark-both-fsize-and-msize-with-const-attribut.patch
@@ -0,0 +1,42 @@
+From a01938d584b91e747167bb4b3f30ec300c4d6e43 Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mark at klomp.org>
+Date: Fri, 16 Nov 2018 09:27:00 +0100
+Subject: [PATCH] libelf: Mark both fsize and msize with const attribute.
+
+GCC9 -Wmissing-attributes pointed out that although we alias the fsize
+and msize functions only fsize was marked as const. Fix by also marking
+the msize definition as const.
+
+https://sourceware.org/bugzilla/show_bug.cgi?id=23884
+
+Signed-off-by: Mark Wielaard <mark at klomp.org>
+
+Upstream-Status: Backport [1]
+
+[1] https://sourceware.org/git/?p=elfutils.git;a=commit;h=a01938d584b91e747167bb4b3f30ec300c4d6e43
+
+Signed-off-by: Andreas Müller <schnitzeltony at gmail.com>
+---
+ libelf/ChangeLog | 5 +++++
+ libelf/libelfP.h | 4 ++--
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/libelf/libelfP.h b/libelf/libelfP.h
+index fa6d55d8..9f3e8e9d 100644
+--- a/libelf/libelfP.h
++++ b/libelf/libelfP.h
+@@ -461,9 +461,9 @@ extern Elf_Type __libelf_data_type (Elf *elf, int sh_type, GElf_Xword align)
+    These functions cannot be marked internal since they are aliases
+    of the export elfXX_fsize functions.*/
+ extern size_t __elf32_msize (Elf_Type __type, size_t __count,
+-			     unsigned int __version);
++			     unsigned int __version) __const_attribute__;
+ extern size_t __elf64_msize (Elf_Type __type, size_t __count,
+-			     unsigned int __version);
++			     unsigned int __version) __const_attribute__;
+ 
+ 
+ /* Create Elf descriptor from memory image.  */
+-- 
+2.21.0
+
-- 
2.21.0



More information about the Openembedded-core mailing list