1 |
commit: 4ddb2458cf63fa9191d815cfae1fe697e24d4c08 |
2 |
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 24 21:11:05 2020 +0000 |
4 |
Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 24 21:17:51 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ddb2458 |
7 |
|
8 |
net-misc/memcached: fix building with gcc 10 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/706196 |
11 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
12 |
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org> |
13 |
|
14 |
....21-hash-fix-build-failure-against-gcc-10.patch | 56 ++++++++++++++++++++++ |
15 |
...ed-1.5.21.ebuild => memcached-1.5.21-r1.ebuild} | 1 + |
16 |
2 files changed, 57 insertions(+) |
17 |
|
18 |
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 |
19 |
new file mode 100644 |
20 |
index 00000000000..527d4607316 |
21 |
--- /dev/null |
22 |
+++ b/net-misc/memcached/files/memcached-1.5.21-hash-fix-build-failure-against-gcc-10.patch |
23 |
@@ -0,0 +1,56 @@ |
24 |
+From 63b8e76067523a02a3e0215db1aef0b34edcf708 Mon Sep 17 00:00:00 2001 |
25 |
+From: Sergei Trofimovich <slyfox@g.o> |
26 |
+Date: Thu, 23 Jan 2020 22:16:36 +0000 |
27 |
+Subject: [PATCH] hash: fix build failure against gcc-10 |
28 |
+ |
29 |
+On gcc-10 (and gcc-9 -fno-common) build fails as: |
30 |
+ |
31 |
+``` |
32 |
+gcc -g -O2 -pthread -pthread -Wall -Werror -pedantic -Wmissing-prototypes \ |
33 |
+ -Wmissing-declarations -Wredundant-decls -o memcached ... -levent |
34 |
+ld: memcached-hash.o:memcached/hash.h:5: |
35 |
+ multiple definition of `hash'; memcached-memcached.o:memcached/hash.h:5: first defined here |
36 |
+``` |
37 |
+ |
38 |
+gcc-10 will change the default from -fcommon to fno-common: |
39 |
+https://gcc.gnu.org/PR85678. |
40 |
+ |
41 |
+The error also happens if CFLAGS=-fno-common passed explicitly. |
42 |
+ |
43 |
+Reported-by: Brian Evans |
44 |
+Bug: https://bugs.gentoo.org/706196 |
45 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
46 |
+--- |
47 |
+ hash.c | 2 ++ |
48 |
+ hash.h | 2 +- |
49 |
+ 2 files changed, 3 insertions(+), 1 deletion(-) |
50 |
+ |
51 |
+diff --git a/hash.c b/hash.c |
52 |
+index a0c3036..b5ff28a 100644 |
53 |
+--- a/hash.c |
54 |
++++ b/hash.c |
55 |
+@@ -4,6 +4,8 @@ |
56 |
+ #include "jenkins_hash.h" |
57 |
+ #include "murmur3_hash.h" |
58 |
+ |
59 |
++hash_func hash; |
60 |
++ |
61 |
+ int hash_init(enum hashfunc_type type) { |
62 |
+ switch(type) { |
63 |
+ case JENKINS_HASH: |
64 |
+diff --git a/hash.h b/hash.h |
65 |
+index 059d1e2..3b2a984 100644 |
66 |
+--- a/hash.h |
67 |
++++ b/hash.h |
68 |
+@@ -2,7 +2,7 @@ |
69 |
+ #define HASH_H |
70 |
+ |
71 |
+ typedef uint32_t (*hash_func)(const void *key, size_t length); |
72 |
+-hash_func hash; |
73 |
++extern hash_func hash; |
74 |
+ |
75 |
+ enum hashfunc_type { |
76 |
+ JENKINS_HASH=0, MURMUR3_HASH |
77 |
+-- |
78 |
+2.25.0 |
79 |
+ |
80 |
|
81 |
diff --git a/net-misc/memcached/memcached-1.5.21.ebuild b/net-misc/memcached/memcached-1.5.21-r1.ebuild |
82 |
similarity index 97% |
83 |
rename from net-misc/memcached/memcached-1.5.21.ebuild |
84 |
rename to net-misc/memcached/memcached-1.5.21-r1.ebuild |
85 |
index f5940b47e3f..4bd4eefadec 100644 |
86 |
--- a/net-misc/memcached/memcached-1.5.21.ebuild |
87 |
+++ b/net-misc/memcached/memcached-1.5.21-r1.ebuild |
88 |
@@ -35,6 +35,7 @@ PATCHES=( |
89 |
"${FILESDIR}/${PN}-1.4.0-fix-as-needed-linking.patch" |
90 |
"${FILESDIR}/${PN}-1.4.4-as-needed.patch" |
91 |
"${FILESDIR}/${PN}-1.4.17-EWOULDBLOCK.patch" |
92 |
+ "${FILESDIR}/${PN}-1.5.21-hash-fix-build-failure-against-gcc-10.patch" |
93 |
) |
94 |
|
95 |
src_prepare() { |