summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/zlib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/zlib')
-rw-r--r--meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch78
-rw-r--r--meta/recipes-core/zlib/zlib/ldflags-tests.patch45
-rw-r--r--meta/recipes-core/zlib/zlib_1.2.11.bb52
-rw-r--r--meta/recipes-core/zlib/zlib_1.3.1.bb50
4 files changed, 128 insertions, 97 deletions
diff --git a/meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch b/meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch
new file mode 100644
index 0000000000..07b2cd3879
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch
@@ -0,0 +1,78 @@
1Upstream-Status: Submitted [https://github.com/madler/zlib/pull/599]
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From ea77f1f003a4d18b23cca703f3c824942863a1b4 Mon Sep 17 00:00:00 2001
5From: Khem Raj <raj.khem@gmail.com>
6Date: Tue, 8 Mar 2022 22:38:47 -0800
7Subject: [PATCH] configure: Pass LDFLAGS to link tests
8
9LDFLAGS can contain critical flags without which linking wont succeed
10therefore ensure that all configure tests involving link time checks are
11using LDFLAGS on compiler commandline along with CFLAGS to ensure the
12tests perform correctly. Without this some tests may fail resulting in
13wrong confgure result, ending in miscompiling the package
14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16
17---
18 configure | 12 ++++++------
19 1 file changed, 6 insertions(+), 6 deletions(-)
20
21diff --git a/configure b/configure
22index c55098a..a7c6d72 100755
23--- a/configure
24+++ b/configure
25@@ -443,7 +443,7 @@ if test $shared -eq 1; then
26 echo Checking for shared library support... | tee -a configure.log
27 # we must test in two steps (cc then ld), required at least on SunOS 4.x
28 if try $CC -c $SFLAGS $test.c &&
29- try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
30+ try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test.o; then
31 echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
32 elif test -z "$old_cc" -a -z "$old_cflags"; then
33 echo No shared library support. | tee -a configure.log
34@@ -505,7 +505,7 @@ int main(void) {
35 }
36 EOF
37 fi
38- if try $CC $CFLAGS -o $test $test.c; then
39+ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
40 sizet=`./$test`
41 echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
42 CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
43@@ -539,7 +539,7 @@ int main(void) {
44 return 0;
45 }
46 EOF
47- if try $CC $CFLAGS -o $test $test.c; then
48+ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
49 echo "Checking for fseeko... Yes." | tee -a configure.log
50 else
51 CFLAGS="${CFLAGS} -DNO_FSEEKO"
52@@ -556,7 +556,7 @@ cat > $test.c <<EOF
53 #include <errno.h>
54 int main() { return strlen(strerror(errno)); }
55 EOF
56-if try $CC $CFLAGS -o $test $test.c; then
57+if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
58 echo "Checking for strerror... Yes." | tee -a configure.log
59 else
60 CFLAGS="${CFLAGS} -DNO_STRERROR"
61@@ -663,7 +663,7 @@ int main()
62 return (mytest("Hello%d\n", 1));
63 }
64 EOF
65- if try $CC $CFLAGS -o $test $test.c; then
66+ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
67 echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
68
69 echo >> configure.log
70@@ -753,7 +753,7 @@ int main()
71 }
72 EOF
73
74- if try $CC $CFLAGS -o $test $test.c; then
75+ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
76 echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
77
78 echo >> configure.log
diff --git a/meta/recipes-core/zlib/zlib/ldflags-tests.patch b/meta/recipes-core/zlib/zlib/ldflags-tests.patch
deleted file mode 100644
index 286390665f..0000000000
--- a/meta/recipes-core/zlib/zlib/ldflags-tests.patch
+++ /dev/null
@@ -1,45 +0,0 @@
1Obey LDFLAGS for tests
2
3Upstream-Status: Submitted [https://github.com/madler/zlib/pull/409]
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6--- zlib-1.2.8.orig/Makefile.in
7+++ zlib-1.2.8/Makefile.in
8@@ -26,7 +26,7 @@ CFLAGS=-O
9
10 SFLAGS=-O
11 LDFLAGS=
12-TEST_LDFLAGS=-L. libz.a
13+TEST_LDFLAGS=-L. $(LDFLAGS)
14 LDSHARED=$(CC)
15 CPP=$(CC) -E
16
17@@ -176,22 +176,22 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz.
18 -@rmdir objs
19
20 example$(EXE): example.o $(STATICLIB)
21- $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
22+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(STATICLIB)
23
24 minigzip$(EXE): minigzip.o $(STATICLIB)
25- $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
26+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(STATICLIB)
27
28 examplesh$(EXE): example.o $(SHAREDLIBV)
29- $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
30+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(SHAREDLIBV)
31
32 minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
33- $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
34+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(SHAREDLIBV)
35
36 example64$(EXE): example64.o $(STATICLIB)
37- $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
38+ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) $(STATICLIB)
39
40 minigzip64$(EXE): minigzip64.o $(STATICLIB)
41- $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
42+ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) $(STATICLIB)
43
44 install-libs: $(LIBS)
45 -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
diff --git a/meta/recipes-core/zlib/zlib_1.2.11.bb b/meta/recipes-core/zlib/zlib_1.2.11.bb
deleted file mode 100644
index ef9431ae47..0000000000
--- a/meta/recipes-core/zlib/zlib_1.2.11.bb
+++ /dev/null
@@ -1,52 +0,0 @@
1SUMMARY = "Zlib Compression Library"
2DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \
3library which is used by many different programs."
4HOMEPAGE = "http://zlib.net/"
5SECTION = "libs"
6LICENSE = "Zlib"
7LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef63bc555f7aa6c0"
8
9SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
10 file://ldflags-tests.patch \
11 file://run-ptest \
12 "
13UPSTREAM_CHECK_URI = "http://zlib.net/"
14
15SRC_URI[md5sum] = "85adef240c5f370b308da8c938951a68"
16SRC_URI[sha256sum] = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066"
17
18CFLAGS += "-D_REENTRANT"
19
20RDEPENDS_${PN}-ptest += "make"
21
22inherit ptest
23
24do_configure() {
25 LDCONFIG=true ./configure --prefix=${prefix} --shared --libdir=${libdir} --uname=GNU
26}
27
28do_compile() {
29 oe_runmake shared
30}
31
32do_install() {
33 oe_runmake DESTDIR=${D} install
34}
35
36do_install_ptest() {
37 install ${B}/examplesh ${D}${PTEST_PATH}
38}
39
40# Move zlib shared libraries for target builds to $base_libdir so the library
41# can be used in early boot before $prefix is mounted.
42do_install_append_class-target() {
43 if [ ${base_libdir} != ${libdir} ]
44 then
45 mkdir -p ${D}/${base_libdir}
46 mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
47 libname=`readlink ${D}/${libdir}/libz.so`
48 ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname ${D}${libdir}/libz.so
49 fi
50}
51
52BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/zlib/zlib_1.3.1.bb b/meta/recipes-core/zlib/zlib_1.3.1.bb
new file mode 100644
index 0000000000..e6a81ef789
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib_1.3.1.bb
@@ -0,0 +1,50 @@
1SUMMARY = "Zlib Compression Library"
2DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \
3library which is used by many different programs."
4HOMEPAGE = "http://zlib.net/"
5SECTION = "libs"
6LICENSE = "Zlib"
7LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef63bc555f7aa6c0"
8
9# The source tarball needs to be .gz as only the .gz ends up in fossils/
10SRC_URI = "https://zlib.net/${BP}.tar.gz \
11 file://0001-configure-Pass-LDFLAGS-to-link-tests.patch \
12 file://run-ptest \
13 "
14UPSTREAM_CHECK_URI = "http://zlib.net/"
15
16SRC_URI[sha256sum] = "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23"
17
18# When a new release is made the previous release is moved to fossils/, so add this
19# to PREMIRRORS so it is also searched automatically.
20PREMIRRORS:append = " https://zlib.net/ https://zlib.net/fossils/"
21
22CFLAGS += "-D_REENTRANT"
23
24RDEPENDS:${PN}-ptest += "make"
25
26inherit ptest
27
28B = "${WORKDIR}/build"
29
30do_configure() {
31 LDCONFIG=true ${S}/configure --prefix=${prefix} --shared --libdir=${libdir} --uname=GNU
32}
33do_configure[cleandirs] += "${B}"
34
35do_compile() {
36 oe_runmake shared
37}
38
39do_install() {
40 oe_runmake DESTDIR=${D} install
41}
42
43do_install_ptest() {
44 install ${B}/examplesh ${D}${PTEST_PATH}
45}
46
47BBCLASSEXTEND = "native nativesdk"
48
49CVE_STATUS[CVE-2023-45853] = "not-applicable-config: we don't build minizip"
50CVE_STATUS[CVE-2023-6992] = "cpe-incorrect: this CVE is for cloudflare zlib"