From c9e724ccb697e200994a39b9c371309810e11d84 Mon Sep 17 00:00:00 2001 From: bzhaoop Date: Mon, 2 Aug 2021 13:34:46 +0800 Subject: [PATCH] Fix gcc 10 compling issue Fix the issue via specify "-fcommon" in C_flags. Due to gcc 10 will disable the said option defaultly. --- gcc-10-cflags-fix.patch | 12 ++++++++++++ percona-xtrabackup.spec | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 gcc-10-cflags-fix.patch diff --git a/gcc-10-cflags-fix.patch b/gcc-10-cflags-fix.patch new file mode 100644 index 0000000..641390d --- /dev/null +++ b/gcc-10-cflags-fix.patch @@ -0,0 +1,12 @@ +diff -ruNa percona-xtrabackup-percona-xtrabackup-2.3.6/cmake/build_configurations/compiler_options.cmake percona-xtrabackup-percona-xtrabackup-2.3.6_patched/cmake/build_configurations/compiler_options.cmake +--- percona-xtrabackup-percona-xtrabackup-2.3.6/cmake/build_configurations/compiler_options.cmake 2021-08-02 10:04:35.684407534 +0800 ++++ percona-xtrabackup-percona-xtrabackup-2.3.6_patched/cmake/build_configurations/compiler_options.cmake 2021-08-02 10:05:25.068932898 +0800 +@@ -25,7 +25,7 @@ + + # Default GCC flags + IF(CMAKE_COMPILER_IS_GNUCC) +- SET(COMMON_C_FLAGS "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -Wno-implicit-fallthrough -Wno-stringop-truncation -Wno-stringop-overflow") ++ SET(COMMON_C_FLAGS "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -Wno-implicit-fallthrough -Wno-stringop-truncation -Wno-stringop-overflow -fcommon") + # Disable inline optimizations for valgrind testing to avoid false positives + IF(WITH_VALGRIND) + SET(COMMON_C_FLAGS "-fno-inline ${COMMON_C_FLAGS}") diff --git a/percona-xtrabackup.spec b/percona-xtrabackup.spec index 9ad83f5..cc34c81 100644 --- a/percona-xtrabackup.spec +++ b/percona-xtrabackup.spec @@ -1,12 +1,13 @@ Name: percona-xtrabackup Summary: Online backup for InnoDB/XtraDB in MySQL, Percona Server and MariaDB Version: 2.3.6 -Release: 1 +Release: 2 License: GPLv2 URL: http://www.percona.com/software/percona-xtrabackup/ Source: percona-xtrabackup-%{version}.tar.gz Patch1: gcc-7-flags-fix.patch Patch2: compilec-fix.patch +Patch3: gcc-10-cflags-fix.patch Provides: %{name} @@ -50,6 +51,8 @@ This package contains the test suite for Percona Xtrabackup %setup -qn %{name}-%{name}-%{version} %patch1 -p1 %patch2 -p1 +%patch3 -p1 + %build cmake -DBUILD_CONFIG=xtrabackup_release && make %{?_smp_mflags} @@ -94,6 +97,9 @@ popd %doc COPYING %changelog +* Mon Aug 2 2021 bzhaoop - 2.3.6-2 +- Fix gcc 10 compiling issue + * Mon Jul 26 2021 bzhaoop - 2.3.6-1 - Init project for percona-xtrabackup -- Gitee