From 6bf16a1572376712e1eacde6a7efc19d728dd272 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Mon, 22 Oct 2018 18:04:56 +0000 Subject: [PATCH] - merged protobuf 3.6 fix from PLD --- mysql-opt.patch | 34 ++++++++++++++++++++++++++++++++++ mysql.spec | 16 +++++++++++----- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/mysql-opt.patch b/mysql-opt.patch index c1a8298..eaa5c4e 100644 --- a/mysql-opt.patch +++ b/mysql-opt.patch @@ -39,3 +39,37 @@ # Solaris flags +--- percona-server-5.7.23-23/cmake/build_configurations/compiler_options.cmake.orig 2018-10-14 08:44:45.291573886 +0200 ++++ percona-server-5.7.23-23/cmake/build_configurations/compiler_options.cmake 2018-10-14 08:44:55.181573772 +0200 +@@ -25,17 +25,17 @@ + SET(64BIT 1) + ENDIF() + +-SET(CMAKE_CXX_STANDARD 98) ++SET(CMAKE_CXX_STANDARD 11) + + # Compiler options + IF(UNIX) +- MY_CHECK_CXX_COMPILER_FLAG("-std=gnu++03" GNU03_SUPPORTED) ++ MY_CHECK_CXX_COMPILER_FLAG("-std=gnu++11" GNU11_SUPPORTED) + +- IF(GNU03_SUPPORTED) ++ IF(GNU11_SUPPORTED) + IF(CMAKE_VERSION VERSION_LESS 3.1.0) +- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++03") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") + ELSE() +- SET(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -std=gnu++03) ++ SET(CMAKE_CXX11_EXTENSION_COMPILE_OPTION -std=gnu++11) + ENDIF() + ENDIF() + +@@ -140,7 +140,7 @@ + + SET(COMMON_C_FLAGS "-g ${SUNPRO_FLAGS}") + SET(COMMON_CXX_FLAGS "-g0 ${SUNPRO_FLAGS}") +- SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -std=c++03") ++ SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -std=c++11") + SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}") + SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_C_FLAGS}") diff --git a/mysql.spec b/mysql.spec index fa030fd..44f4dee 100644 --- a/mysql.spec +++ b/mysql.spec @@ -43,7 +43,7 @@ %undefine with_tokudb %endif -%define rel 2 +%define rel 3 %define percona_rel 23 %include /usr/lib/rpm/macros.perl Summary: MySQL: a very fast and reliable SQL database engine @@ -518,13 +518,19 @@ cd build # (it defaults to first cluster but user may change it to whatever # cluster it wants) +%if "%{cc_version}" >= "7.0" +FALLTHROUGH_OPT="-Wimplicit-fallthrough=0" +%else +FALLTHROUGH_OPT= +%endif + CPPFLAGS="%{rpmcppflags}" \ %cmake .. \ -DCMAKE_BUILD_TYPE=%{!?debug:RelWithDebInfo}%{?debug:Debug} \ - -DCMAKE_C_FLAGS_DEBUG="-fno-omit-frame-pointer -fno-strict-aliasing -Wimplicit-fallthrough=0" \ - -DCMAKE_CXX_FLAGS_DEBUG="-fno-omit-frame-pointer -fno-strict-aliasing -Wimplicit-fallthrough=0" \ - -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{rpmcflags} -DNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing -Wimplicit-fallthrough=0 -Wno-shadow" \ - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{rpmcxxflags} -DNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing -Wimplicit-fallthrough=0 -Wno-shadow" \ + -DCMAKE_C_FLAGS_DEBUG="-fno-omit-frame-pointer -fno-strict-aliasing $FALLTHROUGH_OPT" \ + -DCMAKE_CXX_FLAGS_DEBUG="-fno-omit-frame-pointer -fno-strict-aliasing $FALLTHROUGH_OPT" \ + -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{rpmcflags} -DNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing $FALLTHROUGH_OPT -Wno-shadow" \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{rpmcxxflags} -DNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing $FALLTHROUGH_OPT -Wno-shadow" \ -DCOMPILATION_COMMENT="TLD Linux MySQL RPM" \ -DCURSES_INCLUDE_PATH=/usr/include/ncurses \ %{?with_systemtap:-DENABLE_DTRACE=ON} \ -- 2.46.0