]> xenbits.xensource.com Git - seabios.git/commitdiff
build: use -m16 where available instead of asm(".code16gcc")
authorDavid Woodhouse <dwmw2@infradead.org>
Tue, 3 Jun 2014 16:28:22 +0000 (17:28 +0100)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 5 Jun 2014 14:58:29 +0000 (10:58 -0400)
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@intel.com>
Makefile

index edc8d8d0c6041358fb0bb940fbef088eaec3db5b..d788ffecc4b702274f9e446f01da2f47182ae420 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -61,13 +61,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