diff mbox series

musl: Add aliases for glibc provided libraries

Message ID 20180916155313.18535-1-raj.khem@gmail.com
State Superseded
Headers show
Series musl: Add aliases for glibc provided libraries | expand

Commit Message

Khem Raj Sept. 16, 2018, 3:53 p.m. UTC
This is a step towards running pebuilt applications for glibc  on musl
There are many realworld applications which are not always built from
source, especially provided by third party

Signee-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-core/musl/musl_git.bb | 12 ++++++++++++
 1 file changed, 12 insertions(+)

-- 
2.19.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Andre McCurdy Sept. 17, 2018, 6:19 p.m. UTC | #1
On Sun, Sep 16, 2018 at 8:53 AM, Khem Raj <raj.khem@gmail.com> wrote:
> This is a step towards running pebuilt applications for glibc  on musl

> There are many realworld applications which are not always built from

> source, especially provided by third party


Should these symlinks go in a separate package (musl-glibc-compat ?)
so that only people trying to run closed source glibc binaries on musl
need to see them?

> Signee-off-by: Khem Raj <raj.khem@gmail.com>

> ---

>  meta/recipes-core/musl/musl_git.bb | 12 ++++++++++++

>  1 file changed, 12 insertions(+)

>

> diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb

> index be31718e3a..a830c36eeb 100644

> --- a/meta/recipes-core/musl/musl_git.bb

> +++ b/meta/recipes-core/musl/musl_git.bb

> @@ -26,6 +26,14 @@ DEPENDS = "virtual/${TARGET_PREFIX}binutils \

>             bsd-headers \

>             libssp-nonshared \

>            "

> +GLIBC_LDSO ?= "ld.so.1"

> +GLIBC_LDSO_arm = "${@ bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ld-linux-armhf.so.3', 'ld-linux.so.3', d)}"

> +GLIBC_LDSO_aarch64 = "ld-linux-aarch64.so.1"

> +GLIBC_LDSO_x86 = "ld-linux.so.2"

> +GLIBC_LDSO_x86_64 = "ld-linux-x86-64.so.2"

> +GLIBC_LDSO_x32 = "ld-linux-x32.so.2"

> +GLIBC_LDSO_powerpc64 = "ld64.so.1"

> +GLIBC_LDSO_mips64 = "ld64.so.1"

>

>  export CROSS_COMPILE="${TARGET_PREFIX}"

>

> @@ -62,10 +70,14 @@ do_install() {

>         install -d ${D}${bindir}

>         rm -f ${D}${bindir}/ldd

>         lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd

> +       lnr ${D}${libdir}/libc.so ${D}${base_libdir}/${GLIBC_LDSO}

>         for l in crypt dl m pthread resolv rt util xnet

>         do

>                 ln -sf libc.so ${D}${libdir}/lib$l.so

>         done

> +       for i in libc.so.6 libcrypt.so.1 libdl.so.2 libm.so.6 libpthread.so.0 libresolv.so.2 librt.so.1 libutil.so.1; do

> +               ln -sf libc.so ${D}${libdir}/$i

> +       done

>  }

>

>  RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev libssp-nonshared-staticdev"

> --

> 2.19.0

>

> --

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj Sept. 17, 2018, 9:43 p.m. UTC | #2
On Mon, Sep 17, 2018 at 11:19 AM Andre McCurdy <armccurdy@gmail.com> wrote:

> On Sun, Sep 16, 2018 at 8:53 AM, Khem Raj <raj.khem@gmail.com> wrote:

> > This is a step towards running pebuilt applications for glibc  on musl

> > There are many realworld applications which are not always built from

> > source, especially provided by third party

>

> Should these symlinks go in a separate package (musl-glibc-compat ?)

> so that only people trying to run closed source glibc binaries on musl

> need to see them?



I thought about doing it but then this would mean we have to install that
package in image explicitly and here it’s practically adding no extra code
so decided against it but I am open if people feel strongly against it


>

> > Signee-off-by: Khem Raj <raj.khem@gmail.com>

> > ---

> >  meta/recipes-core/musl/musl_git.bb | 12 ++++++++++++

> >  1 file changed, 12 insertions(+)

> >

> > diff --git a/meta/recipes-core/musl/musl_git.bb

> b/meta/recipes-core/musl/musl_git.bb

> > index be31718e3a..a830c36eeb 100644

> > --- a/meta/recipes-core/musl/musl_git.bb

> > +++ b/meta/recipes-core/musl/musl_git.bb

> > @@ -26,6 +26,14 @@ DEPENDS = "virtual/${TARGET_PREFIX}binutils \

> >             bsd-headers \

> >             libssp-nonshared \

> >            "

> > +GLIBC_LDSO ?= "ld.so.1"

> > +GLIBC_LDSO_arm = "${@ bb.utils.contains('TUNE_FEATURES',

> 'callconvention-hard', 'ld-linux-armhf.so.3', 'ld-linux.so.3', d)}"

> > +GLIBC_LDSO_aarch64 = "ld-linux-aarch64.so.1"

> > +GLIBC_LDSO_x86 = "ld-linux.so.2"

> > +GLIBC_LDSO_x86_64 = "ld-linux-x86-64.so.2"

> > +GLIBC_LDSO_x32 = "ld-linux-x32.so.2"

> > +GLIBC_LDSO_powerpc64 = "ld64.so.1"

> > +GLIBC_LDSO_mips64 = "ld64.so.1"

> >

> >  export CROSS_COMPILE="${TARGET_PREFIX}"

> >

> > @@ -62,10 +70,14 @@ do_install() {

> >         install -d ${D}${bindir}

> >         rm -f ${D}${bindir}/ldd

> >         lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd

> > +       lnr ${D}${libdir}/libc.so ${D}${base_libdir}/${GLIBC_LDSO}

> >         for l in crypt dl m pthread resolv rt util xnet

> >         do

> >                 ln -sf libc.so ${D}${libdir}/lib$l.so

> >         done

> > +       for i in libc.so.6 libcrypt.so.1 libdl.so.2 libm.so.6

> libpthread.so.0 libresolv.so.2 librt.so.1 libutil.so.1; do

> > +               ln -sf libc.so ${D}${libdir}/$i

> > +       done

> >  }

> >

> >  RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev

> libssp-nonshared-staticdev"

> > --

> > 2.19.0

> >

> > --

> > _______________________________________________

> > Openembedded-core mailing list

> > Openembedded-core@lists.openembedded.org

> > http://lists.openembedded.org/mailman/listinfo/openembedded-core

>
<div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 17, 2018 at 11:19 AM Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, Sep 16, 2018 at 8:53 AM, Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt; wrote:<br>
&gt; This is a step towards running pebuilt applications for glibc  on musl<br>
&gt; There are many realworld applications which are not always built from<br>
&gt; source, especially provided by third party<br>
<br>
Should these symlinks go in a separate package (musl-glibc-compat ?)<br>
so that only people trying to run closed source glibc binaries on musl<br>
need to see them?</blockquote><div dir="auto"><br></div><div dir="auto">I thought about doing it but then this would mean we have to install that package in image explicitly and here it’s practically adding no extra code so decided against it but I am open if people feel strongly against it</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
&gt; Signee-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt;<br>
&gt; ---<br>
&gt;  meta/recipes-core/musl/<a href="http://musl_git.bb" rel="noreferrer" target="_blank">musl_git.bb</a> | 12 ++++++++++++<br>
&gt;  1 file changed, 12 insertions(+)<br>
&gt;<br>
&gt; diff --git a/meta/recipes-core/musl/<a href="http://musl_git.bb" rel="noreferrer" target="_blank">musl_git.bb</a> b/meta/recipes-core/musl/<a href="http://musl_git.bb" rel="noreferrer" target="_blank">musl_git.bb</a><br>
&gt; index be31718e3a..a830c36eeb 100644<br>
&gt; --- a/meta/recipes-core/musl/<a href="http://musl_git.bb" rel="noreferrer" target="_blank">musl_git.bb</a><br>
&gt; +++ b/meta/recipes-core/musl/<a href="http://musl_git.bb" rel="noreferrer" target="_blank">musl_git.bb</a><br>
&gt; @@ -26,6 +26,14 @@ DEPENDS = &quot;virtual/${TARGET_PREFIX}binutils \<br>
&gt;             bsd-headers \<br>
&gt;             libssp-nonshared \<br>
&gt;            &quot;<br>
&gt; +GLIBC_LDSO ?= &quot;ld.so.1&quot;<br>
&gt; +GLIBC_LDSO_arm = &quot;${@ bb.utils.contains(&#39;TUNE_FEATURES&#39;, &#39;callconvention-hard&#39;, &#39;ld-linux-armhf.so.3&#39;, &#39;ld-linux.so.3&#39;, d)}&quot;<br>
&gt; +GLIBC_LDSO_aarch64 = &quot;ld-linux-aarch64.so.1&quot;<br>
&gt; +GLIBC_LDSO_x86 = &quot;ld-linux.so.2&quot;<br>
&gt; +GLIBC_LDSO_x86_64 = &quot;ld-linux-x86-64.so.2&quot;<br>
&gt; +GLIBC_LDSO_x32 = &quot;ld-linux-x32.so.2&quot;<br>
&gt; +GLIBC_LDSO_powerpc64 = &quot;ld64.so.1&quot;<br>
&gt; +GLIBC_LDSO_mips64 = &quot;ld64.so.1&quot;<br>
&gt;<br>
&gt;  export CROSS_COMPILE=&quot;${TARGET_PREFIX}&quot;<br>
&gt;<br>
&gt; @@ -62,10 +70,14 @@ do_install() {<br>
&gt;         install -d ${D}${bindir}<br>
&gt;         rm -f ${D}${bindir}/ldd<br>
&gt;         lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd<br>
&gt; +       lnr ${D}${libdir}/libc.so ${D}${base_libdir}/${GLIBC_LDSO}<br>
&gt;         for l in crypt dl m pthread resolv rt util xnet<br>
&gt;         do<br>
&gt;                 ln -sf libc.so ${D}${libdir}/lib$l.so<br>
&gt;         done<br>
&gt; +       for i in libc.so.6 libcrypt.so.1 libdl.so.2 libm.so.6 libpthread.so.0 libresolv.so.2 librt.so.1 libutil.so.1; do<br>
&gt; +               ln -sf libc.so ${D}${libdir}/$i<br>
&gt; +       done<br>
&gt;  }<br>
&gt;<br>
&gt;  RDEPENDS_${PN}-dev += &quot;linux-libc-headers-dev bsd-headers-dev libssp-nonshared-staticdev&quot;<br>
&gt; --<br>
&gt; 2.19.0<br>
&gt;<br>
&gt; --<br>
&gt; _______________________________________________<br>
&gt; Openembedded-core mailing list<br>
&gt; <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
&gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div></div>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index be31718e3a..a830c36eeb 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -26,6 +26,14 @@  DEPENDS = "virtual/${TARGET_PREFIX}binutils \
            bsd-headers \
            libssp-nonshared \
           "
+GLIBC_LDSO ?= "ld.so.1"
+GLIBC_LDSO_arm = "${@ bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ld-linux-armhf.so.3', 'ld-linux.so.3', d)}"
+GLIBC_LDSO_aarch64 = "ld-linux-aarch64.so.1"
+GLIBC_LDSO_x86 = "ld-linux.so.2"
+GLIBC_LDSO_x86_64 = "ld-linux-x86-64.so.2"
+GLIBC_LDSO_x32 = "ld-linux-x32.so.2"
+GLIBC_LDSO_powerpc64 = "ld64.so.1"
+GLIBC_LDSO_mips64 = "ld64.so.1"
 
 export CROSS_COMPILE="${TARGET_PREFIX}"
 
@@ -62,10 +70,14 @@  do_install() {
 	install -d ${D}${bindir}
 	rm -f ${D}${bindir}/ldd
 	lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
+	lnr ${D}${libdir}/libc.so ${D}${base_libdir}/${GLIBC_LDSO}
 	for l in crypt dl m pthread resolv rt util xnet
 	do
 		ln -sf libc.so ${D}${libdir}/lib$l.so
 	done
+	for i in libc.so.6 libcrypt.so.1 libdl.so.2 libm.so.6 libpthread.so.0 libresolv.so.2 librt.so.1 libutil.so.1; do
+		ln -sf libc.so ${D}${libdir}/$i
+	done
 }
 
 RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev libssp-nonshared-staticdev"