[oe-commits] [openembedded-core] 02/03: elfutils: Fix ptest compile failures on musl

git at git.openembedded.org git at git.openembedded.org
Thu May 2 08:57:10 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 0f3bb3541a01701820b52ee31b41d4a24ddd1d43
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed May 1 22:15:03 2019 +0100

    elfutils: Fix ptest compile failures on musl
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-devtools/elfutils/elfutils_0.176.bb   |  1 +
 ...1-fix-err-variable-and-function-conflicts.patch | 43 ++++++++++++++++++----
 meta/recipes-devtools/elfutils/files/musl.patch    | 29 +++++++++++++++
 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 19d27cd..157551e 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 \
            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 \
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 4cf5400..433db13 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 at windriver.com>
  tests/dwfl-proc-attach.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
-diff --git a/tests/dwfl-proc-attach.c b/tests/dwfl-proc-attach.c
-index 102ba18..ad4208e 100644
---- a/tests/dwfl-proc-attach.c
-+++ b/tests/dwfl-proc-attach.c
+Index: elfutils-0.176/tests/dwfl-proc-attach.c
+===================================================================
+--- elfutils-0.176.orig/tests/dwfl-proc-attach.c
++++ elfutils-0.176/tests/dwfl-proc-attach.c
 @@ -76,10 +76,10 @@ main (int argc __attribute__ ((unused)),
        char **argv __attribute__ ((unused)))
  {
@@ -57,6 +57,35 @@ index 102ba18..ad4208e 100644
      error (-1, err, "Couldn't create thread2");
  
    Dwfl *dwfl = dwfl_begin (&proc_callbacks);
--- 
-2.7.4
-
+Index: elfutils-0.176/tests/backtrace.c
+===================================================================
+--- elfutils-0.176.orig/tests/backtrace.c
++++ elfutils-0.176/tests/backtrace.c
+@@ -219,23 +219,23 @@ dump (Dwfl *dwfl)
+ {
+   ptrdiff_t ptrdiff = dwfl_getmodules (dwfl, dump_modules, NULL, 0);
+   assert (ptrdiff == 0);
+-  bool err = false;
++  bool err1 = false;
+   switch (dwfl_getthreads (dwfl, thread_callback, NULL))
+     {
+     case 0:
+       break;
+     case DWARF_CB_ABORT:
+-      err = true;
++      err1 = true;
+       break;
+     case -1:
+       error (0, 0, "dwfl_getthreads: %s", dwfl_errmsg (-1));
+-      err = true;
++      err1 = true;
+       break;
+     default:
+       abort ();
+     }
+   callback_verify (0, 0, 0, NULL, dwfl);
+-  if (err)
++  if (err1)
+     exit (EXIT_FAILURE);
+ }
+ 
diff --git a/meta/recipes-devtools/elfutils/files/musl.patch b/meta/recipes-devtools/elfutils/files/musl.patch
new file mode 100644
index 0000000..be35791
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/musl.patch
@@ -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 <richard.purdie at linuxfoundation.org>
+
+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;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list