diff options
Diffstat (limited to 'sys-libs/zlib/files')
9 files changed, 451 insertions, 67 deletions
diff --git a/sys-libs/zlib/files/zlib-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch b/sys-libs/zlib/files/zlib-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch new file mode 100644 index 000000000000..1ab5b2f5dc81 --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch @@ -0,0 +1,88 @@ +From 4232e67ee1440634af8209c7022dfc64cf862819 Mon Sep 17 00:00:00 2001 +From: Adrian Ratiu <adrian.ratiu@collabora.com> +Date: Mon, 17 Jan 2022 10:49:58 +0200 +Subject: [PATCH v3] configure: fix AR/RANLIB/NM detection + +Taken from zlib-devel ML: +https://madler.net/pipermail/zlib-devel_madler.net/2022-January/003322.html + +Bug: https://bugs.gentoo.org/831628 + +Scenarios where ${CROSS_PREFIX}ar & co are set but not desired +are possible, for example in ChromiumOS we use the GNU binutils +tools & GCC to build glibc but LLVM/Clang is used for the rest +of the system. + +This allows $AR/$RANLIB/$NM to override default CROSS_PREFIX +tools so they can be set to llvm-ar/ranlib/nm. + +Suggested-by: Manoj Gupta <manojgupta@chromium.org> +Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> +--- + +Changes in v3: + * Whitespace style fixes + * Fixed top level variable tests (eg -z AR -> -z $AR) + * Review and testing as part of Gentoo PR: + https://github.com/gentoo/gentoo/pull/23888 +Changes in v2: + * Fixed a typo in the "unset NM" case +--- + configure | 38 ++++++++++++++++++++++---------------- + 1 file changed, 22 insertions(+), 16 deletions(-) + +diff --git a/configure b/configure +index e974d1f..045c616 100755 +--- a/configure ++++ b/configure +@@ -46,25 +46,31 @@ VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib. + VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h` + + # establish commands for library building +-if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then +- AR=${AR-"${CROSS_PREFIX}ar"} +- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log +-else +- AR=${AR-"ar"} +- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log ++if [ -z "$AR" ]; then ++ if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then ++ AR=${AR-"${CROSS_PREFIX}ar"} ++ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log ++ else ++ AR="ar" ++ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log ++ fi + fi + ARFLAGS=${ARFLAGS-"rc"} +-if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then +- RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"} +- test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log +-else +- RANLIB=${RANLIB-"ranlib"} ++if [ -z "$RANLIB" ]; then ++ if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then ++ RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"} ++ test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log ++ else ++ RANLIB="ranlib" ++ fi + fi +-if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then +- NM=${NM-"${CROSS_PREFIX}nm"} +- test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log +-else +- NM=${NM-"nm"} ++if [ -z "$NM" ]; then ++ if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then ++ NM=${NM-"${CROSS_PREFIX}nm"} ++ test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log ++ else ++ NM="nm" ++ fi + fi + + # set defaults before processing command line options +-- +2.35.0 + diff --git a/sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch b/sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch deleted file mode 100644 index 18764849b945..000000000000 --- a/sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch +++ /dev/null @@ -1,67 +0,0 @@ -From f9694097dd69354b03cb8af959094c7f260db0a1 Mon Sep 17 00:00:00 2001 -From: Mark Adler <madler@alumni.caltech.edu> -Date: Mon, 16 Jan 2017 09:49:35 -0800 -Subject: [PATCH] Permit a deflateParams() parameter change as soon as - possible. - -This commit allows a parameter change even if the input data has -not all been compressed and copied to the application output -buffer, so long as all of the input data has been compressed to -the internal pending output buffer. This also allows an immediate -deflateParams change so long as there have been no deflate calls -since initialization or reset. ---- - deflate.c | 6 +++--- - zlib.h | 11 ++++++----- - 2 files changed, 9 insertions(+), 8 deletions(-) - -diff --git a/deflate.c b/deflate.c -index b63311a5..20bda4f6 100644 ---- a/deflate.c -+++ b/deflate.c -@@ -494,7 +494,7 @@ int ZEXPORT deflateResetKeep (strm) - s->wrap == 2 ? crc32(0L, Z_NULL, 0) : - #endif - adler32(0L, Z_NULL, 0); -- s->last_flush = Z_NO_FLUSH; -+ s->last_flush = -2; - - _tr_init(s); - -@@ -587,12 +587,12 @@ int ZEXPORT deflateParams(strm, level, strategy) - func = configuration_table[s->level].func; - - if ((strategy != s->strategy || func != configuration_table[level].func) && -- s->high_water) { -+ s->last_flush != -2) { - /* Flush the last buffer: */ - int err = deflate(strm, Z_BLOCK); - if (err == Z_STREAM_ERROR) - return err; -- if (strm->avail_out == 0) -+ if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead) - return Z_BUF_ERROR; - } - if (s->level != level) { -diff --git a/zlib.h b/zlib.h -index 5daf4f28..577d81e3 100644 ---- a/zlib.h -+++ b/zlib.h -@@ -712,11 +712,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different strategy. - If the compression approach (which is a function of the level) or the -- strategy is changed, and if any input has been consumed in a previous -- deflate() call, then the input available so far is compressed with the old -- level and strategy using deflate(strm, Z_BLOCK). There are three approaches -- for the compression levels 0, 1..3, and 4..9 respectively. The new level -- and strategy will take effect at the next call of deflate(). -+ strategy is changed, and if there have been any deflate() calls since the -+ state was initialized or reset, then the input available so far is -+ compressed with the old level and strategy using deflate(strm, Z_BLOCK). -+ There are three approaches for the compression levels 0, 1..3, and 4..9 -+ respectively. The new level and strategy will take effect at the next call -+ of deflate(). - - If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does - not have enough output space to complete, then the parameter change will not diff --git a/sys-libs/zlib/files/zlib-1.2.13-CVE-2023-45853.patch b/sys-libs/zlib/files/zlib-1.2.13-CVE-2023-45853.patch new file mode 100644 index 000000000000..ecb5acecbb33 --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.2.13-CVE-2023-45853.patch @@ -0,0 +1,40 @@ +https://bugs.gentoo.org/916484 +https://github.com/madler/zlib/pull/843 +https://github.com/madler/zlib/commit/73331a6a0481067628f065ffe87bb1d8f787d10c + +From 73331a6a0481067628f065ffe87bb1d8f787d10c Mon Sep 17 00:00:00 2001 +From: Hans Wennborg <hans@chromium.org> +Date: Fri, 18 Aug 2023 11:05:33 +0200 +Subject: [PATCH] Reject overflows of zip header fields in minizip. + +This checks the lengths of the file name, extra field, and comment +that would be put in the zip headers, and rejects them if they are +too long. They are each limited to 65535 bytes in length by the zip +format. This also avoids possible buffer overflows if the provided +fields are too long. +--- + contrib/minizip/zip.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c +index 3d3d4cadd..0446109b2 100644 +--- a/contrib/minizip/zip.c ++++ b/contrib/minizip/zip.c +@@ -1043,6 +1043,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c + return ZIP_PARAMERROR; + #endif + ++ // The filename and comment length must fit in 16 bits. ++ if ((filename!=NULL) && (strlen(filename)>0xffff)) ++ return ZIP_PARAMERROR; ++ if ((comment!=NULL) && (strlen(comment)>0xffff)) ++ return ZIP_PARAMERROR; ++ // The extra field length must fit in 16 bits. If the member also requires ++ // a Zip64 extra block, that will also need to fit within that 16-bit ++ // length, but that will be checked for later. ++ if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff)) ++ return ZIP_PARAMERROR; ++ + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 1) diff --git a/sys-libs/zlib/files/zlib-1.2.13-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch b/sys-libs/zlib/files/zlib-1.2.13-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch new file mode 100644 index 000000000000..b5a1b4de2c47 --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.2.13-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch @@ -0,0 +1,59 @@ +https://bugs.gentoo.org/879883 +https://github.com/madler/zlib/issues/751 + +From 2ad2713e6cb9166dcede9a020f6913b8189ff0c6 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Wed, 23 Nov 2022 04:17:16 +0000 +Subject: [PATCH] Revert "Turn off RWX segment warnings on sparc systems." + +This breaks building on sparc with older binutils. + +This reverts commit 29fd715fd0bdaffee21e2d2d37be8c5a6ac67ee4. +--- a/Makefile.in ++++ b/Makefile.in +@@ -22,7 +22,7 @@ CFLAGS=-O + + SFLAGS=-O + LDFLAGS= +-TEST_LDFLAGS=$(LDFLAGS) -L. libz.a ++TEST_LDFLAGS=-L. libz.a + LDSHARED=$(CC) + CPP=$(CC) -E + +@@ -288,10 +288,10 @@ minigzip$(EXE): minigzip.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) + + examplesh$(EXE): example.o $(SHAREDLIBV) +- $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV) ++ $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV) + + minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) +- $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV) ++ $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV) + + example64$(EXE): example64.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) +--- a/configure ++++ b/configure +@@ -33,10 +33,7 @@ fi + # set command prefix for cross-compilation + if [ -n "${CHOST}" ]; then + uname=${CHOST} +- mname=${CHOST} + CROSS_PREFIX="${CHOST}-" +-else +- mname=`(uname -a || echo unknown) 2>/dev/null` + fi + + # destination name for static library +@@ -223,10 +220,6 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then + fi + case "$uname" in + Linux* | linux* | *-linux* | GNU | GNU/* | solaris*) +- case "$mname" in +- *sparc*) +- LDFLAGS="${LDFLAGS} -Wl,--no-warn-rwx-segments" ;; +- esac + LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;; + *BSD | *bsd* | DragonFly) + LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} diff --git a/sys-libs/zlib/files/zlib-1.2.13-use-LDFLAGS-in-configure.patch b/sys-libs/zlib/files/zlib-1.2.13-use-LDFLAGS-in-configure.patch new file mode 100644 index 000000000000..9f2b240334e8 --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.2.13-use-LDFLAGS-in-configure.patch @@ -0,0 +1,72 @@ +https://github.com/madler/zlib/pull/599 + +Rebased version of: + +From 37c9730ba474d274f4cc6a974943eef95087b9f6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 8 Mar 2022 22:38:47 -0800 +Subject: [PATCH] configure: Pass LDFLAGS to link tests + +LDFLAGS can contain critical flags without which linking wont succeed +therefore ensure that all configure tests involving link time checks are +using LDFLAGS on compiler commandline along with CFLAGS to ensure the +tests perform correctly. Without this some tests may fail resulting in +wrong confgure result, ending in miscompiling the package + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- a/configure ++++ b/configure +@@ -436,7 +436,7 @@ if test $shared -eq 1; then + echo Checking for shared library support... | tee -a configure.log + # we must test in two steps (cc then ld), required at least on SunOS 4.x + if try $CC -w -c $SFLAGS $test.c && +- try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then ++ try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test.o; then + echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log + elif test -z "$old_cc" -a -z "$old_cflags"; then + echo No shared library support. | tee -a configure.log +@@ -498,7 +498,7 @@ int main(void) { + } + EOF + fi +- if try $CC $CFLAGS -o $test $test.c; then ++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + sizet=`./$test` + echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log + CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}" +@@ -532,7 +532,7 @@ int main(void) { + return 0; + } + EOF +- if try $CC $CFLAGS -o $test $test.c; then ++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + echo "Checking for fseeko... Yes." | tee -a configure.log + else + CFLAGS="${CFLAGS} -DNO_FSEEKO" +@@ -549,7 +549,7 @@ cat > $test.c <<EOF + #include <errno.h> + int main() { return strlen(strerror(errno)); } + EOF +-if try $CC $CFLAGS -o $test $test.c; then ++if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + echo "Checking for strerror... Yes." | tee -a configure.log + else + CFLAGS="${CFLAGS} -DNO_STRERROR" +@@ -656,7 +656,7 @@ int main() + return (mytest("Hello%d\n", 1)); + } + EOF +- if try $CC $CFLAGS -o $test $test.c; then ++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log + + echo >> configure.log +@@ -746,7 +746,7 @@ int main() + } + EOF + +- if try $CC $CFLAGS -o $test $test.c; then ++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log + + echo >> configure.log diff --git a/sys-libs/zlib/files/zlib-1.3.1-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch b/sys-libs/zlib/files/zlib-1.3.1-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch new file mode 100644 index 000000000000..5bfb8006c4bb --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.3.1-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch @@ -0,0 +1,17 @@ +https://bugs.gentoo.org/879883 +https://github.com/madler/zlib/issues/751 + +This breaks building on sparc with older binutils. +--- a/configure ++++ b/configure +@@ -234,10 +234,6 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then + fi + case "$uname" in + Linux* | linux* | *-linux* | GNU | GNU/* | solaris*) +- case "$mname" in +- *sparc*) +- LDFLAGS="${LDFLAGS} -Wl,--no-warn-rwx-segments" ;; +- esac + LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;; + *BSD | *bsd* | DragonFly) + LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} diff --git a/sys-libs/zlib/files/zlib-1.3.1-configure-fix-AR-RANLIB-NM-detection.patch b/sys-libs/zlib/files/zlib-1.3.1-configure-fix-AR-RANLIB-NM-detection.patch new file mode 100644 index 000000000000..e1e5cf4b9196 --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.3.1-configure-fix-AR-RANLIB-NM-detection.patch @@ -0,0 +1,79 @@ +From 7d7c0b3ede7d5c30e3cdc7c6fbb33c9d4499516a Mon Sep 17 00:00:00 2001 +From: Adrian Ratiu <adrian.ratiu@collabora.com> +Date: Mon, 17 Jan 2022 10:49:58 +0200 +Subject: [PATCH] configure: fix AR/RANLIB/NM detection + +Taken from zlib-devel ML: +https://madler.net/pipermail/zlib-devel_madler.net/2022-January/003322.html + +Bug: https://bugs.gentoo.org/831628 + +Scenarios where ${CROSS_PREFIX}ar & co are set but not desired +are possible, for example in ChromiumOS we use the GNU binutils +tools & GCC to build glibc but LLVM/Clang is used for the rest +of the system. + +This allows $AR/$RANLIB/$NM to override default CROSS_PREFIX +tools so they can be set to llvm-ar/ranlib/nm. + +Suggested-by: Manoj Gupta <manojgupta@chromium.org> +Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> +--- + configure | 38 ++++++++++++++++++++++---------------- + 1 file changed, 22 insertions(+), 16 deletions(-) + +diff --git a/configure b/configure +index c55098a..2535e04 100755 +--- a/configure ++++ b/configure +@@ -48,25 +48,31 @@ VER3=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\(\\.[0-9]\{1,\}\)\{1,2\}\).*/\1/p'` + VER1=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\)\\..*/\1/p'` + + # establish commands for library building +-if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then +- AR=${AR-"${CROSS_PREFIX}ar"} +- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log +-else +- AR=${AR-"ar"} +- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log ++if [ -z "$AR" ]; then ++ if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then ++ AR=${AR-"${CROSS_PREFIX}ar"} ++ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log ++ else ++ AR="ar" ++ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log ++ fi + fi + ARFLAGS=${ARFLAGS-"rc"} +-if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then +- RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"} +- test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log +-else +- RANLIB=${RANLIB-"ranlib"} ++if [ -z "$RANLIB" ]; then ++ if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then ++ RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"} ++ test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log ++ else ++ RANLIB="ranlib" ++ fi + fi +-if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then +- NM=${NM-"${CROSS_PREFIX}nm"} +- test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log +-else +- NM=${NM-"nm"} ++if [ -z "$NM" ]; then ++ if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then ++ NM=${NM-"${CROSS_PREFIX}nm"} ++ test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log ++ else ++ NM="nm" ++ fi + fi + + # set defaults before processing command line options +-- +2.43.0 + diff --git a/sys-libs/zlib/files/zlib-1.3.1-configure-fix-AR-libtool-on-darwin.patch b/sys-libs/zlib/files/zlib-1.3.1-configure-fix-AR-libtool-on-darwin.patch new file mode 100644 index 000000000000..4506e753ca2e --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.3.1-configure-fix-AR-libtool-on-darwin.patch @@ -0,0 +1,22 @@ +diff --color -ur zlib-1.3.1/configure zlib-1.3.1.new/configure +--- zlib-1.3.1/configure 2024-01-21 02:29:31.000000000 +0000 ++++ zlib-1.3.1.new/configure 2024-02-17 19:37:10.614600000 +0000 +@@ -265,14 +265,16 @@ + SHAREDLIBV=libz.$VER$shared_ext + SHAREDLIBM=libz.$VER1$shared_ext + LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} ++ if test -z ${AR}; then + if "${CROSS_PREFIX}libtool" -V 2>&1 | grep Apple > /dev/null; then + AR="${CROSS_PREFIX}libtool" + elif libtool -V 2>&1 | grep Apple > /dev/null; then + AR="libtool" + else + AR="/usr/bin/libtool" + fi +- ARFLAGS="-o" ;; ++ ARFLAGS="-o" ++ fi ;; + *) + LDSHARED=${LDSHARED-"$cc -shared"} ;; + esac + diff --git a/sys-libs/zlib/files/zlib-1.3.1-use-LDFLAGS-in-configure.patch b/sys-libs/zlib/files/zlib-1.3.1-use-LDFLAGS-in-configure.patch new file mode 100644 index 000000000000..2b1d70f7b6f6 --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.3.1-use-LDFLAGS-in-configure.patch @@ -0,0 +1,74 @@ +https://github.com/madler/zlib/pull/599 + +Rebased version of: + +From 37c9730ba474d274f4cc6a974943eef95087b9f6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 8 Mar 2022 22:38:47 -0800 +Subject: [PATCH] configure: Pass LDFLAGS to link tests + +LDFLAGS can contain critical flags without which linking wont succeed +therefore ensure that all configure tests involving link time checks are +using LDFLAGS on compiler commandline along with CFLAGS to ensure the +tests perform correctly. Without this some tests may fail resulting in +wrong confgure result, ending in miscompiling the package + +Signed-off-by: Khem Raj <raj.khem@gmail.com>k +--- a/configure ++++ b/configure +@@ -448,8 +448,8 @@ EOF + if test $shared -eq 1; then + echo Checking for shared library support... | tee -a configure.log + # we must test in two steps (cc then ld), required at least on SunOS 4.x +- if try $CC -c $SFLAGS $test.c && +- try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then ++ if try $CC -c $SFLAGS $LDFLAGS $test.c && ++ try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test.o; then + echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log + elif test -z "$old_cc" -a -z "$old_cflags"; then + echo No shared library support. | tee -a configure.log +@@ -511,7 +511,7 @@ int main(void) { + } + EOF + fi +- if try $CC $CFLAGS -o $test $test.c; then ++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + sizet=`./$test` + echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log + CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}" +@@ -545,7 +545,7 @@ int main(void) { + return 0; + } + EOF +- if try $CC $CFLAGS -o $test $test.c; then ++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + echo "Checking for fseeko... Yes." | tee -a configure.log + else + CFLAGS="${CFLAGS} -DNO_FSEEKO" +@@ -562,7 +562,7 @@ cat > $test.c <<EOF + #include <errno.h> + int main() { return strlen(strerror(errno)); } + EOF +-if try $CC $CFLAGS -o $test $test.c; then ++if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + echo "Checking for strerror... Yes." | tee -a configure.log + else + CFLAGS="${CFLAGS} -DNO_STRERROR" +@@ -669,7 +669,7 @@ int main() + return (mytest("Hello%d\n", 1)); + } + EOF +- if try $CC $CFLAGS -o $test $test.c; then ++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log + + echo >> configure.log +@@ -759,7 +759,7 @@ int main() + } + EOF + +- if try $CC $CFLAGS -o $test $test.c; then ++ if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then + echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log + + echo >> configure.log |