Add stack protector compile option

Signed-off-by: Lv Ying <lvying6@huawei.com>
(cherry picked from commit 092809a9568ecb1654fd8623ecebee4fa63cadca)
This commit is contained in:
Lv Ying 2022-03-08 19:10:03 -08:00 committed by openeuler-sync-bot
parent 86eebebca7
commit 5ce7fe310a
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From 7b9428779bbbff411c802e5c80a3fbdaee8608e9 Mon Sep 17 00:00:00 2001
From: Lv Ying <lvying6@huawei.com>
Date: Tue, 8 Mar 2022 19:06:34 -0800
Subject: [PATCH] Add stack protector compile option
Signed-off-by: Lv Ying <lvying6@huawei.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1e070a6..84ff9fd 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ CLANG ?= clang -v
VMLINUX ?= vmlinux.h
INCLUDES := -I$(OUTPUT) -I$(dir $(VMLINUX))
-CFLAGS := -g -Wall
+CFLAGS := -g -Wall -fstack-protector-strong
ARCH := $(shell uname -m | sed 's/x86_64/x86/')
APPS = readahead_tune
--
2.27.0

View File

@ -1,12 +1,13 @@
Name: A-Tune-BPF-Collection
Version: 1.0.0
Release: 2
Release: 3
License: Mulan PSL v2
Summary: BPF program collection to adjust fine-grained kernel mode to get better performance
URL: https://gitee.com/openeuler/A-Tune-BPF-Collection
Source0: https://gitee.com/openeuler/A-Tune-BPF-Collection/repository/archive/v%{version}.tar.gz
Patch1: use-generated-vmlinux.h-instead-of-bpftool-gen-vmlin.patch
Patch2: Add-stack-protector-compile-option.patch
BuildRequires: clang, llvm, libbpf-devel
Requires: libbpf
@ -38,6 +39,12 @@ install -D -p -m 0644 readahead_tune.conf %{buildroot}%{_sysconfdir}/sysconfig/r
%config(noreplace) %{_sysconfdir}/sysconfig/readahead_tune.conf
%changelog
* Wed Mar 9 2022 lvying<lvying6@huawei.com> - 1.0.0-3
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: Add stack protector compile option
* Wed Dec 8 2021 lvying<lvying6@huawei.com> - 1.0.0-2
- Type:bugfix
- ID:NA