From 4e76ca623c10b7ae2aaaecf96afbc3411a3234ac Mon Sep 17 00:00:00 2001 From: Lukas Javorsky Date: Wed, 22 Jun 2022 17:36:03 +0000 Subject: [PATCH] [4/6] Fix configure file Source: https://github.com/madler/zlib/pull/607 --- zlib-1.2.12-fix-configure.patch | 46 +++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 zlib-1.2.12-fix-configure.patch diff --git a/zlib-1.2.12-fix-configure.patch b/zlib-1.2.12-fix-configure.patch new file mode 100644 index 0000000..d1b72cf --- /dev/null +++ b/zlib-1.2.12-fix-configure.patch @@ -0,0 +1,46 @@ +From a6cd9e1230acdb535bd57bbc350020da3d24eaf3 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Mon, 28 Mar 2022 08:40:45 +0100 +Subject: [PATCH] Fix CC logic in configure + +In https://github.com/madler/zlib/commit/e9a52aa129efe3834383e415580716a7c4027f8d, +the logic was changed to try check harder for GCC, but it dropped +the default setting of cc=${CC}. It was throwing away any pre-set CC value as +a result. + +The rest of the script then cascades down a bad path because it's convinced +it's not GCC or a GCC-like compiler. + +This led to e.g. misdetection of inability to build shared libs +for say, multilib cases (w/ CC being one thing from the environment being used +for one test (e.g. x86_64-unknown-linux-gnu-gcc -m32 and then 'cc' used for +shared libs (but missing "-m32"!)). Obviously just one example of how +the old logic could break. + +This restores the old default of 'CC' if nothing overrides it later +in configure. + +Bug: https://bugs.gentoo.org/836308 +Signed-off-by: Sam James +--- + configure | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/configure b/configure +index a21be36..cdf0e5b 100755 +--- a/configure ++++ b/configure +@@ -185,7 +185,10 @@ if test -z "$CC"; then + else + cc=${CROSS_PREFIX}cc + fi ++else ++ cc=${CC} + fi ++ + cflags=${CFLAGS-"-O3"} + # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure + case "$cc" in +-- +2.34.3 +