qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] build: introduce target CONFIG_ variables and u


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] build: introduce target CONFIG_ variables and use them for kvm
Date: Wed, 20 Jun 2012 16:51:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0

Am 20.06.2012 16:44, schrieb Anthony Liguori:
> This avoids the problem associated with having multiple target specific files
> in a single directory with the current build system.
> 
> We can eventually get rid of the hw/$BASE_ARCH/Makefiles.obj files too
> 
> Signed-off-by: Anthony Liguori <address@hidden>
> ---
> I tried to add a nice comment to the config-target.mak that described how to
> use these macros but that upset the header generation script.
> 
> So I left this out of this patch.
> ---
>  configure             |   30 ++++++++++++++++++++----------
>  hw/Makefile.objs      |    2 ++
>  hw/i386/Makefile.objs |    1 -
>  hw/kvm/Makefile.objs  |    2 +-
>  4 files changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/configure b/configure
> index b68c0ca..f07c464 100755
> --- a/configure
> +++ b/configure
> @@ -3684,19 +3684,29 @@ case "$target_arch2" in
>    ;;
>  esac
>  
> -echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
> -echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
> -echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak
> -echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak
> -echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
> -target_arch_name="`echo $TARGET_ARCH | LC_ALL=C tr '[a-z]' '[A-Z]'`"
> -echo "TARGET_$target_arch_name=y" >> $config_target_mak
> -echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak
> -echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
> +upper() {
> +    echo "$@" | LC_ALL=C tr '[a-z]' '[A-Z]'
> +}
> +
> +target_arch_name="`upper $TARGET_ARCH`"
>  if [ "$TARGET_ABI_DIR" = "" ]; then
>    TARGET_ABI_DIR=$TARGET_ARCH
>  fi
> -echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
> +
> +cat <<EOF >> $config_target_mak
> +TARGET_SHORT_ALIGNMENT=$target_short_alignment
> +TARGET_INT_ALIGNMENT=$target_int_alignment
> +TARGET_LONG_ALIGNMENT=$target_long_alignment
> +TARGET_LLONG_ALIGNMENT=$target_llong_alignment
> +TARGET_ARCH=$TARGET_ARCH
> +TARGET_$target_arch_name=y
> +TARGET_ARCH2=$target_arch2
> +TARGET_BASE_ARCH=$TARGET_BASE_ARCH
> +TARGET_ABI_DIR=$TARGET_ABI_DIR
> +CONFIG_`upper $TARGET_BASE_ARCH`=y
> +CONFIG_`upper $TARGET_ARCH`=y
> +EOF
> +
>  case "$target_arch2" in
>    i386|x86_64)
>      if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
> diff --git a/hw/Makefile.objs b/hw/Makefile.objs
> index 3d77259..cee0e06 100644
> --- a/hw/Makefile.objs
> +++ b/hw/Makefile.objs
> @@ -166,6 +166,8 @@ obj-$(CONFIG_VGA) += vga.o
>  obj-$(CONFIG_SOFTMMU) += device-hotplug.o
>  obj-$(CONFIG_XEN) += xen_domainbuild.o xen_machine_pv.o
>  
> +obj-$(CONFIG_KVM) += kvm/
> +
>  # Inter-VM PCI shared memory
>  ifeq ($(CONFIG_PCI), y)
>  obj-$(CONFIG_KVM) += ivshmem.o
> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> index eb171b7..14738e5 100644
> --- a/hw/i386/Makefile.objs
> +++ b/hw/i386/Makefile.objs
> @@ -7,7 +7,6 @@ obj-y += debugcon.o multiboot.o
>  obj-y += pc_piix.o
>  obj-y += pc_sysfw.o
>  obj-$(CONFIG_XEN) += xen_platform.o xen_apic.o
> -obj-y += kvm/
>  obj-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
>  
>  obj-y := $(addprefix ../,$(obj-y))
> diff --git a/hw/kvm/Makefile.objs b/hw/kvm/Makefile.objs
> index 226497a..cf734ba 100644
> --- a/hw/kvm/Makefile.objs
> +++ b/hw/kvm/Makefile.objs
> @@ -1 +1 @@
> -obj-$(CONFIG_KVM) += clock.o apic.o i8259.o ioapic.o i8254.o
> +obj-$(CONFIG_I386) += clock.o apic.o i8259.o ioapic.o i8254.o

NACK. As long as the CPUState conversion is not completed (which after
part 4 will take some time still) any user of CPUArchState must be
compiled per target, not per base target. It may or may not work
depending on fields accessed, but it is architecturally wrong.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]