Add -fstack-protector-stroong compile options

Signed-off-by: cherry530 <xuping33@huawei.com>
(cherry picked from commit a53b9562c12d55fcd960531acbb455baab805bd6)
This commit is contained in:
cherry530 2022-12-05 14:28:01 +08:00 committed by openeuler-sync-bot
parent 12f77f45f3
commit 3c7d99fbbb
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