Re: [OE-core] [PATCH v2 3/4] elfutils: Fix eu-* utils builds for musl

2019-05-29 Thread ChenQi
There's some musl elfutils failure about do_compile_ptest_base on 
autobuilder.

https://autobuilder.yoctoproject.org/typhoon/#/builders/45/builds/645/steps/7/logs/step1b

I noticed that this patch is not yet in master-next. Can this patch 
solve the problem above?


Best Regards,
Chen Qi

On 05/23/2019 07:40 AM, Khem Raj wrote:

Re-organize the musl patches in three different areas namely
libs, utils and tests, this will help maintain them in future
version bumps

Add obstack dependency on musl targets which is needed for eu-*

PN and PN-binutils is not empty anymore on musl

Signed-off-by: Khem Raj 
Signed-off-by: Richard Purdie 
---
v2: Make FNM_EXTMATCH 0

  .../elfutils/elfutils_0.176.bb|  15 +-
  ...-err-variable-and-function-conflicts.patch |  91 
  ...ternatives-for-glibc-assumptions-hel.patch | 196 --
  .../elfutils/files/musl-libs.patch| 111 ++
  .../elfutils/files/musl-obstack-fts.patch | 105 ++
  .../files/{musl.patch => musl-tests.patch}|   0
  .../elfutils/files/musl-utils.patch   | 136 
  7 files changed, 359 insertions(+), 295 deletions(-)
  delete mode 100644 
meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch
  delete mode 100644 
meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
  create mode 100644 meta/recipes-devtools/elfutils/files/musl-libs.patch
  create mode 100644 meta/recipes-devtools/elfutils/files/musl-obstack-fts.patch
  rename meta/recipes-devtools/elfutils/files/{musl.patch => musl-tests.patch} 
(100%)
  create mode 100644 meta/recipes-devtools/elfutils/files/musl-utils.patch

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.176.bb 
b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
index 85ff5f38d2..397723166c 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.176.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
@@ -4,7 +4,7 @@ SECTION = "base"
  LICENSE = "GPLv2 & LGPLv3+ & GPLv3+"
  LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
  DEPENDS = "libtool bzip2 zlib virtual/libintl"
-DEPENDS_append_libc-musl = " argp-standalone fts "
+DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack "
  # The Debian patches below are from:
  # 
http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.175-1.debian.tar.xz
  SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
@@ -31,12 +31,13 @@ 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 \
-"
-
+SRC_URI_append_libc-musl = " \
+   file://musl-obstack-fts.patch \
+   file://musl-libs.patch \
+   file://musl-utils.patch \
+   file://musl-tests.patch \
+   "
  SRC_URI[md5sum] = "077e4f49320cad82bf17a997068b1db9"
  SRC_URI[sha256sum] = 
"eb5747c371b0af0f71e86215a5ebb88728533c3a104a43d4231963f308cd1023"
  
@@ -75,8 +76,6 @@ do_install_ptest() {

  EXTRA_OEMAKE_class-native = ""
  EXTRA_OEMAKE_class-nativesdk = ""
  
-ALLOW_EMPTY_${PN}_libc-musl = "1"

-
  BBCLASSEXTEND = "native nativesdk"
  
  # Package utilities separately

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
deleted file mode 100644
index 433db133b2..00
--- 
a/meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 2c50fe7068bd6911958c6d851aef88179e73bb21 Mon Sep 17 00:00:00 2001
-From: Mingli Yu 
-Date: Tue, 16 Apr 2019 15:30:38 +0800
-Subject: [PATCH] fix err variable and function conflicts
-
-There comes below build failure with musl when
-ptest enabled.
-| In file included from ../../elfutils-0.176/tests/dwfl-proc-attach.c:33:
-| ../../elfutils-0.176/lib/system.h:63:35: error: called object 'err' is not a 
function or function pointer
-|  #define error(status, errno, ...) err(status, __VA_ARGS__)
-|^~~
-| ../../elfutils-0.176/tests/dwfl-proc-attach.c:92:5: note: in expansion of 
macro 'error'
-|  error (-1, 0, "dwfl_linux_proc_attach pid %d: %s", pid,
-|  ^
-| ../../elfutils-0.176/tests/dwfl-proc-attach.c:79:7: note: declared here
-|int err;
-|^~~
-
-It is because there is no error.h in musl and
-the patch 0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
-has updated to use err.h to replace error.h
-and also added macro definiton as below when
-use musl.
- #define error(status, errno, ...) 

[OE-core] [PATCH v2 3/4] elfutils: Fix eu-* utils builds for musl

2019-05-22 Thread Khem Raj
Re-organize the musl patches in three different areas namely
libs, utils and tests, this will help maintain them in future
version bumps

Add obstack dependency on musl targets which is needed for eu-*

PN and PN-binutils is not empty anymore on musl

Signed-off-by: Khem Raj 
Signed-off-by: Richard Purdie 
---
v2: Make FNM_EXTMATCH 0

 .../elfutils/elfutils_0.176.bb|  15 +-
 ...-err-variable-and-function-conflicts.patch |  91 
 ...ternatives-for-glibc-assumptions-hel.patch | 196 --
 .../elfutils/files/musl-libs.patch| 111 ++
 .../elfutils/files/musl-obstack-fts.patch | 105 ++
 .../files/{musl.patch => musl-tests.patch}|   0
 .../elfutils/files/musl-utils.patch   | 136 
 7 files changed, 359 insertions(+), 295 deletions(-)
 delete mode 100644 
meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch
 delete mode 100644 
meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
 create mode 100644 meta/recipes-devtools/elfutils/files/musl-libs.patch
 create mode 100644 meta/recipes-devtools/elfutils/files/musl-obstack-fts.patch
 rename meta/recipes-devtools/elfutils/files/{musl.patch => musl-tests.patch} 
(100%)
 create mode 100644 meta/recipes-devtools/elfutils/files/musl-utils.patch

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.176.bb 
b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
index 85ff5f38d2..397723166c 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.176.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
@@ -4,7 +4,7 @@ SECTION = "base"
 LICENSE = "GPLv2 & LGPLv3+ & GPLv3+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 DEPENDS = "libtool bzip2 zlib virtual/libintl"
-DEPENDS_append_libc-musl = " argp-standalone fts "
+DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack "
 # The Debian patches below are from:
 # 
http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.175-1.debian.tar.xz
 SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
@@ -31,12 +31,13 @@ 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 \
-"
-
+SRC_URI_append_libc-musl = " \
+   file://musl-obstack-fts.patch \
+   file://musl-libs.patch \
+   file://musl-utils.patch \
+   file://musl-tests.patch \
+   "
 SRC_URI[md5sum] = "077e4f49320cad82bf17a997068b1db9"
 SRC_URI[sha256sum] = 
"eb5747c371b0af0f71e86215a5ebb88728533c3a104a43d4231963f308cd1023"
 
@@ -75,8 +76,6 @@ do_install_ptest() {
 EXTRA_OEMAKE_class-native = ""
 EXTRA_OEMAKE_class-nativesdk = ""
 
-ALLOW_EMPTY_${PN}_libc-musl = "1"
-
 BBCLASSEXTEND = "native nativesdk"
 
 # Package utilities separately
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
deleted file mode 100644
index 433db133b2..00
--- 
a/meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 2c50fe7068bd6911958c6d851aef88179e73bb21 Mon Sep 17 00:00:00 2001
-From: Mingli Yu 
-Date: Tue, 16 Apr 2019 15:30:38 +0800
-Subject: [PATCH] fix err variable and function conflicts
-
-There comes below build failure with musl when
-ptest enabled.
-| In file included from ../../elfutils-0.176/tests/dwfl-proc-attach.c:33:
-| ../../elfutils-0.176/lib/system.h:63:35: error: called object 'err' is not a 
function or function pointer
-|  #define error(status, errno, ...) err(status, __VA_ARGS__)
-|^~~
-| ../../elfutils-0.176/tests/dwfl-proc-attach.c:92:5: note: in expansion of 
macro 'error'
-|  error (-1, 0, "dwfl_linux_proc_attach pid %d: %s", pid,
-|  ^
-| ../../elfutils-0.176/tests/dwfl-proc-attach.c:79:7: note: declared here
-|int err;
-|^~~
-
-It is because there is no error.h in musl and
-the patch 0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
-has updated to use err.h to replace error.h
-and also added macro definiton as below when
-use musl.
- #define error(status, errno, ...) err(status, __VA_ARGS__)
-
-And in err.h, there is below logic:
-_Noreturn void err(int, const char *, ...);
-
-But when ptest enabled, there comes below error
-as there is both variable and function defined
-to be err in tests/dwfl-proc-attach.c.
-So change the err variable's name to workaround
-the build failure with musl.
-
-Upstream-Status: Inappropriate [workaround