Commit 895bb181 authored by Roman Bolshakov's avatar Roman Bolshakov Committed by Paolo Bonzini
Browse files

x86: Makefile: Fix linkage of realmode on x86_64-elf binutils

link spec [1][2] is empty on x86_64-elf-gcc, i.e. -m32 is not propogated
to the linker as "-m elf_i386" and that causes the error:

  /usr/local/opt/x86_64-elf-binutils/bin/x86_64-elf-ld: i386 architecture
  of input file `x86/realmode.o' is incompatible with i386:x86-64 output


Cc: Cameron Esfahani <>
Reviewed-by: default avatarThomas Huth <>
Signed-off-by: default avatarRoman Bolshakov <>
Message-Id: <>
Signed-off-by: default avatarPaolo Bonzini <>
parent 2d331a4d
......@@ -69,7 +69,8 @@ test_cases: $(tests-common) $(tests)
$(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I $(SRCDIR)/lib -I $(SRCDIR)/lib/x86 -I lib
$(TEST_DIR)/realmode.elf: $(TEST_DIR)/realmode.o
$(CC) -m32 -nostdlib -o $@ -Wl,-T,$(SRCDIR)/$(TEST_DIR)/ $^
$(CC) -m32 -nostdlib -o $@ -Wl,-m,elf_i386 \
-Wl,-T,$(SRCDIR)/$(TEST_DIR)/ $^
$(TEST_DIR)/realmode.o: bits = 32
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