Skip to contentSkip to conversation

kvm test: Fix i386 crossbuild

PATCH New Jan Kiszka 1 participant 1 message Apr 14, 2010 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 kvm test: Fix i386 crossbuild

This fixes "make ARCH=i386" of the KVM micro tests on x86-64 hosts.

---
 kvm/user/config-x86-common.mak |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
kvm/user/config-x86-common.mak +3 -1
index 63cca42..f3172fb 100644
@@ -18,6 +18,8 @@ $(libcflat): CFLAGS += -ffreestanding -I test/lib
 
 CFLAGS += -m$(bits)
 
+libgcc := $(shell $(CC) -m$(bits) --print-libgcc-file-name)
+
 FLATLIBS = test/lib/libcflat.a $(libgcc)
 %.flat: %.o $(FLATLIBS)
 	$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^ $(FLATLIBS)
@@ -32,7 +34,7 @@ test_cases: $(tests-common) $(tests)
 $(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I test/lib -I test/lib/x86
  
 $(TEST_DIR)/bootstrap: $(TEST_DIR)/bootstrap.o
-	$(CC) -nostdlib -o $@ -Wl,-T,bootstrap.lds $^
+	$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,bootstrap.lds $^
  
 $(TEST_DIR)/access.flat: $(cstart.o) $(TEST_DIR)/access.o $(TEST_DIR)/print.o