aboutsummaryrefslogtreecommitdiffstats
path: root/mk
diff options
context:
space:
mode:
authorSylvain Gault <sylvain.gault@gmail.com>2015-11-27 22:41:07 +0100
committerSylvain Gault <sylvain.gault@gmail.com>2015-11-27 23:11:45 +0100
commit7d70885d22e4474407637026c1af12a253281407 (patch)
tree3ca2b5beddae9960d5554408d337e68ffda0663f /mk
parent2d14923c02aa343f650a5bee128e9ea383a0ed59 (diff)
downloadsyslinux-7d70885d22e4474407637026c1af12a253281407.tar.gz
syslinux-7d70885d22e4474407637026c1af12a253281407.tar.xz
syslinux-7d70885d22e4474407637026c1af12a253281407.zip
Makefile: Always use -mno-red-zone for EFI
This option is mandatory when compiling for EFI as some event handlers may interupt the running code and use the space just above the reserved stack space. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
Diffstat (limited to 'mk')
-rw-r--r--mk/com32.mk4
-rw-r--r--mk/elf.mk6
-rw-r--r--mk/embedded.mk5
-rw-r--r--mk/lib.mk4
4 files changed, 12 insertions, 7 deletions
diff --git a/mk/com32.mk b/mk/com32.mk
index 90eb7edd..2e8591a7 100644
--- a/mk/com32.mk
+++ b/mk/com32.mk
@@ -48,7 +48,9 @@ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
-ifndef EFI_BUILD
+ifdef EFI_BUILD
+GCCOPT += -mno-red-zone
+else
GCCOPT += -mregparm=3 -DREGPARM=3
endif
diff --git a/mk/elf.mk b/mk/elf.mk
index 12d10778..54fd4ce2 100644
--- a/mk/elf.mk
+++ b/mk/elf.mk
@@ -60,8 +60,10 @@ CFLAGS = $(GCCOPT) $(GCCWARN) -W -Wall \
-I$(com32)/libutil/include -I$(com32)/include \
-I$(com32)/include/sys $(GPLINCLUDE) -I$(core)/include \
-I$(objdir) -DLDLINUX=\"$(LDLINUX)\"
-ifndef EFI_BUILD
-CFLAGS += -mregparm=3 -DREGPARM=3
+ifdef EFI_BUILD
+GCCOPT += -mno-red-zone
+else
+GCCOPT += -mregparm=3 -DREGPARM=3
endif
SFLAGS = $(GCCOPT) -D__COM32__ -D__FIRMWARE_$(FIRMWARE)__
diff --git a/mk/embedded.mk b/mk/embedded.mk
index 1614d8bc..df8e85f3 100644
--- a/mk/embedded.mk
+++ b/mk/embedded.mk
@@ -39,10 +39,9 @@ GCCOPT += $(call gcc_ok,-fno-stack-protector,)
GCCOPT += $(call gcc_ok,-fwrapv,)
GCCOPT += $(call gcc_ok,-freg-struct-return,)
ifdef EFI_BUILD
-GCCOPT += -Os -fomit-frame-pointer -msoft-float
+GCCOPT += -Os -fomit-frame-pointer -msoft-float -mno-red-zone
else
-GCCOPT += -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 \
- -msoft-float
+GCCOPT += -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 -msoft-float
endif
GCCOPT += $(call gcc_ok,-fno-exceptions,)
GCCOPT += $(call gcc_ok,-fno-asynchronous-unwind-tables,)
diff --git a/mk/lib.mk b/mk/lib.mk
index ceb95bd0..7a48756c 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -54,7 +54,9 @@ WARNFLAGS = $(GCCWARN) -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winl
CFLAGS = $(OPTFLAGS) $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS)
-ifndef EFI_BUILD
+ifdef EFI_BUILD
+CFLAGS += -mno-red-zone
+else
CFLAGS += -mregparm=3 -DREGPARM=3
endif