Skip to contentSkip to conversation

musl: removes aliases for glibc provided libraries

PATCH New Khem Raj 1 participant 1 message Mar 13, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 musl: removes aliases for glibc provided libraries

From: Jan Kaisrlik <[email protected]>

Based on the recommendation in musl mailing list[1] All symlinks have been removed from musl recipe.

Move stub libraries into -dev package
having them treated as normal .a which they are not, is not correct and packages shoves them into static archives, which are not installed on target usually unless asked for

this should help in linking with -lm, -lpthread etc. on target

[1]: https://www.openwall.com/lists/musl/2020/03/10/11

---
v2: Fix -lm linking problem reported on AB tests

 meta/recipes-core/musl/musl_git.bb | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)
meta/recipes-core/musl/musl_git.bb +7 -14
index afc8446547..2a15a78cd5 100644
@@ -66,27 +66,20 @@ do_install() {
 	rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO}
 	lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
 	lnr ${D}${libdir}/libc.so ${D}${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
 }
 
 PACKAGES =+ "${PN}-glibc-compat"
 
-FILES_${PN}-glibc-compat += "\
-                ${libdir}/libc.so.6 ${libdir}/libcrypt.so.1 \
-                ${libdir}/libdl.so.2 ${libdir}/libm.so.6 \
-                ${libdir}/libpthread.so.0 ${libdir}/libresolv.so.2 \
-                ${libdir}/librt.so.1 ${libdir}/libutil.so.1 \
-                ${GLIBC_LDSO} \
-                "
+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 \
+                    ${libdir}/librt.a ${libdir}/libutil.a ${libdir}/libxnet.a \
+                   "
 
 RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev libssp-nonshared-staticdev"
 RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
 RPROVIDES_${PN} += "ldd libsegfault rtld(GNU_HASH)"
 
 LEAD_SONAME = "libc.so"
+INSANE_SKIP_${PN}-dev = "staticdev"
Signature · 1 line
2.25.1