aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.efi
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile.efi')
-rw-r--r--src/Makefile.efi8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Makefile.efi b/src/Makefile.efi
index 151b331..10f3fe7 100644
--- a/src/Makefile.efi
+++ b/src/Makefile.efi
@@ -1,5 +1,13 @@
# -*- makefile -*- : Force emacs to use Makefile mode
+# Enable stack protection if available
+#
+SPG_TEST = $(CC) -fstack-protector-strong -mstack-protector-guard=global \
+ -x c -c /dev/null -o /dev/null >/dev/null 2>&1
+SPG_FLAGS := $(shell $(SPG_TEST) && $(ECHO) '-fstack-protector-strong ' \
+ '-mstack-protector-guard=global')
+CFLAGS += $(SPG_FLAGS)
+
# The EFI linker script
#
LDSCRIPT = scripts/efi.lds