1 |
commit: 0a91cef90a3879f5fe3763a01c0f37c336bd1a6c |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 28 07:27:31 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 28 07:28:03 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a91cef9 |
7 |
|
8 |
sys-libs/zlib: fix CC detection in configure |
9 |
|
10 |
Notably fixes multilib (although it actually silently skipped |
11 |
for me) in at least one way. |
12 |
|
13 |
Closes: https://bugs.gentoo.org/836308 |
14 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
15 |
|
16 |
.../zlib-1.2.12-fix-CC-logic-in-configure.patch | 27 ++++++++++++++++++++++ |
17 |
sys-libs/zlib/zlib-1.2.12.ebuild | 4 ++++ |
18 |
2 files changed, 31 insertions(+) |
19 |
|
20 |
diff --git a/sys-libs/zlib/files/zlib-1.2.12-fix-CC-logic-in-configure.patch b/sys-libs/zlib/files/zlib-1.2.12-fix-CC-logic-in-configure.patch |
21 |
new file mode 100644 |
22 |
index 000000000000..da9455519b6f |
23 |
--- /dev/null |
24 |
+++ b/sys-libs/zlib/files/zlib-1.2.12-fix-CC-logic-in-configure.patch |
25 |
@@ -0,0 +1,27 @@ |
26 |
+From 95b9053f10710f9f881f4daec2f2e78da87560cf Mon Sep 17 00:00:00 2001 |
27 |
+From: Sam James <sam@g.o> |
28 |
+Date: Mon, 28 Mar 2022 08:21:18 +0100 |
29 |
+Subject: [PATCH] Fix CC logic in configure |
30 |
+ |
31 |
+In https://github.com/madler/zlib/commit/e9a52aa129efe3834383e415580716a7c4027f8d, |
32 |
+the logic was changed to try check harder for GCC, but it dropped |
33 |
+the default setting of cc=${CC}. |
34 |
+ |
35 |
+This led to e.g. misdetection of inability to build shared libs |
36 |
+for say, multilib cases (w/ CC being one thing (e.g. x86_64-unknown-linux-gnu-gcc -m32 |
37 |
+and then 'cc' used for shared libs being w/o -m32). |
38 |
+ |
39 |
+Signed-off-by: Sam James <sam@g.o> |
40 |
+--- a/configure |
41 |
++++ b/configure |
42 |
+@@ -180,7 +180,10 @@ if test -z "$CC"; then |
43 |
+ else |
44 |
+ cc=${CROSS_PREFIX}cc |
45 |
+ fi |
46 |
++else |
47 |
++ cc=${CC} |
48 |
+ fi |
49 |
++ |
50 |
+ cflags=${CFLAGS-"-O3"} |
51 |
+ # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure |
52 |
+ case "$cc" in |
53 |
|
54 |
diff --git a/sys-libs/zlib/zlib-1.2.12.ebuild b/sys-libs/zlib/zlib-1.2.12.ebuild |
55 |
index d43f2e1853c7..1a031b3c2526 100644 |
56 |
--- a/sys-libs/zlib/zlib-1.2.12.ebuild |
57 |
+++ b/sys-libs/zlib/zlib-1.2.12.ebuild |
58 |
@@ -36,6 +36,9 @@ PATCHES=( |
59 |
|
60 |
# bug #831628 |
61 |
"${FILESDIR}"/${PN}-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch |
62 |
+ |
63 |
+ # Fix broken CC logic |
64 |
+ "${FILESDIR}"/${PN}-1.2.12-fix-CC-logic-in-configure.patch |
65 |
) |
66 |
|
67 |
src_prepare() { |
68 |
@@ -85,6 +88,7 @@ multilib_src_configure() { |
69 |
*) |
70 |
# bug #347167 |
71 |
local uname=$("${BROOT}"/usr/share/gnuconfig/config.sub "${CHOST}" | cut -d- -f3) |
72 |
+ |
73 |
local myconf=( |
74 |
--shared |
75 |
--prefix="${EPREFIX}/usr" |