Skip to contentSkip to conversation

elfutils: Fix ptest compile failures on musl

PATCH New Richard Purdie 1 participant 1 message May 1, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 elfutils: Fix ptest compile failures on musl

---
 .../elfutils/elfutils_0.176.bb                |  1 +
 ...-err-variable-and-function-conflicts.patch | 43 ++++++++++++++++---
 .../elfutils/files/musl.patch                 | 29 +++++++++++++
 3 files changed, 66 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-devtools/elfutils/files/musl.patch
meta/recipes-devtools/elfutils/elfutils_0.176.bb +1 -0
index 19d27cd992a..157551e6af9 100644
@@ -31,6 +31,7 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
            file://0001-skip-the-test-when-gcc-not-deployed.patch \
            file://run-ptest \
            file://ptest.patch \
+           file://musl.patch \
            "
 SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch \
                              file://0001-fix-err-variable-and-function-conflicts.patch \
meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch +36 -7

52 lines not on this page · raw message

meta/recipes-devtools/elfutils/files/musl.patch new file +29 -0
new file mode 100644
index 00000000000..be35791b1af
@@ -0,0 +1,29 @@
+Fix error on musl:
+
+| ../../elfutils-0.176/tests/elfstrmerge.c: In function 'main':
+| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: error: 'ALLPERMS' undeclared (first use in this function); did you mean 'EPERM'?
+|        fdnew = open (fnew, O_WRONLY | O_CREAT, st.st_mode & ALLPERMS);
+|                                                             ^~~~~~~~
+|                                                             EPERM
+| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: note: each undeclared identifier is reported only once for each function it appears in
+
+Upstream-Status: Inappropriate [workaround in musl]
+
+Signed-off-by: Richard Purdie <[email protected]>
+
+Index: elfutils-0.176/tests/elfstrmerge.c
+===================================================================
+--- elfutils-0.176.orig/tests/elfstrmerge.c
++++ elfutils-0.176/tests/elfstrmerge.c
+@@ -33,6 +33,11 @@
+ #include ELFUTILS_HEADER(dwelf)
+ #include "elf-knowledge.h"
+ 
++/* for musl */
++#ifndef ALLPERMS
++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
++#endif
++
+ /* The original ELF file.  */
+ static int fd = -1;
+ static Elf *elf = NULL;
Signature · 1 line
2.20.1