From 4265cbbd12f621c3aa00c70f521a6345f91a7134 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Thu, 24 Sep 2020 23:34:38 +0800 Subject: [PATCH] Add missing header for gcc10 build this change has given better compatible with both gcc8 and gcc10 toolchain, should be maintained util upstream fixes Some C++ Standard Library headers have been changed to no longer include the header. As such, C++ programs that used components defined in or without explicitly including the right headers will no longer compile. Previously components such as std::runtime_error, std::string and std::allocator were implicitly defined after including unrelated headers such as and . Correct code should include the appropriate headers for the classes being used. this change has given better compatible with gcc10 toolchain, should be maintained util upstream fixes refer url: https://gcc.gnu.org/gcc-10/porting_to.html Signed-off-by: Liwei Ge Signed-off-by: weitao zhou --- 1001-fix-gcc10-missing-header.patch | 38 ++++++++++++++++++++ 1002-detect-and-use-sigdescr_np.patch | 51 +++++++++++++++++++++++++++ 1003-add-sigdescr_np-option.patch | 14 ++++++++ ceph.spec | 15 +++++++- 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 1001-fix-gcc10-missing-header.patch create mode 100644 1002-detect-and-use-sigdescr_np.patch create mode 100644 1003-add-sigdescr_np-option.patch diff --git a/1001-fix-gcc10-missing-header.patch b/1001-fix-gcc10-missing-header.patch new file mode 100644 index 0000000..c77ecf3 --- /dev/null +++ b/1001-fix-gcc10-missing-header.patch @@ -0,0 +1,38 @@ +From 598c37296c944a056e4cd90e9f73c9e2fa6552fc Mon Sep 17 00:00:00 2001 +From: Kefu Chai +Date: Sun, 5 Jan 2020 22:25:40 +0800 +Subject: [PATCH] common: add missing #include + +clang++-9.0.1 and libc++ require them to build + +Signed-off-by: Kefu Chai +--- + src/common/PluginRegistry.h | 1 + + src/common/bit_str.h | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/src/common/PluginRegistry.h b/src/common/PluginRegistry.h +index 5a092def7c5e..62020a963a8e 100644 +--- a/src/common/PluginRegistry.h ++++ b/src/common/PluginRegistry.h +@@ -19,6 +19,7 @@ + #ifndef CEPH_COMMON_PLUGINREGISTRY_H + #define CEPH_COMMON_PLUGINREGISTRY_H + ++#include + #include "common/Mutex.h" + + class CephContext; +diff --git a/src/common/bit_str.h b/src/common/bit_str.h +index c4c24f6a75fb..5271c8ffe158 100644 +--- a/src/common/bit_str.h ++++ b/src/common/bit_str.h +@@ -14,6 +14,8 @@ + #ifndef CEPH_COMMON_BIT_STR_H + #define CEPH_COMMON_BIT_STR_H + ++#include ++#include + #include + + namespace ceph { diff --git a/1002-detect-and-use-sigdescr_np.patch b/1002-detect-and-use-sigdescr_np.patch new file mode 100644 index 0000000..0aa0ec1 --- /dev/null +++ b/1002-detect-and-use-sigdescr_np.patch @@ -0,0 +1,51 @@ +From b9b6faf66ae67648626470cb4fc3f0850ac4d842 Mon Sep 17 00:00:00 2001 +From: David Disseldorp +Date: Tue, 1 Sep 2020 13:49:21 +0200 +Subject: [PATCH] cmake: detect and use sigdescr_np() if available + +sys_siglist is deprecated with glibc 2.32. A new thread-safe and +async-signal safe sigdescr_np() function is provided, so use it if +available. + +Fixes: https://tracker.ceph.com/issues/47187 +Signed-off-by: David Disseldorp +--- + cmake/modules/CephChecks.cmake | 1 + + src/global/signal_handler.h | 8 +++++--- + src/include/config-h.in.cmake | 3 +++ + 3 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/src/global/signal_handler.h b/src/global/signal_handler.h +index 476724201aa9..c101b2e28733 100644 +--- a/src/global/signal_handler.h ++++ b/src/global/signal_handler.h +@@ -20,10 +20,12 @@ + + typedef void (*signal_handler_t)(int); + +-#ifndef HAVE_REENTRANT_STRSIGNAL +-# define sig_str(signum) sys_siglist[signum] +-#else ++#ifdef HAVE_SIGDESCR_NP ++# define sig_str(signum) sigdescr_np(signum) ++#elif defined(HAVE_REENTRANT_STRSIGNAL) + # define sig_str(signum) strsignal(signum) ++#else ++# define sig_str(signum) sys_siglist[signum] + #endif + + void install_sighandler(int signum, signal_handler_t handler, int flags); +diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake +index 1ea3703f620c..59bd4273511a 100644 +--- a/src/include/config-h.in.cmake ++++ b/src/include/config-h.in.cmake +@@ -220,6 +220,9 @@ + /* Define to 1 if you have sched.h. */ + #cmakedefine HAVE_SCHED 1 + ++/* Define to 1 if you have sigdescr_np. */ ++#cmakedefine HAVE_SIGDESCR_NP 1 ++ + /* Support SSE (Streaming SIMD Extensions) instructions */ + #cmakedefine HAVE_SSE + diff --git a/1003-add-sigdescr_np-option.patch b/1003-add-sigdescr_np-option.patch new file mode 100644 index 0000000..cea1d9f --- /dev/null +++ b/1003-add-sigdescr_np-option.patch @@ -0,0 +1,14 @@ +--- ceph-12.2.7/CMakeLists.txt 2018-07-17 00:00:31.000000000 +0800 ++++ ceph-12.2.7.new/CMakeLists.txt 2020-10-11 19:29:18.509953603 +0800 +@@ -464,6 +464,11 @@ + set(HAVE_REENTRANT_STRSIGNAL 1 CACHE INTERNAL "Reentrant strsignal is supported.") + endif(WITH_REENTRANT_STRSIGNAL) + ++option(WITH_SIGDESCR_NP "sigdescr_np is reentrant" OFF) ++if(WITH_SIGDESCR_NP) ++ set(HAVE_SIGDESCR_NP 1 CACHE INTERNAL "Reentrant sigdescr_np is supported.") ++endif(WITH_SIGDESCR_NP) ++ + set(HAVE_LIBROCKSDB 1) + + # -lz link into kv diff --git a/ceph.spec b/ceph.spec index aac9310..554e9e7 100644 --- a/ceph.spec +++ b/ceph.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 # vim: set noexpandtab ts=8 sw=8 : # # spec file for package ceph @@ -68,6 +68,15 @@ Patch005: 0005-Disable-rocksdb-Werror.patch Patch006: 0006-python-to-python3.patch Patch007: 0007-Strip-away-python2.patch Patch008: 0008-Fix-python-executable.patch + +# Begin: Anolis customized patches +# backport patch from upstream +Patch1001: 1001-fix-gcc10-missing-header.patch +Patch1002: 1002-detect-and-use-sigdescr_np.patch +# baseos add sigdescr_np option +Patch1003: 1003-add-sigdescr_np-option.patch +# End: Anolis customized patches + %if 0%{?suse_version} %if 0%{?is_opensuse} ExclusiveArch: x86_64 aarch64 ppc64 ppc64le @@ -406,6 +415,7 @@ cmake .. \ -DWITH_BOOST_CONTEXT=OFF \ -DWITH_LEVELDB=OFF \ -DWITH_RADOSGW=OFF \ + -DWITH_SIGDESCR_NP=ON \ %if ( ( 0%{?rhel} && 0%{?rhel} <= 7) && ! 0%{?centos} ) -DWITH_SUBMAN=ON \ %endif @@ -786,6 +796,9 @@ fi %changelog +* Thu Nov 18 2021 Liwei Ge - 1:12.2.7-9.0.2 +- add missing header for compatible gcc10 build + * Thu Feb 4 2021 - 1:12.2.7-9.0.1 - use python3_sitearch instead of python_sitearch -- Gitee