From b156d5c18cedf4237f561cadcf49864ba8d62388 Mon Sep 17 00:00:00 2001 From: zhangtao2020 Date: Wed, 18 Mar 2020 13:41:46 +0800 Subject: [PATCH] add stack protect --- 0000-mysql-add-fstack-protector-strong.patch | 20 ++++++++++++++++++++ mysql.spec | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 0000-mysql-add-fstack-protector-strong.patch diff --git a/0000-mysql-add-fstack-protector-strong.patch b/0000-mysql-add-fstack-protector-strong.patch new file mode 100644 index 0000000..23c07c8 --- /dev/null +++ b/0000-mysql-add-fstack-protector-strong.patch @@ -0,0 +1,20 @@ +diff --git a/cmake/build_configurations/compiler_options.cmake b/cmake/build_configurations/compiler_options.cmake +index fecf2a2..f3e012f 100644 +--- a/cmake/build_configurations/compiler_options.cmake ++++ b/cmake/build_configurations/compiler_options.cmake +@@ -43,6 +43,7 @@ IF(UNIX) + # Default GCC flags + IF(CMAKE_COMPILER_IS_GNUCC) + SET(COMMON_C_FLAGS "-fno-omit-frame-pointer") ++ SET(COMMON_C_FLAGS "-fstack-protector-strong") + # Disable inline optimizations for valgrind testing to avoid false positives + IF(WITH_VALGRIND) + STRING_PREPEND(COMMON_C_FLAGS "-fno-inline ") +@@ -57,6 +58,7 @@ IF(UNIX) + ENDIF() + IF(CMAKE_COMPILER_IS_GNUCXX) + SET(COMMON_CXX_FLAGS "-std=c++14 -fno-omit-frame-pointer") ++ SET(COMMON_CXX_FLAGS "-fstack-protector-strong") + # Disable inline optimizations for valgrind testing to avoid false positives + IF(WITH_VALGRIND) + STRING_PREPEND(COMMON_CXX_FLAGS "-fno-inline ") diff --git a/mysql.spec b/mysql.spec index 377c44e..3a53693 100644 --- a/mysql.spec +++ b/mysql.spec @@ -6,12 +6,13 @@ Name: mysql Version: 8.0.17 -Release: 2 +Release: 3 License: GPLv2 Summary: The world's most popular open source database URL: http://www.mysql.com/ Source0: https://cdn.mysql.com/archives/%{name}-8.0/%{name}-boost-%{version}.tar.gz +Patch0000: 0000-mysql-add-fstack-protector-strong.patch BuildRequires: cmake openssl-devel ncurses-devel libtirpc-devel rpcgen Requires: libatomic >= 1.2.0 libstdc++ >= 7.3.0 ncurses libtirpc openssl @@ -79,5 +80,7 @@ userdel -r %{name} &>/dev/null %exclude /usr/lib/debug %changelog +* Wed Mar 1 2020 zhangtao 8.0.17-3 +- add fstack-protector-strong * Fri Feb 28 2020 catastrowings 8.0.17-2 - openEuler package init. -- Gitee