define variables only in one .c file to fix multiple definition
add CFLAGS="$CLASS -fcommon" in libmemcached.spec is bad to fix multiple definition, it only masks error messages, but define variables only in one .c file is better choice. Signed-off-by: liu-yinsi <liuyinsi@163.com>
This commit is contained in:
parent
6f9557e3d1
commit
a4fd0aed29
32
libmemcached-fix-multiple-definition.patch
Normal file
32
libmemcached-fix-multiple-definition.patch
Normal file
@ -0,0 +1,32 @@
|
||||
--- a/clients/ms_memslap.h 2021-08-04 20:25:20.314194660 +0800
|
||||
+++ b/clients/ms_memslap.h 2021-08-04 20:26:01.154700115 +0800
|
||||
@@ -117,13 +117,13 @@
|
||||
} ms_global_t;
|
||||
|
||||
/* global structure */
|
||||
-ms_global_t ms_global;
|
||||
+extern ms_global_t ms_global;
|
||||
|
||||
/* global stats information structure */
|
||||
-ms_stats_t ms_stats;
|
||||
+extern ms_stats_t ms_stats;
|
||||
|
||||
/* global statistic structure */
|
||||
-ms_statistic_t ms_statistic;
|
||||
+extern ms_statistic_t ms_statistic;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
--- a/clients/ms_sigsegv.c 2014-02-09 19:52:42.000000000 +0800
|
||||
+++ b/clients/ms_sigsegv.c 2021-08-04 20:35:49.725984452 +0800
|
||||
@@ -21,6 +21,10 @@
|
||||
#include <pthread.h>
|
||||
|
||||
#include "ms_memslap.h"
|
||||
+ms_global_t ms_global;
|
||||
+ms_stats_t ms_stats;
|
||||
+ms_statistic_t ms_statistic;
|
||||
+
|
||||
#include "ms_setting.h"
|
||||
|
||||
/* prototypes */
|
||||
@ -1,7 +1,7 @@
|
||||
Name: libmemcached
|
||||
Summary: Client library and command line tools for memcached server
|
||||
Version: 1.0.18
|
||||
Release: 18
|
||||
Release: 19
|
||||
License: BSD
|
||||
URL: http://libmemcached.org/
|
||||
#origin source:https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
|
||||
@ -19,6 +19,7 @@ Patch0001: libmemcached-fix-linking-with-libpthread.patch
|
||||
Patch0002: libmemcached-build.patch
|
||||
Patch0003: libmemcached-fix-memdump-version.patch
|
||||
Patch0004: libmemcached-Ignore-specific-errors-from-memcached_dump.patch
|
||||
Patch0005: libmemcached-fix-multiple-definition.patch
|
||||
|
||||
|
||||
%description
|
||||
@ -54,7 +55,7 @@ cp -p tests/*.{cc,h} examples/
|
||||
%configure \
|
||||
--with-memcached=%{_bindir}/memcached \
|
||||
--enable-sasl --enable-libmemcachedprotocol \
|
||||
--enable-memaslap --enable-dtrace --disable-static CFLAGS="$CLASS -fcommon"
|
||||
--enable-memaslap --enable-dtrace --disable-static
|
||||
|
||||
%make_build V=1
|
||||
|
||||
@ -100,6 +101,9 @@ make test
|
||||
%{_mandir}/man3/hashkit*
|
||||
|
||||
%changelog
|
||||
* Web Aug 04 2021 Liu Yinsi <liuyinsi@163.com> - 1.0.18-19
|
||||
- fix multiple definition to support gcc 10
|
||||
|
||||
* Mon Aug 02 2021 Liu Yinsi <liuyinsi@163.com> - 1.0.18-18
|
||||
- compile with -fcommon to support gcc 10
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user