!8 [sync] PR-6: 添加栈保护编译选项-fstack-protector-strong

From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2022-12-08 11:06:31 +00:00 committed by Gitee
commit 98fce6d908
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,26 @@
diff --git a/Makefile b/Makefile
index 089b621..3665e0f 100644
--- a/Makefile
+++ b/Makefile
@@ -113,7 +113,7 @@ INCLUDES = -I. -I $(srctree)/include $(CONFIG_INCLUDES)
ifdef EXTRA_CFLAGS
CFLAGS := $(EXTRA_CFLAGS)
else
- CFLAGS := -g -Wall
+ CFLAGS := -g -Wall -fstack-protector-strong
endif
LIBS = -ldl
diff --git a/plugins/Makefile b/plugins/Makefile
index b60352d..d5744a9 100644
--- a/plugins/Makefile
+++ b/plugins/Makefile
@@ -75,7 +75,7 @@ INCLUDES = -I. -I.. -I../src -I $(srctree)/include $(CONFIG_INCLUDES)
ifdef EXTRA_CFLAGS
CFLAGS := $(EXTRA_CFLAGS)
else
- CFLAGS := -g -Wall
+ CFLAGS := -g -Wall -fstack-protector-strong
endif
# Append required CFLAGS

View File

@ -1,11 +1,14 @@
Name: libtraceevent
Version: 1.2.1
Release: 1
Release: 2
License: LGPLv2+ and GPLv2+
Summary: Library to parse raw trace event formats
URL: https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
Source0: https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/libtraceevent-%{version}.tar.gz
Patch0000: 0001-fix-missing-fstack-protector-strong.patch
BuildRequires: gcc
BuildRequires: xmlto
BuildRequires: asciidoc
@ -23,7 +26,7 @@ Requires: %{name}%{_isa} = %{version}-%{release}
Development headers of %{name}-libs
%prep
%setup -q
%autosetup -n %{name}-%{version} -p1
%build
MANPAGE_DOCBOOK_XSL=`rpm -ql docbook-style-xsl | grep manpages/docbook.xsl`
@ -51,6 +54,9 @@ rm -rf %{buildroot}/%{_libdir}/libtraceevent.a
%{_libdir}/pkgconfig/libtraceevent.pc
%changelog
* Mon Dec 05 2022 xu_ping <xuping33@h-partners.com> - 1.2.1-2
- Add -fstack-protector-strong compile options
* Fri Jan 14 2022 houyingchao <houyingchao@huawei.com> - 1.2.1-1
- Init package