Fix mysql5 building failure when using gcc 10.X

For following the quick bump gcc versions in openEuler community,
we need to trace the said issues when the other SIG bump gcc version.
What we will hit issue is:
1. The default enable C/CXX flags, might be disable in the new gcc version.
2. New gcc version might Syntax incompatibility for a same code line/block.

This patch also fix the test failure in openEuler mainline.
Removing the wrong binlog types during tests.
This commit is contained in:
bzhaoop 2021-08-02 10:16:36 +08:00
parent c6884aa72f
commit a13408fc80

View File

@ -1,5 +1,11 @@
%global pkg_name %{name}
%global pkgnamepatch mysql5
# The reason of introduce this is:
# openEuler/gcc version bump so quick. So any new gcc version might default disable
# some options which are default to enable in previos gcc versions.
%global gcc_c_adaptive_options -fcommon
%{!?runselftest:%global runselftest 1}
%global check_testsuite 0
%global with_shared_lib_major_hack 0
@ -33,7 +39,7 @@
%global sameevr %{?epoch:%{epoch}:}%{version}-%{release}
Name: mysql5
Version: 5.7.34
Release: 1
Release: 2
Summary: MySQL client programs and shared libraries
URL: http://www.mysql.com
License: GPLv2 with exceptions and LGPLv2 and BSD
@ -343,7 +349,7 @@ cmake .. \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_BOOST=../boost \
-DCMAKE_C_FLAGS="%{optflags}%{?with_debug: -fno-strict-overflow -Wno-unused-result -Wno-unused-function -Wno-unused-but-set-variable}" \
-DCMAKE_C_FLAGS="%{optflags}%{?with_debug: -fno-strict-overflow -Wno-unused-result -Wno-unused-function -Wno-unused-but-set-variable} %{gcc_c_adaptive_options}" \
-DCMAKE_CXX_FLAGS="%{optflags}%{?with_debug: -fno-strict-overflow -Wno-unused-result -Wno-unused-function -Wno-unused-but-set-variable}" \
%{?with_debug: -DWITH_DEBUG=1}\
-DTMPDIR=/var/tmp \
@ -459,7 +465,6 @@ cp ../../mysql-test/%{skiplist} .
export MTR_BUILD_THREAD=%{__isa_bits}
./mtr \
--mem --parallel=auto --force --retry=2 \
--mysqld=--binlog-format=mixed \
--suite-timeout=720 --testcase-timeout=30 \
--report-unstable-tests --clean-vardir \
%if %{check_testsuite}
@ -721,6 +726,9 @@ fi
%endif
%changelog
* Mon Aug 2 2021 bzhaoop <bzhaojyathousandy@gmail.com> - 5.7.34-2
- Fix the compiling issue when bump gcc version to 10.X
* Thu Jul 1 2021 bzhaoop <bzhaojyathousandy@gmail.com> - 5.7.34-1
- Bump from 5.7.21 to latest 5.7.34
- Correct the test steps and options