1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
From a99af48ad7f4987fad6a8bcddffe67d06b08788d Mon Sep 17 00:00:00 2001
From: Felix Moessbauer <felix.moessbauer@siemens.com>
Date: Mon, 13 Nov 2023 09:12:56 +0100
Subject: [PATCH] always override stack-protector variables in EFI build
Forwarded: not-needed
These flags require libc support which we do not have in the EFI part.
As distro builders inject the hardening flags into CFLAGS, which is fine
for the userspace part, but for EFI we need to override it.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
Makefile.am | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index bb97df2..3832b51 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -220,7 +220,6 @@ efi_cflags = \
-fshort-wchar \
-ffreestanding \
-fno-strict-aliasing \
- -fno-stack-protector \
-Wsign-compare \
-DGNU_EFI_USE_MS_ABI \
-DGNU_EFI_3_0_COMPAT \
@@ -228,6 +227,12 @@ efi_cflags = \
$(CFLAGS_MGENERAL_REGS_ONLY) \
$(CFLAGS)
+# the stack protectors needs libc support which we don't have in the EFI part
+# distro builders inject the hardening variables into CFLAGS, which is fine
+# for the userspace part, but for EFI we need to override it.
+efi_cflags += \
+ -fno-stack-protector
+
if ARCH_X86_64
efi_cflags += \
-mno-red-zone
--
2.47.0
|