Commit 1bbaeac3 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

x86: Test if compiler supports -m16

-m16 option is available only since GCC 4.9.0 [1]. That causes a build
failure on centos-7 [2] that has GCC 4.8.5.

Fallback to -m32 if -m16 is not available.


Fixes: 2616ad93

 ("x86: realmode: Workaround clang issues")
Reported-by: default avatarRoman Bolshakov <>
[Commit message by Roman Bolshakov, patch redone. - Paolo]
Signed-off-by: default avatarPaolo Bonzini <>
parent 2616ad93
......@@ -72,7 +72,7 @@ $(TEST_DIR)/realmode.elf: $(TEST_DIR)/realmode.o
$(CC) -m32 -nostdlib -o $@ -Wl,-m,elf_i386 \
-Wl,-T,$(SRCDIR)/$(TEST_DIR)/ $^
$(TEST_DIR)/realmode.o: bits = 16
$(TEST_DIR)/realmode.o: bits = $(if $(call cc-option,-m16,""),16,32)
$(TEST_DIR)/kvmclock_test.elf: $(TEST_DIR)/kvmclock.o
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment