summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-01 22:15:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-02 09:56:19 +0100
commit13f45af4a460a668524c3ac6b133d5b51d8e72dc (patch)
tree6ea36a35e6bfede3fc034a59f471041b720310d9
parent8c9e8fd0d15d76080e7f691280610b91f9cc4898 (diff)
downloadpoky-13f45af4a460a668524c3ac6b133d5b51d8e72dc.tar.gz
elfutils: Fix ptest compile failures on musl
(From OE-Core rev: 0f3bb3541a01701820b52ee31b41d4a24ddd1d43) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.176.bb1
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch43
-rw-r--r--meta/recipes-devtools/elfutils/files/musl.patch29
3 files changed, 66 insertions, 7 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.176.bb b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
index 19d27cd992..157551e6af 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.176.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
@@ -31,6 +31,7 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
31 file://0001-skip-the-test-when-gcc-not-deployed.patch \ 31 file://0001-skip-the-test-when-gcc-not-deployed.patch \
32 file://run-ptest \ 32 file://run-ptest \
33 file://ptest.patch \ 33 file://ptest.patch \
34 file://musl.patch \
34 " 35 "
35SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch \ 36SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch \
36 file://0001-fix-err-variable-and-function-conflicts.patch \ 37 file://0001-fix-err-variable-and-function-conflicts.patch \
diff --git a/meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch b/meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch
index 4cf54008b7..433db133b2 100644
--- a/meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch
+++ b/meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch
@@ -39,10 +39,10 @@ Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
39 tests/dwfl-proc-attach.c | 6 +++--- 39 tests/dwfl-proc-attach.c | 6 +++---
40 1 file changed, 3 insertions(+), 3 deletions(-) 40 1 file changed, 3 insertions(+), 3 deletions(-)
41 41
42diff --git a/tests/dwfl-proc-attach.c b/tests/dwfl-proc-attach.c 42Index: elfutils-0.176/tests/dwfl-proc-attach.c
43index 102ba18..ad4208e 100644 43===================================================================
44--- a/tests/dwfl-proc-attach.c 44--- elfutils-0.176.orig/tests/dwfl-proc-attach.c
45+++ b/tests/dwfl-proc-attach.c 45+++ elfutils-0.176/tests/dwfl-proc-attach.c
46@@ -76,10 +76,10 @@ main (int argc __attribute__ ((unused)), 46@@ -76,10 +76,10 @@ main (int argc __attribute__ ((unused)),
47 char **argv __attribute__ ((unused))) 47 char **argv __attribute__ ((unused)))
48 { 48 {
@@ -57,6 +57,35 @@ index 102ba18..ad4208e 100644
57 error (-1, err, "Couldn't create thread2"); 57 error (-1, err, "Couldn't create thread2");
58 58
59 Dwfl *dwfl = dwfl_begin (&proc_callbacks); 59 Dwfl *dwfl = dwfl_begin (&proc_callbacks);
60-- 60Index: elfutils-0.176/tests/backtrace.c
612.7.4 61===================================================================
62 62--- elfutils-0.176.orig/tests/backtrace.c
63+++ elfutils-0.176/tests/backtrace.c
64@@ -219,23 +219,23 @@ dump (Dwfl *dwfl)
65 {
66 ptrdiff_t ptrdiff = dwfl_getmodules (dwfl, dump_modules, NULL, 0);
67 assert (ptrdiff == 0);
68- bool err = false;
69+ bool err1 = false;
70 switch (dwfl_getthreads (dwfl, thread_callback, NULL))
71 {
72 case 0:
73 break;
74 case DWARF_CB_ABORT:
75- err = true;
76+ err1 = true;
77 break;
78 case -1:
79 error (0, 0, "dwfl_getthreads: %s", dwfl_errmsg (-1));
80- err = true;
81+ err1 = true;
82 break;
83 default:
84 abort ();
85 }
86 callback_verify (0, 0, 0, NULL, dwfl);
87- if (err)
88+ if (err1)
89 exit (EXIT_FAILURE);
90 }
91
diff --git a/meta/recipes-devtools/elfutils/files/musl.patch b/meta/recipes-devtools/elfutils/files/musl.patch
new file mode 100644
index 0000000000..be35791b1a
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/musl.patch
@@ -0,0 +1,29 @@
1Fix error on musl:
2
3| ../../elfutils-0.176/tests/elfstrmerge.c: In function 'main':
4| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: error: 'ALLPERMS' undeclared (first use in this function); did you mean 'EPERM'?
5| fdnew = open (fnew, O_WRONLY | O_CREAT, st.st_mode & ALLPERMS);
6| ^~~~~~~~
7| EPERM
8| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: note: each undeclared identifier is reported only once for each function it appears in
9
10Upstream-Status: Inappropriate [workaround in musl]
11
12Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
13
14Index: elfutils-0.176/tests/elfstrmerge.c
15===================================================================
16--- elfutils-0.176.orig/tests/elfstrmerge.c
17+++ elfutils-0.176/tests/elfstrmerge.c
18@@ -33,6 +33,11 @@
19 #include ELFUTILS_HEADER(dwelf)
20 #include "elf-knowledge.h"
21
22+/* for musl */
23+#ifndef ALLPERMS
24+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
25+#endif
26+
27 /* The original ELF file. */
28 static int fd = -1;
29 static Elf *elf = NULL;