gnu-efi/modify-cflags.patch

37 lines
1.3 KiB
Diff
Raw Normal View History

2020-03-18 15:39:45 +08:00
diff -Nur gnu-efi-3.0.8.orig/Make.defaults gnu-efi-3.0.8/Make.defaults
2020-03-18 10:01:55 +08:00
--- gnu-efi-3.0.8.orig/Make.defaults 2018-03-15 02:54:51.000000000 +0800
2020-03-18 15:39:45 +08:00
+++ gnu-efi-3.0.8/Make.defaults 2020-03-18 15:33:04.818719470 +0800
@@ -155,6 +155,9 @@
CFLAGS += -marm
endif
2020-03-18 10:01:55 +08:00
2020-03-18 15:39:45 +08:00
+ifeq ($(ARCH),aarch64)
+CFLAGS += -fstack-protector-strong
+endif
# Generic compilation flags
INCDIR += -I$(SRCDIR) -I$(TOPDIR)/inc -I$(TOPDIR)/inc/$(ARCH) \
-I$(TOPDIR)/inc/protocol
@@ -168,16 +171,18 @@
2020-03-18 10:01:55 +08:00
ifeq (FreeBSD, $(findstring FreeBSD, $(OS)))
CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
-fshort-wchar -fno-strict-aliasing \
- -ffreestanding -fno-stack-protector
2020-03-18 15:39:45 +08:00
+ -ffreestanding -fno-stack-protector
2020-03-18 10:01:55 +08:00
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,)
2020-03-18 15:39:45 +08:00
+ifneq ($(ARCH),aarch64)
+CFLAGS += -fno-stack-protector -fno-stack-check
+endif
2020-03-18 10:01:55 +08:00
endif
ARFLAGS := rDv
ASFLAGS += $(ARCH3264)
-LDFLAGS += -nostdlib --warn-common --no-undefined --fatal-warnings \
2020-03-18 15:39:45 +08:00
+LDFLAGS += -nostdlib --warn-common --fatal-warnings \
2020-03-18 10:01:55 +08:00
--build-id=sha1