summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Thode <prometheanfire@gentoo.org>2020-01-24 15:11:05 -0600
committerMatthew Thode <prometheanfire@gentoo.org>2020-01-24 15:17:51 -0600
commit4ddb2458cf63fa9191d815cfae1fe697e24d4c08 (patch)
tree7618ab5d3be5d0b9fb819ab5ce5f30ac757ace9f
parentnet-misc/rclone-1.50.0 version bump (diff)
downloadgentoo-4ddb2458cf63fa9191d815cfae1fe697e24d4c08.tar.gz
gentoo-4ddb2458cf63fa9191d815cfae1fe697e24d4c08.tar.bz2
gentoo-4ddb2458cf63fa9191d815cfae1fe697e24d4c08.zip
net-misc/memcached: fix building with gcc 10
Closes: https://bugs.gentoo.org/706196 Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
-rw-r--r--net-misc/memcached/files/memcached-1.5.21-hash-fix-build-failure-against-gcc-10.patch56
-rw-r--r--net-misc/memcached/memcached-1.5.21-r1.ebuild (renamed from net-misc/memcached/memcached-1.5.21.ebuild)1
2 files changed, 57 insertions, 0 deletions
diff --git a/net-misc/memcached/files/memcached-1.5.21-hash-fix-build-failure-against-gcc-10.patch b/net-misc/memcached/files/memcached-1.5.21-hash-fix-build-failure-against-gcc-10.patch
new file mode 100644
index 00000000000..527d4607316
--- /dev/null
+++ b/net-misc/memcached/files/memcached-1.5.21-hash-fix-build-failure-against-gcc-10.patch
@@ -0,0 +1,56 @@
+From 63b8e76067523a02a3e0215db1aef0b34edcf708 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Thu, 23 Jan 2020 22:16:36 +0000
+Subject: [PATCH] hash: fix build failure against gcc-10
+
+On gcc-10 (and gcc-9 -fno-common) build fails as:
+
+```
+gcc -g -O2 -pthread -pthread -Wall -Werror -pedantic -Wmissing-prototypes \
+ -Wmissing-declarations -Wredundant-decls -o memcached ... -levent
+ld: memcached-hash.o:memcached/hash.h:5:
+ multiple definition of `hash'; memcached-memcached.o:memcached/hash.h:5: first defined here
+```
+
+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: Brian Evans
+Bug: https://bugs.gentoo.org/706196
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ hash.c | 2 ++
+ hash.h | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/hash.c b/hash.c
+index a0c3036..b5ff28a 100644
+--- a/hash.c
++++ b/hash.c
+@@ -4,6 +4,8 @@
+ #include "jenkins_hash.h"
+ #include "murmur3_hash.h"
+
++hash_func hash;
++
+ int hash_init(enum hashfunc_type type) {
+ switch(type) {
+ case JENKINS_HASH:
+diff --git a/hash.h b/hash.h
+index 059d1e2..3b2a984 100644
+--- a/hash.h
++++ b/hash.h
+@@ -2,7 +2,7 @@
+ #define HASH_H
+
+ typedef uint32_t (*hash_func)(const void *key, size_t length);
+-hash_func hash;
++extern hash_func hash;
+
+ enum hashfunc_type {
+ JENKINS_HASH=0, MURMUR3_HASH
+--
+2.25.0
+
diff --git a/net-misc/memcached/memcached-1.5.21.ebuild b/net-misc/memcached/memcached-1.5.21-r1.ebuild
index f5940b47e3f..4bd4eefadec 100644
--- a/net-misc/memcached/memcached-1.5.21.ebuild
+++ b/net-misc/memcached/memcached-1.5.21-r1.ebuild
@@ -35,6 +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"
)
src_prepare() {