aboutsummaryrefslogtreecommitdiffstats
path: root/mk
diff options
context:
space:
mode:
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