Skip to contentSkip to conversation

zlib: clean up base_libdir symlink

PATCH New Ross Burton 1 participant 1 message May 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zlib: clean up base_libdir symlink

libz.so symbolic link created in ${libdir} is ../../${base_libdir}/libz.so.1.2.8. This doesn't work if base_libdir or libdir is changed, so use oe.path.relative to construct the correct path at build time.

---
 meta/recipes-core/zlib/zlib_1.2.8.bb | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
meta/recipes-core/zlib/zlib_1.2.8.bb +4 -6
index ca0ba3f..9470adb 100644
@@ -6,7 +6,6 @@ SECTION = "libs"
 LICENSE = "Zlib"
 LIC_FILES_CHKSUM = "file://zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd"
 
-
 SRC_URI = "http://www.zlib.net/${BPN}-${PV}.tar.xz \
            file://remove.ldconfig.call.patch \
            file://Makefile-runtests.patch \
@@ -45,16 +44,15 @@ do_install_ptest() {
 	install ${B}/minigzipsh ${D}${PTEST_PATH}
 }
 
-# We move zlib shared libraries for target builds to avoid
-# qa warnings.
-#
+# Move zlib shared libraries for target builds to $base_libdir so the library
+# can be used in early boot before $prefix is mounted.
 do_install_append_class-target() {
 	if [ ${base_libdir} != ${libdir} ]
 	then
 		mkdir -p ${D}/${base_libdir}
 		mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
-		tmp=`readlink ${D}/${libdir}/libz.so`
-		ln -sf ../../${base_libdir}/$tmp ${D}/${libdir}/libz.so
+		libname=`readlink ${D}/${libdir}/libz.so`
+		ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname ${D}${libdir}/libz.so
 	fi
 }
 
Signature · 1 line
2.1.4