[syslinux:firmware] efi: Add -mno-red-zone to CFLAGS

syslinux-bot for Matt Fleming matt.fleming at intel.com
Wed Nov 21 08:18:06 PST 2012

Commit-ID:  94113555e41e68dedce46983b6d2b97d0348f65a
Gitweb:     http://www.syslinux.org/commit/94113555e41e68dedce46983b6d2b97d0348f65a
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Mon, 19 Nov 2012 13:56:12 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Wed, 21 Nov 2012 16:06:16 +0000

efi: Add -mno-red-zone to CFLAGS

The 'red zone' is a 128-byte area at the bottom of the stack frame and
is defined as part of the SysV Application Binary Interface. However,
UEFI firmware uses the Microsoft ABI, rather than the SysV ABI, and
our red zone can become corrupt if we don't turn it off.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

 mk/efi.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mk/efi.mk b/mk/efi.mk
index af25f98..0281795 100644
--- a/mk/efi.mk
+++ b/mk/efi.mk
@@ -38,8 +38,9 @@ CFLAGS = -I$(EFIINC) -I$(EFIINC)/$(EFI_SUBARCH) \
 		-DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \
 		-Wall -I$(com32)/include -I$(com32)/include/sys \
 		-I$(core)/include -I$(core)/ $(CARCHOPT) \
-		-I$(com32)/lib/ -I$(com32)/libutil/include -std=gnu99 -DELF_DEBUG -DSYSLINUX_EFI \
-		$(GCCWARN) -D__COM32__
+		-I$(com32)/lib/ -I$(com32)/libutil/include -std=gnu99 \
+		$(GCCWARN) -D__COM32__ -mno-red-zone
 # gnuefi sometimes installs these under a gnuefi/ directory, and sometimes not
 CRT0 := $(shell find $(LIBDIR) -name crt0-efi-$(EFI_SUBARCH).o 2>/dev/null | tail -n1)

More information about the Syslinux-commits mailing list