[OE-core] [PATCH 2/2] musl: Add support for multilib

Khem Raj raj.khem at gmail.com
Tue Mar 17 07:04:17 UTC 2020


ldso is always stored in /lib regardless of multilib
add ld-musl-${MUSL_LDSO_ARCH}.path to aid ldso finding default library
loading paths, it helps when using multilib, where system libraries are
moved to lib32 or lib64 paths under / or /usr

[YOCTO #11971]

Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 meta/recipes-core/musl/musl_git.bb | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index 2a15a78cd5..82379fd1c5 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -29,6 +29,7 @@ DEPENDS = "virtual/${TARGET_PREFIX}binutils \
            libssp-nonshared \
           "
 GLIBC_LDSO = "${@get_glibc_loader(d)}"
+MUSL_LDSO_ARCH = "${@get_musl_loader_arch(d)}"
 
 export CROSS_COMPILE="${TARGET_PREFIX}"
 
@@ -48,7 +49,7 @@ CONFIGUREOPTS = " \
     --bindir=${bindir} \
     --libdir=${libdir} \
     --includedir=${includedir} \
-    --syslibdir=${base_libdir} \
+    --syslibdir=/lib \
 "
 
 do_configure() {
@@ -61,8 +62,9 @@ do_compile() {
 
 do_install() {
 	oe_runmake install DESTDIR='${D}'
-
-	install -d ${D}${bindir}
+	install -d ${D}${bindir} ${D}${base_libdir} ${D}${sysconfdir}
+        echo "${base_libdir}" > ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path
+        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}
@@ -70,6 +72,7 @@ do_install() {
 
 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 \
@@ -83,3 +86,4 @@ RPROVIDES_${PN} += "ldd libsegfault rtld(GNU_HASH)"
 
 LEAD_SONAME = "libc.so"
 INSANE_SKIP_${PN}-dev = "staticdev"
+INSANE_SKIP_${PN} = "libdir"
-- 
2.25.1



More information about the Openembedded-core mailing list