Add cflags -fstack-protector-strong

This commit is contained in:
lkx690 2020-03-18 10:01:55 +08:00
parent 19cf31bb9a
commit 5ed19f48fb
2 changed files with 37 additions and 1 deletions

View File

@ -1,7 +1,7 @@
%define debug_package %{nil}
Name: gnu-efi
Version: 3.0.8
Release: 5
Release: 6
Summary: Development Libraries and headers for EFI
Epoch: 1
License: BSD
@ -10,6 +10,7 @@ ExclusiveArch: x86_64 aarch64
Source: http://superb-dca2.dl.sourceforge.net/project/gnu-efi/gnu-efi-3.0.8.tar.bz2
#stubs-32.h comes from http://www.gnu.org/software/glibc/
Source1: stubs-32.h
Patch1: modify-cflags.patch
%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed 's/^ID=//'))
@ -76,6 +77,9 @@ mv ia32/apps/{route80h.efi,modelist.efi} %{buildroot}/boot/efi/EFI/%{efidir}/ia3
%{_includedir}/efi
%changelog
* Wed Mar 18 2020 likexin <likexin4@huawei.com> - 3.0.8-6
- Add cflags -fstack-protector-strong
* Fri Mar 13 2020 zhujunhao<zhujunhao5@huawei.com> - 3.0.8-5
- Modify x86 build failed

32
modify-cflags.patch Normal file
View File

@ -0,0 +1,32 @@
diff -Nur gnu-efi-3.0.8.orig/Make.defaults gnu-efi-3.0.8-2/Make.defaults
--- gnu-efi-3.0.8.orig/Make.defaults 2018-03-15 02:54:51.000000000 +0800
+++ gnu-efi-3.0.8-2/Make.defaults 2020-03-17 23:23:49.602158451 +0800
@@ -87,7 +87,7 @@
# Arch-specific compilation flags
CPPFLAGS += -DCONFIG_$(ARCH)
-CFLAGS += -Wno-error=pragmas
+CFLAGS += -Wno-error=pragmas -fstack-protector-strong
ifeq ($(ARCH),ia64)
CFLAGS += -mfixed-range=f32-f127
@@ -168,16 +168,15 @@
ifeq (FreeBSD, $(findstring FreeBSD, $(OS)))
CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
-fshort-wchar -fno-strict-aliasing \
- -ffreestanding -fno-stack-protector
+ -ffreestanding
else
CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
-fshort-wchar -fno-strict-aliasing \
- -ffreestanding -fno-stack-protector -fno-stack-check \
- -fno-stack-check \
+ -ffreestanding \
$(if $(findstring gcc,$(CC)),-fno-merge-all-constants,)
endif
ARFLAGS := rDv
ASFLAGS += $(ARCH3264)
-LDFLAGS += -nostdlib --warn-common --no-undefined --fatal-warnings \
+LDFLAGS += -nostdlib --warn-common --fatal-warnings \
--build-id=sha1