All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit branch/2020.08.x] package/memcached: fix build with gcc 10
@ 2020-09-11 20:39 Peter Korsgaard
  0 siblings, 0 replies; only message in thread
From: Peter Korsgaard @ 2020-09-11 20:39 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=dce3209187f86c0a4a67fb3f88d45a7c0dfe04a8
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2020.08.x

Fixes:
 - http://autobuild.buildroot.org/results/ba8dcdece193b91845a30cd31d3574674ec30068

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit f4d124b91c5e972fb3071d0418d2225c8116dd6f)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 ...003-hash-fix-build-failure-against-gcc-10.patch | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/package/memcached/0003-hash-fix-build-failure-against-gcc-10.patch b/package/memcached/0003-hash-fix-build-failure-against-gcc-10.patch
new file mode 100644
index 0000000000..564b191c1b
--- /dev/null
+++ b/package/memcached/0003-hash-fix-build-failure-against-gcc-10.patch
@@ -0,0 +1,56 @@
+From 0447ae4cbbebb87d3f28bb92f7e219a47263b889 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>
+[Retrieved from:
+https://github.com/memcached/memcached/commit/0447ae4cbbebb87d3f28bb92f7e219a47263b889]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ hash.c | 2 ++
+ hash.h | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/hash.c b/hash.c
+index a0c30369f..b5ff28ae4 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 059d1e2a6..3b2a98478 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-11 20:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 20:39 [Buildroot] [git commit branch/2020.08.x] package/memcached: fix build with gcc 10 Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.