aboutsummaryrefslogtreecommitdiffstats
path: root/mk/elf.mk
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-06-19 10:44:11 +0100
committerMatt Fleming <matt.fleming@intel.com>2013-06-19 10:44:11 +0100
commitdb25b06af0a4be7231a120d53b24cc01e17ed315 (patch)
treeaabf1b5d2702c5e5bcd407a0aff17ff90ef33253 /mk/elf.mk
parenta0bb1928c8652aada30243089c53754ddd9b99df (diff)
downloadsyslinux-db25b06af0a4be7231a120d53b24cc01e17ed315.tar.gz
syslinux-db25b06af0a4be7231a120d53b24cc01e17ed315.tar.xz
syslinux-db25b06af0a4be7231a120d53b24cc01e17ed315.zip
mk: reinstate -mregparm for BIOS
There's still a bunch of assembly code that assumes we're building our C objects with -mregparm=3. For example, the code to transition from 16-bit real-mode mode to 32-bit protected mode assumes this. Violating this assumption leads to various hangs, caused by garbage function arguments. Put back -mregparm into CFLAGS that was removed in commit 8789d2689564 ("mk/embedded.mk: Don't use -mregparm in core"). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'mk/elf.mk')
-rw-r--r--mk/elf.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/mk/elf.mk b/mk/elf.mk
index faca4e1a..8f2421a8 100644
--- a/mk/elf.mk
+++ b/mk/elf.mk
@@ -60,6 +60,10 @@ CFLAGS = $(GCCOPT) -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
+endif
+
SFLAGS = $(GCCOPT) -D__COM32__
LDFLAGS = -m elf_$(ARCH) -shared --hash-style=gnu -T $(com32)/lib/$(ARCH)/elf.ld --as-needed
LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)