Skip to contentSkip to conversation

musl-obstack: Add recipe

PATCH Superseded Khem Raj 3 participants 10 messages May 22, 2019 – May 23, 2019

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 musl-obstack: Add recipe

obstacks from GNUlib is used in some OE-Core packages e.g. elfutils and other packages outside OE-Core, this recipe helps provide this functionality standalone on musl systems, and helps in getting full versions of dependent packages

---
 meta/recipes-core/musl/musl-obstack.bb | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 meta/recipes-core/musl/musl-obstack.bb
meta/recipes-core/musl/musl-obstack.bb new file +22 -0
new file mode 100644
index 0000000000..9a9f04dac6
@@ -0,0 +1,22 @@
+# Copyright (C) 2019 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "A standalone library to implement GNU libc's obstack"
+DESCRIPTION = "copy + paste of the obstack functions and macros found in GNU gcc libiberty library for use with musl libc"
+HOMEPAGE = "https://github.com/pullmoll/musl-obstack"
+LICENSE = "GPL-2.0+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3d23e4eef8243efcaab6f0a438078932"
+SECTION = "libs"
+
+PV = "1.1"
+SRCREV = "d2ad66b0df44a4b784956f7f7f2717131ddc05f4"
+SRC_URI = "git://github.com/pullmoll/musl-obstack"
+
+UPSTREAM_CHECK_COMMITS = "1"
+
+inherit autotools
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_HOST = ".*-musl.*"
+
Signature · 1 line
2.21.0
author
#1 lore raw

PATCH 2/3 maintainers: Account for musl-obstack and libssp-nonshared

---
 meta/conf/distro/include/maintainers.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/distro/include/maintainers.inc +2 -0
index 67a51cdecc..2c10b104de 100644
@@ -382,6 +382,7 @@ RECIPE_MAINTAINER_pn-libsm = "Armin Kuster <[email protected]>"
 RECIPE_MAINTAINER_pn-libsndfile1 = "Tanu Kaskinen <[email protected]>"
 RECIPE_MAINTAINER_pn-libsolv = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER_pn-libsoup-2.4 = "Anuj Mittal <[email protected]>"
+RECIPE_MAINTAINER_pn-libssp-nonshared = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER_pn-libtasn1 = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER_pn-libtest-needs-perl = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER_pn-libtheora = "Alexander Kanavin <[email protected]>"
@@ -512,6 +513,7 @@ RECIPE_MAINTAINER_pn-mtd-utils = "Denys Dmytriyenko <[email protected]>"
 RECIPE_MAINTAINER_pn-mtdev = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER_pn-mtools = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER_pn-musl = "Khem Raj <[email protected]>"
+RECIPE_MAINTAINER_pn-musl-obstack = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER_pn-musl-utils = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER_pn-mx-1.0 = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER_pn-nasm = "Richard Purdie <[email protected]>"
Signature · 1 line
2.21.0
author
#2 lore raw

PATCH 3/3 elfutils: Fix eu-* utils builds for musl

In reply to 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

---
 .../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
meta/recipes-devtools/elfutils/elfutils_0.176.bb +7 -8
index 157551e6af..1729e44d5f 100644
@@ -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"
 
@@ -73,8 +74,6 @@ do_install_ptest() {
 EXTRA_OEMAKE_class-native = ""
 EXTRA_OEMAKE_class-nativesdk = ""
 
-ALLOW_EMPTY_${PN}_libc-musl = "1"
-
 BBCLASSEXTEND = "native nativesdk"
 
 # Package utilities separately
meta/recipes-devtools/elfutils/files/0001-fix-err-variable-and-function-conflicts.patch deleted +0 -91

91 lines not on this page · raw message

meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch deleted +0 -196

196 lines not on this page · raw message

meta/recipes-devtools/elfutils/files/musl-libs.patch new file +111 -0

111 lines not on this page · raw message

meta/recipes-devtools/elfutils/files/musl-obstack-fts.patch new file +105 -0

105 lines not on this page · raw message

meta/recipes-devtools/elfutils/files/musl-tests.patch renamed from meta/recipes-devtools/elfutils/files/musl.patch +0 -0
similarity index 100%
rename from meta/recipes-devtools/elfutils/files/musl.patch
rename to meta/recipes-devtools/elfutils/files/musl-tests.patch
meta/recipes-devtools/elfutils/files/musl-utils.patch new file +136 -0

136 lines not on this page · raw message

Signature · 1 line
2.21.0
#3 lore raw

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

Quoted 7 lines · Khem Raj

...
PN and PN-binutils is not empty anymore on musl
...
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ ++#endif
...

This might fix the compilation, but it is horribly wrong.

It passes a flag to a function that this function does not understand.

In the best case the function returns with an error on unknown flags.

In the worst case the function does silently something different from what the caller expects it to do.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
author
#4 lore raw

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

Quoted 10 lines · Adrian Bunk
Quoted 7 lines · Khem Raj

...
PN and PN-binutils is not empty anymore on musl
...
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ ++#endif
...

Quoted 9 lines

This might fix the compilation, but it is horribly wrong.

It passes a flag to a function that this function does not understand.

In the best case the function returns with an error on unknown flags.

In the worst case the function does silently something different from what the caller expects it to do.

I forgot that the API is provided by libc here so mimic'ing the define infact could
cause pain. I think its better to nullify it in this case where it is being used in these
files.

Quoted 10 lines

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

#5 lore raw

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

Quoted 21 lines · Khem Raj
Quoted 10 lines · Adrian Bunk
Quoted 7 lines · Khem Raj

...
PN and PN-binutils is not empty anymore on musl
...
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ ++#endif
...

Quoted 9 lines

This might fix the compilation, but it is horribly wrong.

It passes a flag to a function that this function does not understand.

In the best case the function returns with an error on unknown flags.

In the worst case the function does silently something different from what the caller expects it to do.

Quoted 5 lines

I forgot that the API is provided by libc here so mimic'ing the define infact could
cause pain. I think its better to nullify it in this case where it is being used in these
files.

Just looking at the usage in src/elfcompress.c, my first impression is that this tool is mostly useless without a properly working FNM_EXTMATCH.

Are the eu-* utils actually important in the cases where space is so limited that people are forced to use musl instead of glibc?

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
author
#6 lore raw

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

Quoted 29 lines · Adrian Bunk
Quoted 8 lines · Khem Raj
Quoted 7 lines · Adrian Bunk
Quoted 5 lines · Khem Raj

...
PN and PN-binutils is not empty anymore on musl
...
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching.

*/

Quoted 13 lines
Quoted 12 lines
Quoted 2 lines

++#endif
...

This might fix the compilation, but it is horribly wrong.

It passes a flag to a function that this function does not understand.

In the best case the function returns with an error on unknown flags.

In the worst case the function does silently something different from what the caller expects it to do.

Quoted 5 lines

I forgot that the API is provided by libc here so mimic'ing the define infact could
cause pain. I think its better to nullify it in this case where it is being used in these
files.

Quoted 7 lines

Just looking at the usage in src/elfcompress.c, my first impression is that this tool is mostly useless without a properly working FNM_EXTMATCH.

Are the eu-* utils actually important in the cases where space is so limited that people are forced to use musl instead of glibc?

They are primarily needed for testing and now we have good auto testing infra it would be good to build them

cu

Quoted 10 lines

Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

#7 lore raw

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

Quoted 34 lines · Khem Raj
Quoted 32 lines · Adrian Bunk
Quoted 8 lines · Khem Raj
Quoted 7 lines · Adrian Bunk
Quoted 5 lines · Khem Raj

...
PN and PN-binutils is not empty anymore on musl
...
++#if !defined(FNM_EXTMATCH)
++# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching.

*/

Quoted 13 lines
Quoted 12 lines
Quoted 2 lines

++#endif
...

This might fix the compilation, but it is horribly wrong.

It passes a flag to a function that this function does not understand.

In the best case the function returns with an error on unknown flags.

In the worst case the function does silently something different from what the caller expects it to do.

Quoted 5 lines

I forgot that the API is provided by libc here so mimic'ing the define infact could
cause pain. I think its better to nullify it in this case where it is being used in these
files.

Just looking at the usage in src/elfcompress.c, my first impression is that this tool is mostly useless without a properly working FNM_EXTMATCH.

Quoted 6 lines
Quoted 4 lines

Are the eu-* utils actually important in the cases where space is so limited that people are forced to use musl instead of glibc?

They are primarily needed for testing and now we have good auto testing infra it would be good to build them

Known-broken code is not a good basis for testing.

When I build elfutils locally on my x86_64 desktop and run "make check" all tests pass (with 3 skipped tests).

Adding
#undef FNM_EXTMATCH
#define FNM_EXTMATCH 0
to the defines in src/elfcompress.c gives me one test failure.

That could have easily been a day wasted by someone debugging why this test failed with musl.

If these tests are really important the fnmatch replacement from gnulib might help, similar to the other cases where missing functionality is added from gnulib to add functionality for musl builds (e.g. argp, fts).

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#8 lore raw
In reply to Khem Raj
Quoted 10 lines · Khem Raj

obstacks from GNUlib is used in some OE-Core packages e.g. elfutils and other packages outside OE-Core, this recipe helps provide this functionality standalone on musl systems, and helps in getting full versions of dependent packages

---
 meta/recipes-core/musl/musl-obstack.bb | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 meta/recipes-core/musl/musl-obstack.bb

https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/623

Cheers,

Richard

author
#9 lore raw
Quoted 7 lines · Richard Purdie
Quoted 5 lines · Khem Raj

obstacks from GNUlib is used in some OE-Core packages e.g. elfutils and other packages outside OE-Core, this recipe helps provide this functionality standalone on musl systems, and helps in getting full versions of dependent packages

Quoted 8 lines
Quoted 5 lines
---
 meta/recipes-core/musl/musl-obstack.bb | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 meta/recipes-core/musl/musl-obstack.bb

https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/623

this was due to missing pkgconfig inherit I believe. I have sent a v2 now see

https://patchwork.openembedded.org/patch/161515/

Quoted 4 lines

Cheers,

Richard