net-misc/memcached: fix -fno-common
authorRobin H. Johnson <robbat2@gentoo.org>
Wed, 11 Mar 2020 05:41:19 +0000 (22:41 -0700)
committerRobin H. Johnson <robbat2@gentoo.org>
Wed, 11 Mar 2020 05:41:19 +0000 (22:41 -0700)
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@gentoo.org>
net-misc/memcached/files/memcached-1.6.0-gcc10.patch [new file with mode: 0644]
net-misc/memcached/memcached-1.6.0.ebuild

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 (file)
index 0000000..d250b31
--- /dev/null
@@ -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 <toralf@gentoo.org>
+Bug: https://bugs.gentoo.org/711982
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+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);
index 1cce9361ede52d38d6820d1daa60d86486cafdb1..ed887ee56b225e38f91680a00ebd6ba32f25d889 100644 (file)
@@ -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() {