commit:     f9acf146c21b1433f3c9337dd49d05c0060f825e
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 11 05:41:19 2020 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 05:41:19 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9acf146

net-misc/memcached: fix -fno-common

Upstream merged our prior patch for -fno-common/gcc10, but also
introduced a new regression -fno-common in the latest release.

Fixes: https://bugs.gentoo.org/711982
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 .../memcached/files/memcached-1.6.0-gcc10.patch    | 34 ++++++++++++++++++++++
 net-misc/memcached/memcached-1.6.0.ebuild          |  2 +-
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/net-misc/memcached/files/memcached-1.6.0-gcc10.patch 
b/net-misc/memcached/files/memcached-1.6.0-gcc10.patch
new file mode 100644
index 00000000000..d250b31e912
--- /dev/null
+++ b/net-misc/memcached/files/memcached-1.6.0-gcc10.patch
@@ -0,0 +1,34 @@
+Subject: [PATCH] crc32c: fix multiple definitions
+
+gcc-10 will change the default from -fcommon to fno-common:
+https://gcc.gnu.org/PR85678.
+
+The error also happens if CFLAGS=-fno-common passed explicitly.
+
+Reported-By: Toralf Förster <[email protected]>
+Bug: https://bugs.gentoo.org/711982
+Signed-off-by: Robin H. Johnson <[email protected]>
+
+diff -Nuar --exclude '*~' --exclude config.log --exclude autom4te.cache 
memcached-1.6.0.orig/crc32c.c memcached-1.6.0/crc32c.c
+--- memcached-1.6.0.orig/crc32c.c      2019-10-21 01:48:04.000000000 -0700
++++ memcached-1.6.0/crc32c.c   2020-03-10 22:19:07.610247164 -0700
+@@ -390,6 +390,7 @@
+ #endif
+ /* Compute a CRC-32C.  If the crc32 instruction is available, use the hardware
+    version.  Otherwise, use the software version. */
++crc_func crc32c;
+ void crc32c_init(void) {
+     #if defined(__X86_64__)||defined(__x86_64__)||defined(__ia64__)
+     int sse42;
+diff -Nuar --exclude '*~' --exclude config.log --exclude autom4te.cache 
memcached-1.6.0.orig/crc32c.h memcached-1.6.0/crc32c.h
+--- memcached-1.6.0.orig/crc32c.h      2019-10-21 01:48:04.000000000 -0700
++++ memcached-1.6.0/crc32c.h   2020-03-10 22:17:12.086974212 -0700
+@@ -2,7 +2,7 @@
+ #define    CRC32C_H
+ 
+ typedef uint32_t (*crc_func)(uint32_t crc, const void *buf, size_t len);
+-crc_func crc32c;
++extern crc_func crc32c;
+ 
+ void crc32c_init(void);
+ 

diff --git a/net-misc/memcached/memcached-1.6.0.ebuild 
b/net-misc/memcached/memcached-1.6.0.ebuild
index 1cce9361ede..ed887ee56b2 100644
--- a/net-misc/memcached/memcached-1.6.0.ebuild
+++ b/net-misc/memcached/memcached-1.6.0.ebuild
@@ -35,7 +35,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-1.4.0-fix-as-needed-linking.patch"
        "${FILESDIR}/${PN}-1.4.4-as-needed.patch"
        "${FILESDIR}/${PN}-1.4.17-EWOULDBLOCK.patch"
-       #"${FILESDIR}/${PN}-1.5.21-hash-fix-build-failure-against-gcc-10.patch"
+       "${FILESDIR}/${PN}-1.6.0-gcc10.patch"
 )
 
 src_prepare() {

Reply via email to