From e55a145d5a9a6e8bf2177011cd0270c943c045f3 Mon Sep 17 00:00:00 2001 From: MementoMori <1003350679@qq.com> Date: Tue, 7 Sep 2021 17:21:35 +0800 Subject: [PATCH] add fstack-protector-strong --- memtester-add-fstack-protector.patch | 35 ++++++++++++++++++++++++++++ memtester.spec | 8 +++++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 memtester-add-fstack-protector.patch diff --git a/memtester-add-fstack-protector.patch b/memtester-add-fstack-protector.patch new file mode 100644 index 0000000..68071d8 --- /dev/null +++ b/memtester-add-fstack-protector.patch @@ -0,0 +1,35 @@ +From 9acc16f71329bd61198de45d2edb8992652a8d18 Mon Sep 17 00:00:00 2001 +From: caodongxia <315816521@qq.com> +Date: Fri, 19 Mar 2021 12:46:40 +0800 +Subject: [PATCH] create + +--- + Makefile | 2 +- + conf-cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index e9ae52c..3b1a0a6 100644 +--- a/Makefile ++++ b/Makefile +@@ -12,7 +12,7 @@ + # more information. + CC = $(shell head -n 1 conf-cc) + LD = $(shell head -n 1 conf-ld) +- ++$(info CFLAGS=$(CC)) + SOURCES = memtester.c tests.c + OBJECTS = $(SOURCES:.c=.o) + HEADERS = memtester.h +diff --git a/conf-cc b/conf-cc +index b99d03d..c3ad6bb 100644 +--- a/conf-cc ++++ b/conf-cc +@@ -1,3 +1,3 @@ +-cc -O2 -DPOSIX -D_POSIX_C_SOURCE=200809L -D_FILE_OFFSET_BITS=64 -DTEST_NARROW_WRITES -c ++cc -O2 -fstack-protector-strong -DPOSIX -D_POSIX_C_SOURCE=200809L -D_FILE_OFFSET_BITS=64 -DTEST_NARROW_WRITES -c + + This will be used to compile .c files. +-- +2.27.0 + diff --git a/memtester.spec b/memtester.spec index 6dbb354..eb299d1 100644 --- a/memtester.spec +++ b/memtester.spec @@ -2,7 +2,7 @@ Name: memtester Version: 4.3.0 -Release: 2 +Release: 3 Summary: A userspace utility for testing the memory subsystem for faults License: GPLv2 URL: http://pyropus.ca/software/memtester/ @@ -10,7 +10,7 @@ Source0: http://pyropus.ca/software/memtester/old-versions/%{name}-%{version}.ta Patch0: memtester-fix-make-install-path.patch Patch1: fix-multi-difine.patch - +Patch2: memtester-add-fstack-protector.patch BuildRequires: gcc %description @@ -20,6 +20,7 @@ A userspace utility for testing the memory subsystem for faults. It's portable a %setup -q -n %{name}-%{version}/ %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %make_build @@ -41,6 +42,9 @@ make install DESTDIR="%{buildroot}" %{_mandir}/* %changelog +* Tue Sep 7 2021 Shaowei Cheng +- Add -fstack-protector-strong + * Wed Aug 4 2021 Lu Weitao - fix compile failure by upgrade to GCC-10 -- Gitee