Fix gcc 10 compling issue

Fix the issue via specify "-fcommon" in C_flags.
Due to gcc 10 will disable the said option defaultly.
This commit is contained in:
bzhaoop 2021-08-02 13:34:46 +08:00
parent 4c05728d10
commit c9e724ccb6
2 changed files with 19 additions and 1 deletions

12
gcc-10-cflags-fix.patch Normal file
View File

@ -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}")

View File

@ -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 <bzhaojyathousandy@gmail.com> - 2.3.6-2
- Fix gcc 10 compiling issue
* Mon Jul 26 2021 bzhaoop <bzhaojyathousandy@gmail.com> - 2.3.6-1
- Init project for percona-xtrabackup