!10 删除参数-fcommon并真正解决变量重复定义

From: @liu-yinsi
Reviewed-by: @small_leek
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2021-08-04 14:44:14 +00:00 committed by Gitee
commit c22e7874f2
2 changed files with 38 additions and 2 deletions

View 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 */

View File

@ -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