Update zlib 1.2.11 to 1.2.12

Colibri VF61
Linux BSP 2.8.6
Build with yocto 2.4 (rocko)

Dear community,
I need to be update zlib from 1.2.11 to 1.2.12 in my running environment. I found the version in the openembedded lay endex → https://layers.openembedded.org/layerindex/recipe/5049/ .
It is available for the current yocto project.

It is possible to added this to my yocto version (2.4)?
And how can I replace the 1.2.11 with 1.2.12?

Hi @Andre !

You can simply add the newer zlib to your recipes and test it. By default, Yocto/Bitbake selects the newest version of a recipe to use. But you need to check for preferred versions and also layer priorities to be sure that the desired recipe will be there.

Also, you can check the differences between the recipes:

http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/zlib/zlib_1.2.12.bb?h=master
http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/zlib/zlib_1.2.11.bb?h=rocko

But be aware: Rocko version of Yocto is compatible with zlib 1.2.11, according to the Other Branch section o the link that you shared.


A side note: you are using BSP 2.8.6, but we have newer releases than that. Please check the Embedded Linux Release Matrix | Toradex Developer Center article.

Best regards,

1 Like

Hi @Andre !

Were you able to solve your issue?

Best regards,

Hi @henrique.tx

I added the zlib (1.2.12) recipie from master branch to my layer. But I get the followring error message

dev@xxx:~/test/oe-core/build$ bitbake zlib
ERROR: ParseError at /home/dev/ems/oe-core/build/…/layers/meta-mylayer/recipes-core/zlib/zlib_1.2.12.bb:22: unparsed line: ‘RDEPENDS:${PN}-ptest += “make”’

Do you have any idears?

Hi @Andre,

checking the diff between 1.2.12 and 1.2.11, I could see this line changed:

CFLAGS += "-D_REENTRANT"
 
-RDEPENDS_${PN}-ptest += "make"
+RDEPENDS:${PN}-ptest += "make"
 
 inherit ptest

...

-do_install_append_class-target() {
+do_install:append:class-target() {

We can see on the Yocto changelog that this syntax (: and _) changed on Honister 3.4: Migration notes for 3.4 (honister) — The Yocto Project ® 4.1.999 documentation

You should use _, Yocto will not understand : (that’s why you had your parser error). Therefore, could you please change these lines on zlib_1.2.12.bb and check if this works?

Please note that there are more differences between 1.2.12 and 1.2.11 bb files, so you can run into more errors. I will paste here the entire diff file so maybe this can help you with your issue:

diff --git a/1.2.11.bb b/1.2.11.bb
index ed79e60..e921703 100644
--- a/1.2.11.bb
+++ b/1.2.11.bb
@@ -6,55 +6,42 @@ SECTION = "libs"
 LICENSE = "Zlib"
 LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef63bc555f7aa6c0"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
-           file://remove.ldconfig.call.patch \
-           file://Makefile-runtests.patch \
+SRC_URI = "https://zlib.net/${BP}.tar.xz \
+           file://cc.patch \
            file://ldflags-tests.patch \
+           file://0001-configure-Pass-LDFLAGS-to-link-tests.patch \
            file://run-ptest \
+           file://0001-Correct-incorrect-inputs-provided-to-the-CRC-functio.patch \
            "
 UPSTREAM_CHECK_URI = "http://zlib.net/"
 
-SRC_URI[md5sum] = "85adef240c5f370b308da8c938951a68"
-SRC_URI[sha256sum] = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066"
+SRC_URI[sha256sum] = "7db46b8d7726232a621befaab4a1c870f00a90805511c0e0090441dac57def18"
 
 CFLAGS += "-D_REENTRANT"
 
-RDEPENDS_${PN}-ptest += "make"
+RDEPENDS:${PN}-ptest += "make"
 
 inherit ptest
 
 do_configure() {
-	uname=GNU ./configure --prefix=${prefix} --shared --libdir=${libdir}
+	LDCONFIG=true ./configure --prefix=${prefix} --shared --libdir=${libdir} --uname=GNU
 }
 
 do_compile() {
 	oe_runmake shared
 }
 
-do_compile_ptest() {
-	oe_runmake test
-}
-
 do_install() {
 	oe_runmake DESTDIR=${D} install
 }
 
 do_install_ptest() {
-	install ${B}/Makefile   ${D}${PTEST_PATH}
-	install ${B}/example    ${D}${PTEST_PATH}
-	install ${B}/minigzip   ${D}${PTEST_PATH}
-	install ${B}/examplesh  ${D}${PTEST_PATH}
-	install ${B}/minigzipsh ${D}${PTEST_PATH}
-
-	# Remove buildhost references...
-	sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
-		-e 's|${DEBUG_PREFIX_MAP}||g' \
-	 ${D}${PTEST_PATH}/Makefile
+	install ${B}/examplesh ${D}${PTEST_PATH}
 }
 
 # 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() {
+do_install:append:class-target() {
 	if [ ${base_libdir} != ${libdir} ]
 	then
 		mkdir -p ${D}/${base_libdir}
@@ -65,4 +52,3 @@ do_install_append_class-target() {
 }
 
 BBCLASSEXTEND = "native nativesdk"

Best Regards,
Hiago.

1 Like