Skip to contentSkip to conversation

gcompat: Add recipe

PATCH In review Khem Raj 2 participants 4 messages Jun 12, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 gcompat: Add recipe

This is a compat library which helps running pre-compiled binaries which were compiled for glibc but needs to run on musl systems, this is quite common case where pre-existing binaries are supplied and can not be recompiled immediately

Cc Andrea Adami <[email protected]>
---
 meta/conf/distro/include/maintainers.inc |  1 +
 meta/recipes-core/musl/gcompat_git.bb    | 42 ++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 meta/recipes-core/musl/gcompat_git.bb
meta/conf/distro/include/maintainers.inc +1 -0
index 71943ffe26..e59f01d66a 100644
@@ -229,6 +229,7 @@ RECIPE_MAINTAINER_pn-gobject-introspection = "Alexander Kanavin <alex.kanavin@gm
 RECIPE_MAINTAINER_pn-gperf = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER_pn-gpgme = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER_pn-gptfdisk = "Alexander Kanavin <[email protected]>"
+RECIPE_MAINTAINER_pn-gcompat = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER_pn-grep = "Denys Dmytriyenko <[email protected]>"
 RECIPE_MAINTAINER_pn-groff = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER_pn-grub = "Anuj Mittal <[email protected]>"
meta/recipes-core/musl/gcompat_git.bb new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.32.0
author
#1 lore raw

PATCH 2/2 musl: Do not package glibc loader

This was a ad-hoc solution which did not really work in all cases, now gcompat is provided to deal with glibc based prebuilts, therefore there is no need to provide this package

---
 meta/recipes-core/musl/gcompat_git.bb | 2 ++
 meta/recipes-core/musl/musl_git.bb    | 4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)
meta/recipes-core/musl/gcompat_git.bb +2 -0
index 6792c0be70..e1ae052c44 100644
@@ -34,6 +34,8 @@ do_compile () {
 do_install () {
 	oe_runmake install 'DESTDIR=${D}'
 }
+
+RPROVIDES_${PN} += "musl-glibc-compat"
 #
 # We will skip parsing for non-musl systems
 #
meta/recipes-core/musl/musl_git.bb +0 -4
index 795b888bb3..6569d1b37b 100644
@@ -68,13 +68,9 @@ do_install() {
         echo "${libdir}" >> ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path
 	rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO}
 	lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
-	lnr ${D}${libdir}/libc.so ${D}${GLIBC_LDSO}
 }
 
-PACKAGES =+ "${PN}-glibc-compat"
-
 FILES_${PN} += "/lib/ld-musl-${MUSL_LDSO_ARCH}.so.1 ${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path"
-FILES_${PN}-glibc-compat += "${GLIBC_LDSO}"
 FILES_${PN}-staticdev = "${libdir}/libc.a"
 FILES_${PN}-dev =+ "${libdir}/libcrypt.a ${libdir}/libdl.a ${libdir}/libm.a \
                     ${libdir}/libpthread.a ${libdir}/libresolv.a \
Signature · 1 line
2.32.0
#2 lore raw
In reply to Khem Raj

Please ensure that PV is set so that upstream version check works (I'm not sure if it does, looking at it):

devtool check-upgrade-status gcompat

Alex

Quoted 88 lines · Khem Raj

This is a compat library which helps running pre-compiled binaries which were
compiled for glibc but needs to run on musl systems, this is quite common case where pre-existing binaries are supplied and can not be recompiled immediately

Cc Andrea Adami <[email protected]>
---
 meta/conf/distro/include/maintainers.inc |  1 +
 meta/recipes-core/musl/gcompat_git.bb    | 42 ++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 meta/recipes-core/musl/gcompat_git.bb
meta/conf/distro/include/maintainers.inc +0 -0
index 71943ffe26..e59f01d66a 100644
@@ -229,6 +229,7 @@ RECIPE_MAINTAINER_pn-gobject-introspection =

"Alexander Kanavin <alex.kanavin@gm
RECIPE_MAINTAINER_pn-gperf = "Alexander Kanavin <[email protected]>" RECIPE_MAINTAINER_pn-gpgme = "Hongxu Jia <[email protected]>" RECIPE_MAINTAINER_pn-gptfdisk = "Alexander Kanavin <
[email protected]>"

meta/conf/distro/include/maintainers.inc +1 -0
+RECIPE_MAINTAINER_pn-gcompat = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER_pn-grep = "Denys Dmytriyenko <[email protected]>"
 RECIPE_MAINTAINER_pn-groff = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER_pn-grub = "Anuj Mittal <[email protected]>"
meta/recipes-core/musl/gcompat_git.bb new file +4 -0
new file mode 100644
index 0000000000..6792c0be70
@@ -0,0 +1,42 @@
+# Copyright (C) 2021 Khem Raj <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "A library which provides glibc-compatible APIs for use on musl

libc systems"

meta/recipes-core/musl/gcompat_git.bb new file +6 -0
+HOMEPAGE = "https://git.adelielinux.org/adelie/gcompat"
+
+LICENSE = "NCSA"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb33ef4af05a9c7602843afb7adfe792"
+
+SRC_URI = "git://

git.adelielinux.org/adelie/gcompat.git;protocol=https;branch=current"

meta/recipes-core/musl/gcompat_git.bb new file +14 -0
+
+PV = "1.0.0+1.1+git${SRCPV}"
+SRCREV = "af5a49e489fdc04b9cf02547650d7aeaccd43793"
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig linuxloader
+
+DEPENDS += "musl-obstack"
+
+GLIBC_LDSO = "${@get_glibc_loader(d)}"
+MUSL_LDSO = "${@get_musl_loader(d)}"
+
+EXTRA_OEMAKE = "LINKER_PATH=${MUSL_LDSO} LOADER_NAME=`basename

${@get_glibc_loader(d)}`"

meta/recipes-core/musl/gcompat_git.bb new file +18 -1
+
+do_configure () {
+       :
+}
+
+do_compile () {
+       oe_runmake
+}
+
+do_install () {
+       oe_runmake install 'DESTDIR=${D}'
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
+
+UPSTREAM_CHECK_COMMITS = "1"
--

2.32.0

author
#3 lore raw
Quoted 3 lines · Alexander Kanavin

Please ensure that PV is set so that upstream version check works (I'm not sure if it does, looking at it):

devtool check-upgrade-status gcompat

its working fine, PV is set ( just below SRC_URI),

Quoted 107 lines

Alex

On Sat, 12 Jun 2021 at 21:43, Khem Raj <[email protected] <mailto:[email protected]>> wrote:

    This is a compat library which helps running pre-compiled binaries
    which were
    compiled for glibc but needs to run on musl systems, this is quite
    common case where pre-existing binaries are supplied and can not be
    recompiled immediately

    Signed-off-by: Khem Raj <[email protected] <mailto:[email protected]>>
    Cc: Andrea Adami <[email protected]
    <mailto:[email protected]>>
    ---
      meta/conf/distro/include/maintainers.inc |  1 +
      meta/recipes-core/musl/gcompat_git.bb <http://gcompat_git.bb>    |
    42 ++++++++++++++++++++++++
      2 files changed, 43 insertions(+)
      create mode 100644 meta/recipes-core/musl/gcompat_git.bb
    <http://gcompat_git.bb>

    diff --git a/meta/conf/distro/include/maintainers.inc
    b/meta/conf/distro/include/maintainers.inc
    index 71943ffe26..e59f01d66a 100644
    --- a/meta/conf/distro/include/maintainers.inc
    +++ b/meta/conf/distro/include/maintainers.inc
    @@ -229,6 +229,7 @@ RECIPE_MAINTAINER_pn-gobject-introspection =
    "Alexander Kanavin <alex.kanavin@gm
      RECIPE_MAINTAINER_pn-gperf = "Alexander Kanavin
    <[email protected] <mailto:[email protected]>>"
      RECIPE_MAINTAINER_pn-gpgme = "Hongxu Jia <[email protected]
    <mailto:[email protected]>>"
      RECIPE_MAINTAINER_pn-gptfdisk = "Alexander Kanavin
    <[email protected] <mailto:[email protected]>>"
    +RECIPE_MAINTAINER_pn-gcompat = "Khem Raj <[email protected]
    <mailto:[email protected]>>"
      RECIPE_MAINTAINER_pn-grep = "Denys Dmytriyenko <[email protected]
    <mailto:[email protected]>>"
      RECIPE_MAINTAINER_pn-groff = "Hongxu Jia <[email protected]
    <mailto:[email protected]>>"
      RECIPE_MAINTAINER_pn-grub = "Anuj Mittal <[email protected]
    <mailto:[email protected]>>"
    diff --git a/meta/recipes-core/musl/gcompat_git.bb
    <http://gcompat_git.bb> b/meta/recipes-core/musl/gcompat_git.bb
    <http://gcompat_git.bb>
    new file mode 100644
    index 0000000000..6792c0be70
    --- /dev/null
    +++ b/meta/recipes-core/musl/gcompat_git.bb <http://gcompat_git.bb>
    @@ -0,0 +1,42 @@
    +# Copyright (C) 2021 Khem Raj <[email protected]
    <mailto:[email protected]>>
    +# Released under the MIT license (see COPYING.MIT for the terms)
    +
    +SUMMARY = "A library which provides glibc-compatible APIs for use
    on musl libc systems"
    +HOMEPAGE = "https://git.adelielinux.org/adelie/gcompat
    <https://git.adelielinux.org/adelie/gcompat>"
    +
    +LICENSE = "NCSA"
    +LIC_FILES_CHKSUM =
    "file://LICENSE;md5=eb33ef4af05a9c7602843afb7adfe792"
    +
    +SRC_URI =
    "git://git.adelielinux.org/adelie/gcompat.git;protocol=https;branch=current
    <http://git.adelielinux.org/adelie/gcompat.git;protocol=https;branch=current>"
    +
    +PV = "1.0.0+1.1+git${SRCPV}"
    +SRCREV = "af5a49e489fdc04b9cf02547650d7aeaccd43793"
    +
    +S = "${WORKDIR}/git"
    +
    +inherit pkgconfig linuxloader
    +
    +DEPENDS += "musl-obstack"
    +
    +GLIBC_LDSO = "${@get_glibc_loader(d)}"
    +MUSL_LDSO = "${@get_musl_loader(d)}"
    +
    +EXTRA_OEMAKE = "LINKER_PATH=${MUSL_LDSO} LOADER_NAME=`basename
    ${@get_glibc_loader(d)}`"
    +
    +do_configure () {
    +       :
    +}
    +
    +do_compile () {
    +       oe_runmake
    +}
    +
    +do_install () {
    +       oe_runmake install 'DESTDIR=${D}'
    +}
    +#
    +# We will skip parsing for non-musl systems
    +#
    +COMPATIBLE_HOST = ".*-musl.*"
    +
    +UPSTREAM_CHECK_COMMITS = "1"
    -- 
    2.32.0