configure: enable cross compilation of vof
While container-based cross compilers are not supported, this already makes it possible to build vof on any machine that has an installation of GCC and binutils for 32- or 64-bit PowerPC. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20220517092616.1272238-16-pbonzini@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220527153603.887929-27-alex.bennee@linaro.org>
This commit is contained in:
parent
33ab478742
commit
d695918f7b
|
@ -2213,6 +2213,7 @@ LINKS="Makefile"
|
||||||
LINKS="$LINKS tests/tcg/Makefile.target"
|
LINKS="$LINKS tests/tcg/Makefile.target"
|
||||||
LINKS="$LINKS pc-bios/optionrom/Makefile"
|
LINKS="$LINKS pc-bios/optionrom/Makefile"
|
||||||
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
|
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
|
||||||
|
LINKS="$LINKS pc-bios/vof/Makefile"
|
||||||
LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
|
LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
|
||||||
LINKS="$LINKS tests/avocado tests/data"
|
LINKS="$LINKS tests/avocado tests/data"
|
||||||
LINKS="$LINKS tests/qemu-iotests/check"
|
LINKS="$LINKS tests/qemu-iotests/check"
|
||||||
|
@ -2250,6 +2251,15 @@ if test -n "$target_cc" &&
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
probe_target_compilers ppc ppc64
|
||||||
|
if test -n "$target_cc" && test "$softmmu" = yes; then
|
||||||
|
roms="$roms vof"
|
||||||
|
config_mak=pc-bios/vof/config.mak
|
||||||
|
echo "# Automatically generated by configure - do not modify" > $config_mak
|
||||||
|
echo "SRC_DIR=$source_path/pc-bios/vof" >> $config_mak
|
||||||
|
write_target_makefile >> $config_mak
|
||||||
|
fi
|
||||||
|
|
||||||
# Only build s390-ccw bios if the compiler has -march=z900 or -march=z10
|
# Only build s390-ccw bios if the compiler has -march=z900 or -march=z10
|
||||||
# (which is the lowest architecture level that Clang supports)
|
# (which is the lowest architecture level that Clang supports)
|
||||||
probe_target_compiler s390x
|
probe_target_compiler s390x
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
all: build-all
|
include config.mak
|
||||||
|
VPATH=$(SRC_DIR)
|
||||||
|
all: vof.bin
|
||||||
|
|
||||||
build-all: vof.bin
|
CC ?= $(CROSS)gcc
|
||||||
|
LD ?= $(CROSS)ld
|
||||||
CROSS ?=
|
OBJCOPY ?= $(CROSS)objcopy
|
||||||
CC = $(CROSS)gcc
|
|
||||||
LD = $(CROSS)ld
|
|
||||||
OBJCOPY = $(CROSS)objcopy
|
|
||||||
|
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
$(CC) -m32 -mbig-endian -mcpu=power4 -c -o $@ $<
|
$(CC) -m32 -mbig-endian -mcpu=power4 -c -o $@ $<
|
||||||
|
@ -14,10 +13,12 @@ OBJCOPY = $(CROSS)objcopy
|
||||||
$(CC) -m32 -mbig-endian -mcpu=power4 -c -fno-stack-protector -o $@ $<
|
$(CC) -m32 -mbig-endian -mcpu=power4 -c -fno-stack-protector -o $@ $<
|
||||||
|
|
||||||
vof.elf: entry.o main.o ci.o bootmem.o libc.o
|
vof.elf: entry.o main.o ci.o bootmem.o libc.o
|
||||||
$(LD) -nostdlib -e_start -Tvof.lds -EB -o $@ $^
|
$(LD) -nostdlib -e_start -T$(SRC_DIR)/vof.lds -EB -o $@ $^
|
||||||
|
|
||||||
%.bin: %.elf
|
%.bin: %.elf
|
||||||
$(OBJCOPY) -O binary -j .text -j .data -j .toc -j .got2 $^ $@
|
$(OBJCOPY) -O binary -j .text -j .data -j .toc -j .got2 $^ $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o vof.bin vof.elf *~
|
rm -f *.o vof.bin vof.elf *~
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
Loading…
Reference in New Issue