[SeaBIOS] [PATCH 1/4] build: use -m16 where available instead of asm(".code16gcc")

David Woodhouse dwmw2 at infradead.org
Tue Jun 3 18:28:22 CEST 2014


GCC 4.9 and clang 3.5 support the -m16 option on the command line which
supersedes the hackish ".code16gcc" assembler directive. Use it where
possible.

Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 78b598e..4c42124 100644
--- a/Makefile
+++ b/Makefile
@@ -62,13 +62,15 @@ COMMONCFLAGS := -I$(OUT) -Isrc -Os -MD -g \
 COMMONCFLAGS += $(call cc-option,$(CC),-nopie,)
 COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
 COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
+COMMA := ,
 
 CFLAGS32FLAT := $(COMMONCFLAGS) -DMODE16=0 -DMODESEGMENT=0 -fomit-frame-pointer
 CFLAGSSEG := $(COMMONCFLAGS) -DMODESEGMENT=1 -fno-defer-pop \
     $(call cc-option,$(CC),-fno-jump-tables,-DMANUAL_NO_JUMP_TABLE) \
     $(call cc-option,$(CC),-fno-tree-switch-conversion,)
 CFLAGS32SEG := $(CFLAGSSEG) -DMODE16=0 -fomit-frame-pointer
-CFLAGS16INC := $(CFLAGSSEG) -DMODE16=1 -Wa,src/code16gcc.s \
+CFLAGS16INC := $(CFLAGSSEG) -DMODE16=1 \
+    $(call cc-option,$(CC),-m16,-Wa$(COMMA)src/code16gcc.s) \
     $(call cc-option,$(CC),--param large-stack-frame=4,-fno-inline)
 CFLAGS16 := $(CFLAGS16INC) -fomit-frame-pointer
 
-- 
1.9.3


-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://www.seabios.org/pipermail/seabios/attachments/20140603/b97f0d64/attachment.bin>


More information about the SeaBIOS mailing list