]> git.pld-linux.org Git - packages/zlib.git/blob - cc.patch
fix cc misdetection
[packages/zlib.git] / cc.patch
1 From 80d086357a55b94a13e43756cf3e131f25eef0e4 Mon Sep 17 00:00:00 2001
2 From: Sam James <sam@gentoo.org>
3 Date: Mon, 28 Mar 2022 08:40:45 +0100
4 Subject: [PATCH] Fix CC logic in configure
5
6 In https://github.com/madler/zlib/commit/e9a52aa129efe3834383e415580716a7c4027f8d,
7 the logic was changed to try check harder for GCC, but it dropped
8 the default setting of cc=${CC}. It was throwing away any pre-set CC value as
9 a result.
10
11 The rest of the script then cascades down a bad path because it's convinced
12 it's not GCC or a GCC-like compiler.
13
14 This led to e.g. misdetection of inability to build shared libs
15 for say, multilib cases (w/ CC being one thing from the environment being used
16 for one test (e.g. x86_64-unknown-linux-gnu-gcc -m32 and then 'cc' used for
17 shared libs (but missing "-m32"!)). Obviously just one example of how
18 the old logic could break.
19
20 This restores the old default of 'CC' if nothing overrides it later
21 in configure.
22
23 Bug: https://bugs.gentoo.org/836308
24 Signed-off-by: Sam James <sam@gentoo.org>
25 ---
26  configure | 3 +++
27  1 file changed, 3 insertions(+)
28
29 diff --git a/configure b/configure
30 index 52ff4a04e..3fa3e8618 100755
31 --- a/configure
32 +++ b/configure
33 @@ -174,7 +174,10 @@ if test -z "$CC"; then
34    else
35      cc=${CROSS_PREFIX}cc
36    fi
37 +else
38 +  cc=${CC}
39  fi
40 +
41  cflags=${CFLAGS-"-O3"}
42  # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
43  case "$cc" in
This page took 0.105889 seconds and 3 git commands to generate.