From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWEAJ-0005h6-1U for qemu-devel@nongnu.org; Wed, 29 Jul 2009 14:46:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWEAD-0005bD-8v for qemu-devel@nongnu.org; Wed, 29 Jul 2009 14:46:14 -0400 Received: from [199.232.76.173] (port=34450 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWEAC-0005as-KP for qemu-devel@nongnu.org; Wed, 29 Jul 2009 14:46:08 -0400 Received: from e2.ny.us.ibm.com ([32.97.182.142]:60217) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWEAA-0003jz-Ic for qemu-devel@nongnu.org; Wed, 29 Jul 2009 14:46:06 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id n6TIeV11010957 for ; Wed, 29 Jul 2009 14:40:31 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n6TIk4kK255250 for ; Wed, 29 Jul 2009 14:46:04 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n6TIk4Ou011785 for ; Wed, 29 Jul 2009 14:46:04 -0400 From: Anthony Liguori Date: Wed, 29 Jul 2009 13:45:56 -0500 Message-Id: <1248893159-18785-4-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1248893159-18785-1-git-send-email-aliguori@us.ibm.com> References: <1248893159-18785-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 4/7] Allow a cross compiler to be used for rom builds List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Avi Kivity , Alex Graf The host tool chain is not enough to build all of the possible roms for qemu. This patch introduces a new option, --i386-cross-prefix, that provides the cross prefix for a toolchain to build i386 roms. This converts multiboot to use that toolchain. If you don't specify a cross prefix, then the host tool chain will be used if the architecture matches. Signed-off-by: Anthony Liguori --- configure | 30 ++++++++++++++++++++++++++---- roms/multiboot/Makefile | 9 ++++----- roms/multiboot/multiboot.S | 2 +- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/configure b/configure index f477aaf..75e5657 100755 --- a/configure +++ b/configure @@ -25,6 +25,7 @@ prefix="" interp_prefix="/usr/gnemul/qemu-%M" static="no" cross_prefix="" +i386_cross_prefix="" cc="gcc" audio_drv_list="" audio_card_list="ac97 es1370 sb16" @@ -43,6 +44,8 @@ for opt do case "$opt" in --cross-prefix=*) cross_prefix="$optarg" ;; + --i386-cross-prefix=*) i386_cross_prefix="$optarg" + ;; --cc=*) cc="$optarg" ;; esac @@ -376,6 +379,8 @@ for opt do ;; --cross-prefix=*) ;; + --i386-cross-prefix=*) + ;; --cc=*) ;; --host-cc=*) host_cc="$optarg" @@ -624,6 +629,7 @@ echo "" echo "Advanced options (experts only):" echo " --source-path=PATH path of source code [$source_path]" echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" +echo " --i386-cross-prefix=P use P for i386 compile tools" echo " --cc=CC use C compiler CC [$cc]" echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." echo " --extra-cflags=CFLAGS append extra C compiler flags CFLAGS" @@ -1739,11 +1745,12 @@ if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then fi echo "TOOLS=$tools" >> $config_host_mak -# Mac OS X ships with a broken assembler roms= -if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ - "$targetos" != "Darwin" ; then - roms="multiboot" +# Mac OS X ships with a broken assembler +if test \( \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ + "$targetos" != "Darwin" \) -o \ + "$i386_cross_prefix" ; then + roms="$roms multiboot" fi echo "ROMS=$roms" >> $config_host_mak @@ -2114,6 +2121,21 @@ for rom in $roms; do mkdir -p pc-bios/$rom rm -f pc-bios/$rom/Makefile ln -s $source_path/roms/$rom/Makefile pc-bios/$rom/Makefile + config_mak="pc-bios/$rom/config.mak" + case "$rom" in + multiboot) + prefix=${i386_cross_prefix} + ;; + esac + echo "# Automatically generated by configure - do not modify" > $config_mak + echo "include ../../config-host.mak" >> $config_mak + echo "include ${source_path}/rules.mak" >> $config_mak + echo "SRC_PATH=${source_path}/roms/$rom" >> $config_mak + echo "TOP_DIR=${source_path}" >> $config_mak + echo "CC=${prefix}${cc}" >> $config_mak + echo "CPP=${prefix}cpp" >> $config_mak + echo "LD=${prefix}${ld}" >> $config_mak + echo "OBJCOPY=${prefix}${objcopy}" >> $config_mak done # build tree in object directory if source path is different from current one diff --git a/roms/multiboot/Makefile b/roms/multiboot/Makefile index c6b5ca4..010feff 100644 --- a/roms/multiboot/Makefile +++ b/roms/multiboot/Makefile @@ -1,12 +1,11 @@ all: build-all -include ../../config-host.mak -include $(SRC_PATH)/rules.mak +include config.mak -VPATH=$(SRC_PATH)/roms/multiboot +VPATH=$(SRC_PATH) CPPFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -CPPFLAGS += -I$(SRC_PATH) +CPPFLAGS += -I$(TOP_DIR) CPPFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"") build-all: multiboot.bin @@ -18,7 +17,7 @@ build-all: multiboot.bin $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@," Building $(TARGET_DIR)$@") %.bin: %.raw - $(call quiet-command,$(SRC_PATH)/roms/multiboot/signrom.sh $< $@," Signing $(TARGET_DIR)$@") + $(call quiet-command,$(SRC_PATH)/signrom.sh $< $@," Signing $(TARGET_DIR)$@") clean: $(RM) *.o *.img *.bin *~ diff --git a/roms/multiboot/multiboot.S b/roms/multiboot/multiboot.S index 93beb51..ba7724b 100644 --- a/roms/multiboot/multiboot.S +++ b/roms/multiboot/multiboot.S @@ -19,7 +19,7 @@ */ #define NO_QEMU_PROTOS -#include "../../hw/fw_cfg.h" +#include "hw/fw_cfg.h" #define BIOS_CFG_IOPORT_CFG 0x510 #define BIOS_CFG_IOPORT_DATA 0x511 -- 1.6.2.5