All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more
@ 2013-01-19 10:06 Paolo Bonzini
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 1/4] build: move around libcacard-y definition Paolo Bonzini
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Paolo Bonzini @ 2013-01-19 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, afaerber

This small series makes some more simplifications to Makefile.objs,
removing two more variables: universal-obj-y and extra-obj-y, all
unified into common-obj-y.  It also removes what remains of user-obj-y,
unifying that into common-obj-y as well.

To achieve this, the CONFIG_SOFTMMU and CONFIG_USER_ONLY symbols are
defined in the toplevel Makefile like we do with devices and disassemblers.
Another symbol, CONFIG_ALL, is defined only in the toplevel Makefile
and takes the place of extra-obj-y.

With this change the structure of Makefile.objs is finally reduced to only
six recursive variables (stub-obj-y, util-obj-y, qga-obj-y, block-obj-y,
common-obj-y, obj-y).  More important, the simpler structure should help
people modifying the build system, avoiding future proliferation of
variables as well.

The patches are mostly mechanical substitutions, and there is no
user-visible change---neither in total build time, nor in the files that
are linked into the executables.

Please apply, thanks!

Paolo


Paolo Bonzini (4):
  build: move around libcacard-y definition
  build: use -$(CONFIG_SECCOMP) instead of ifeq
  build: remove universal-obj-y
  build: remove extra-obj-y

 Makefile             |    9 ++++-----
 Makefile.objs        |   43 ++++++++++++++++++-------------------------
 Makefile.target      |    3 +--
 disas/Makefile.objs  |   30 +++++++++++++++---------------
 fsdev/Makefile.objs  |    8 ++++----
 hw/Makefile.objs     |   10 +++++-----
 hw/pci/Makefile.objs |    2 +-
 qom/Makefile.objs    |    4 ++--
 8 files changed, 50 insertions(+), 59 deletions(-)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 1/4] build: move around libcacard-y definition
  2013-01-19 10:06 [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Paolo Bonzini
@ 2013-01-19 10:06 ` Paolo Bonzini
  2013-01-19 18:05   ` Andreas Färber
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 2/4] build: use -$(CONFIG_SECCOMP) instead of ifeq Paolo Bonzini
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Paolo Bonzini @ 2013-01-19 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, afaerber

It is also needed if !CONFIG_SOFTMMU, unlike everything that surrounds it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile.objs |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index d465a72..3548f9b 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -34,6 +34,15 @@ CONFIG_REALLY_VIRTFS=y
 endif
 
 ######################################################################
+# smartcard
+
+libcacard-y += libcacard/cac.o libcacard/event.o
+libcacard-y += libcacard/vcard.o libcacard/vreader.o
+libcacard-y += libcacard/vcard_emul_nss.o
+libcacard-y += libcacard/vcard_emul_type.o
+libcacard-y += libcacard/card_7816.o
+
+######################################################################
 # Target independent part of system emulation. The long term path is to
 # suppress *all* target specific code in case of system emulation, i.e. a
 # single QEMU executable should support all CPUs and machines.
@@ -77,15 +86,6 @@ ifeq ($(CONFIG_SECCOMP),y)
 common-obj-y += qemu-seccomp.o
 endif
 
-######################################################################
-# smartcard
-
-libcacard-y += libcacard/cac.o libcacard/event.o
-libcacard-y += libcacard/vcard.o libcacard/vreader.o
-libcacard-y += libcacard/vcard_emul_nss.o
-libcacard-y += libcacard/vcard_emul_type.o
-libcacard-y += libcacard/card_7816.o
-
 common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
 
 ######################################################################
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 2/4] build: use -$(CONFIG_SECCOMP) instead of ifeq
  2013-01-19 10:06 [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Paolo Bonzini
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 1/4] build: move around libcacard-y definition Paolo Bonzini
@ 2013-01-19 10:06 ` Paolo Bonzini
  2013-01-19 18:06   ` Andreas Färber
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 3/4] build: remove universal-obj-y Paolo Bonzini
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Paolo Bonzini @ 2013-01-19 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, afaerber

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile.objs |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 3548f9b..3bdb248 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -80,11 +80,7 @@ common-obj-$(CONFIG_SLIRP) += slirp/
 
 common-obj-y += backends/
 
-######################################################################
-# libseccomp
-ifeq ($(CONFIG_SECCOMP),y)
-common-obj-y += qemu-seccomp.o
-endif
+common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
 
 common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 3/4] build: remove universal-obj-y
  2013-01-19 10:06 [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Paolo Bonzini
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 1/4] build: move around libcacard-y definition Paolo Bonzini
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 2/4] build: use -$(CONFIG_SECCOMP) instead of ifeq Paolo Bonzini
@ 2013-01-19 10:06 ` Paolo Bonzini
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 4/4] build: remove extra-obj-y Paolo Bonzini
  2013-01-19 18:11 ` [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Andreas Färber
  4 siblings, 0 replies; 14+ messages in thread
From: Paolo Bonzini @ 2013-01-19 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, afaerber

All of universal-obj-y, user-obj-y (right now unused) and common-obj-y can
be unified into common-obj-y if we take care of defining CONFIG_SOFTMMU
and CONFIG_USER_ONLY in the toplevel makefile.  This is similar to how
we define symbols for hardware components.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile            |    8 +++-----
 Makefile.objs       |   14 +++++++-------
 Makefile.target     |    3 +--
 disas/Makefile.objs |   30 +++++++++++++++---------------
 hw/Makefile.objs    |    8 +++++---
 qom/Makefile.objs   |    4 ++--
 6 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/Makefile b/Makefile
index 73adf42..55b5d36 100644
--- a/Makefile
+++ b/Makefile
@@ -103,6 +103,8 @@ defconfig:
 
 -include config-all-devices.mak
 -include config-all-disas.mak
+CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
+CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
 
 ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/Makefile.objs
@@ -133,11 +135,7 @@ pixman/Makefile: $(SRC_PATH)/pixman/configure
 $(SRC_PATH)/pixman/configure:
 	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
 
-$(SUBDIR_RULES): libqemuutil.a libqemustub.a
-
-$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(common-obj-y) $(extra-obj-y)
-
-$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(user-obj-y)
+$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(extra-obj-y)
 
 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
 romsubdir-%:
diff --git a/Makefile.objs b/Makefile.objs
index 3bdb248..63ddaaf 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -47,6 +47,7 @@ libcacard-y += libcacard/card_7816.o
 # suppress *all* target specific code in case of system emulation, i.e. a
 # single QEMU executable should support all CPUs and machines.
 
+ifeq ($(CONFIG_SOFTMMU),y)
 common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/
 common-obj-y += net/
 common-obj-y += readline.o
@@ -89,15 +90,15 @@ common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
 
 common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o
 common-obj-y += qmp.o hmp.o
+endif
 
 #######################################################################
 # Target-independent parts used in system and user emulation
-universal-obj-y =
-universal-obj-y += qemu-log.o
-universal-obj-y += tcg-runtime.o
-universal-obj-y += hw/
-universal-obj-y += qom/
-universal-obj-y += disas/
+common-obj-y += qemu-log.o
+common-obj-y += tcg-runtime.o
+common-obj-y += hw/
+common-obj-y += qom/
+common-obj-y += disas/
 
 ######################################################################
 # guest agent
@@ -118,6 +119,5 @@ nested-vars += \
 	qga-obj-y \
 	block-obj-y \
 	common-obj-y \
-	universal-obj-y \
 	extra-obj-y
 dummy := $(call unnest-vars)
diff --git a/Makefile.target b/Makefile.target
index eb84b1f..760da1e 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -145,8 +145,7 @@ nested-vars += obj-y
 include $(SRC_PATH)/Makefile.objs
 
 all-obj-y = $(obj-y)
-all-obj-y += $(addprefix ../, $(universal-obj-y))
-all-obj-$(CONFIG_SOFTMMU) += $(addprefix ../, $(common-obj-y))
+all-obj-y += $(addprefix ../, $(common-obj-y))
 
 ifdef QEMU_PROGW
 # The linker builds a windows executable. Make also a console executable.
diff --git a/disas/Makefile.objs b/disas/Makefile.objs
index 3f5c5b9..ed75f9a 100644
--- a/disas/Makefile.objs
+++ b/disas/Makefile.objs
@@ -1,18 +1,18 @@
-universal-obj-$(CONFIG_ALPHA_DIS) += alpha.o
-universal-obj-$(CONFIG_ARM_DIS) += arm.o
-universal-obj-$(CONFIG_CRIS_DIS) += cris.o
-universal-obj-$(CONFIG_HPPA_DIS) += hppa.o
-universal-obj-$(CONFIG_I386_DIS) += i386.o
-universal-obj-$(CONFIG_IA64_DIS) += ia64.o
-universal-obj-$(CONFIG_M68K_DIS) += m68k.o
-universal-obj-$(CONFIG_MICROBLAZE_DIS) += microblaze.o
-universal-obj-$(CONFIG_MIPS_DIS) += mips.o
-universal-obj-$(CONFIG_PPC_DIS) += ppc.o
-universal-obj-$(CONFIG_S390_DIS) += s390.o
-universal-obj-$(CONFIG_SH4_DIS) += sh4.o
-universal-obj-$(CONFIG_SPARC_DIS) += sparc.o
-universal-obj-$(CONFIG_LM32_DIS) += lm32.o
+common-obj-$(CONFIG_ALPHA_DIS) += alpha.o
+common-obj-$(CONFIG_ARM_DIS) += arm.o
+common-obj-$(CONFIG_CRIS_DIS) += cris.o
+common-obj-$(CONFIG_HPPA_DIS) += hppa.o
+common-obj-$(CONFIG_I386_DIS) += i386.o
+common-obj-$(CONFIG_IA64_DIS) += ia64.o
+common-obj-$(CONFIG_M68K_DIS) += m68k.o
+common-obj-$(CONFIG_MICROBLAZE_DIS) += microblaze.o
+common-obj-$(CONFIG_MIPS_DIS) += mips.o
+common-obj-$(CONFIG_PPC_DIS) += ppc.o
+common-obj-$(CONFIG_S390_DIS) += s390.o
+common-obj-$(CONFIG_SH4_DIS) += sh4.o
+common-obj-$(CONFIG_SPARC_DIS) += sparc.o
+common-obj-$(CONFIG_LM32_DIS) += lm32.o
 
 # TODO: As long as the TCG interpreter and its generated code depend
 # on the QEMU target, we cannot compile the disassembler here.
-#universal-obj-$(CONFIG_TCI_DIS) += tci.o
+#common-obj-$(CONFIG_TCI_DIS) += tci.o
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 74b07a7..0e245c8 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -1,9 +1,10 @@
 # core qdev-related obj files, also used by *-user:
-universal-obj-y += qdev.o qdev-properties.o
+common-obj-y += qdev.o qdev-properties.o
 # irq.o needed for qdev GPIO handling:
-universal-obj-y += irq.o
+common-obj-y += irq.o
 
-common-obj-y = usb/ ide/ pci/
+ifeq ($(CONFIG_SOFTMMU),y)
+common-obj-y += usb/ ide/ pci/
 common-obj-y += loader.o
 common-obj-$(CONFIG_VIRTIO) += virtio-console.o
 common-obj-$(CONFIG_VIRTIO) += virtio-rng.o
@@ -216,3 +217,4 @@ obj-$(CONFIG_LINUX) += vfio_pci.o
 endif
 
 $(obj)/baum.o: QEMU_CFLAGS += $(SDL_CFLAGS) 
+endif
diff --git a/qom/Makefile.objs b/qom/Makefile.objs
index 1899a4c..6a93ac7 100644
--- a/qom/Makefile.objs
+++ b/qom/Makefile.objs
@@ -1,2 +1,2 @@
-universal-obj-y = object.o container.o qom-qobject.o
-universal-obj-y += cpu.o
+common-obj-y = object.o container.o qom-qobject.o
+common-obj-y += cpu.o
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 4/4] build: remove extra-obj-y
  2013-01-19 10:06 [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Paolo Bonzini
                   ` (2 preceding siblings ...)
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 3/4] build: remove universal-obj-y Paolo Bonzini
@ 2013-01-19 10:06 ` Paolo Bonzini
  2013-01-19 18:11 ` [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Andreas Färber
  4 siblings, 0 replies; 14+ messages in thread
From: Paolo Bonzini @ 2013-01-19 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, afaerber

extra-obj-y is somewhat complicated to understand.  Replace it with a
special CONFIG_ALL symbol that is defined only at toplevel.
This limits the case of directories defining more than one
*-obj-y target.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile             |    3 ++-
 Makefile.objs        |    5 +----
 fsdev/Makefile.objs  |    8 ++++----
 hw/Makefile.objs     |    2 --
 hw/pci/Makefile.objs |    2 +-
 5 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index 55b5d36..bd885ca 100644
--- a/Makefile
+++ b/Makefile
@@ -105,6 +105,7 @@ defconfig:
 -include config-all-disas.mak
 CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
 CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
+CONFIG_ALL=y
 
 ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/Makefile.objs
@@ -135,7 +136,7 @@ pixman/Makefile: $(SRC_PATH)/pixman/configure
 $(SRC_PATH)/pixman/configure:
 	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
 
-$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(extra-obj-y)
+$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
 
 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
 romsubdir-%:
diff --git a/Makefile.objs b/Makefile.objs
index 63ddaaf..68eb0ce 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -55,7 +55,6 @@ common-obj-$(CONFIG_WIN32) += os-win32.o
 common-obj-$(CONFIG_POSIX) += os-posix.o
 
 common-obj-$(CONFIG_LINUX) += fsdev/
-extra-obj-$(CONFIG_LINUX) += fsdev/
 
 common-obj-y += migration.o migration-tcp.o
 common-obj-y += qemu-char.o #aio.o
@@ -68,7 +67,6 @@ common-obj-$(CONFIG_SPICE) += spice-qemu-char.o
 
 common-obj-y += audio/
 common-obj-y += hw/
-extra-obj-y += hw/
 
 common-obj-y += ui/
 common-obj-y += bt-host.o bt-vhci.o
@@ -118,6 +116,5 @@ nested-vars += \
 	util-obj-y \
 	qga-obj-y \
 	block-obj-y \
-	common-obj-y \
-	extra-obj-y
+	common-obj-y
 dummy := $(call unnest-vars)
diff --git a/fsdev/Makefile.objs b/fsdev/Makefile.objs
index ee16ca6..206289c 100644
--- a/fsdev/Makefile.objs
+++ b/fsdev/Makefile.objs
@@ -1,10 +1,10 @@
 ifeq ($(CONFIG_REALLY_VIRTFS),y)
 common-obj-y = qemu-fsdev.o virtio-9p-marshal.o
-
-# Toplevel always builds this; targets without virtio will put it in
-# common-obj-y
-extra-obj-y = qemu-fsdev-dummy.o
 else
 common-obj-y = qemu-fsdev-dummy.o
 endif
 common-obj-y += qemu-fsdev-opts.o
+
+# Toplevel always builds this; targets without virtio will put it in
+# common-obj-y
+common-obj-$(CONFIG_ALL) += qemu-fsdev-dummy.o
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 0e245c8..c02c856 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -43,8 +43,6 @@ common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
 common-obj-y += fifo.o
 common-obj-y += pam.o
 
-extra-obj-y += pci/
-
 # PPC devices
 common-obj-$(CONFIG_PREP_PCI) += prep_pci.o
 common-obj-$(CONFIG_I82378) += i82378.o
diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
index fe965fe..1cd6cde 100644
--- a/hw/pci/Makefile.objs
+++ b/hw/pci/Makefile.objs
@@ -6,4 +6,4 @@ common-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
 common-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
 common-obj-$(CONFIG_NO_PCI) += pci-stub.o
 
-extra-obj-y += pci-stub.o
+common-obj-$(CONFIG_ALL) += pci-stub.o
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH 1/4] build: move around libcacard-y definition
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 1/4] build: move around libcacard-y definition Paolo Bonzini
@ 2013-01-19 18:05   ` Andreas Färber
  2013-01-19 22:01     ` Paolo Bonzini
  0 siblings, 1 reply; 14+ messages in thread
From: Andreas Färber @ 2013-01-19 18:05 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: blauwirbel, qemu-devel

Am 19.01.2013 11:06, schrieb Paolo Bonzini:
> It is also needed if !CONFIG_SOFTMMU, unlike everything that surrounds it.

Why? linux-user should not depend on it - bad wording only?

Andreas

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  Makefile.objs |   18 +++++++++---------
>  1 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/Makefile.objs b/Makefile.objs
> index d465a72..3548f9b 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -34,6 +34,15 @@ CONFIG_REALLY_VIRTFS=y
>  endif
>  
>  ######################################################################
> +# smartcard
> +
> +libcacard-y += libcacard/cac.o libcacard/event.o
> +libcacard-y += libcacard/vcard.o libcacard/vreader.o
> +libcacard-y += libcacard/vcard_emul_nss.o
> +libcacard-y += libcacard/vcard_emul_type.o
> +libcacard-y += libcacard/card_7816.o
> +
> +######################################################################
>  # Target independent part of system emulation. The long term path is to
>  # suppress *all* target specific code in case of system emulation, i.e. a
>  # single QEMU executable should support all CPUs and machines.
> @@ -77,15 +86,6 @@ ifeq ($(CONFIG_SECCOMP),y)
>  common-obj-y += qemu-seccomp.o
>  endif
>  
> -######################################################################
> -# smartcard
> -
> -libcacard-y += libcacard/cac.o libcacard/event.o
> -libcacard-y += libcacard/vcard.o libcacard/vreader.o
> -libcacard-y += libcacard/vcard_emul_nss.o
> -libcacard-y += libcacard/vcard_emul_type.o
> -libcacard-y += libcacard/card_7816.o
> -
>  common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
>  
>  ######################################################################
> 


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH 2/4] build: use -$(CONFIG_SECCOMP) instead of ifeq
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 2/4] build: use -$(CONFIG_SECCOMP) instead of ifeq Paolo Bonzini
@ 2013-01-19 18:06   ` Andreas Färber
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Färber @ 2013-01-19 18:06 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: blauwirbel, qemu-devel

Am 19.01.2013 11:06, schrieb Paolo Bonzini:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Acked-by: Andreas Färber <afaerber@suse.de>

Andreas

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more
  2013-01-19 10:06 [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Paolo Bonzini
                   ` (3 preceding siblings ...)
  2013-01-19 10:06 ` [Qemu-devel] [PATCH 4/4] build: remove extra-obj-y Paolo Bonzini
@ 2013-01-19 18:11 ` Andreas Färber
  2013-01-19 22:06   ` Paolo Bonzini
  4 siblings, 1 reply; 14+ messages in thread
From: Andreas Färber @ 2013-01-19 18:11 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: blauwirbel, qemu-devel

Am 19.01.2013 11:06, schrieb Paolo Bonzini:
> This small series makes some more simplifications to Makefile.objs,
> removing two more variables: universal-obj-y and extra-obj-y, all
> unified into common-obj-y.  It also removes what remains of user-obj-y,
> unifying that into common-obj-y as well.
> 
> To achieve this, the CONFIG_SOFTMMU and CONFIG_USER_ONLY symbols are
> defined in the toplevel Makefile like we do with devices and disassemblers.
> Another symbol, CONFIG_ALL, is defined only in the toplevel Makefile
> and takes the place of extra-obj-y.
> 
> With this change the structure of Makefile.objs is finally reduced to only
> six recursive variables (stub-obj-y, util-obj-y, qga-obj-y, block-obj-y,
> common-obj-y, obj-y).  More important, the simpler structure should help
> people modifying the build system, avoiding future proliferation of
> variables as well.
> 
> The patches are mostly mechanical substitutions, and there is no
> user-visible change---neither in total build time, nor in the files that
> are linked into the executables.

Without having tested this yet I want to remind that it is necessary for
qom/cpu.c to be built twice, to not run into similar issues like
util/oslib-posix.c.

Andreas

> 
> Please apply, thanks!
> 
> Paolo
> 
> 
> Paolo Bonzini (4):
>   build: move around libcacard-y definition
>   build: use -$(CONFIG_SECCOMP) instead of ifeq
>   build: remove universal-obj-y
>   build: remove extra-obj-y
> 
>  Makefile             |    9 ++++-----
>  Makefile.objs        |   43 ++++++++++++++++++-------------------------
>  Makefile.target      |    3 +--
>  disas/Makefile.objs  |   30 +++++++++++++++---------------
>  fsdev/Makefile.objs  |    8 ++++----
>  hw/Makefile.objs     |   10 +++++-----
>  hw/pci/Makefile.objs |    2 +-
>  qom/Makefile.objs    |    4 ++--
>  8 files changed, 50 insertions(+), 59 deletions(-)
> 


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH 1/4] build: move around libcacard-y definition
  2013-01-19 18:05   ` Andreas Färber
@ 2013-01-19 22:01     ` Paolo Bonzini
  2013-01-19 23:26       ` Andreas Färber
  0 siblings, 1 reply; 14+ messages in thread
From: Paolo Bonzini @ 2013-01-19 22:01 UTC (permalink / raw)
  To: Andreas Färber; +Cc: blauwirbel, qemu-devel

Il 19/01/2013 19:05, Andreas Färber ha scritto:
> Am 19.01.2013 11:06, schrieb Paolo Bonzini:
>> > It is also needed if !CONFIG_SOFTMMU, unlike everything that surrounds it.
> Why? linux-user should not depend on it - bad wording only?

It is needed by libcacard/Makefile.  You can build it even if you do not
configure any softmmu target.

Paolo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more
  2013-01-19 18:11 ` [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Andreas Färber
@ 2013-01-19 22:06   ` Paolo Bonzini
  2013-01-19 22:07     ` Paolo Bonzini
  2013-01-19 23:22     ` Andreas Färber
  0 siblings, 2 replies; 14+ messages in thread
From: Paolo Bonzini @ 2013-01-19 22:06 UTC (permalink / raw)
  To: Andreas Färber; +Cc: blauwirbel, qemu-devel

Il 19/01/2013 19:11, Andreas Färber ha scritto:
>> > The patches are mostly mechanical substitutions, and there is no
>> > user-visible change---neither in total build time, nor in the files that
>> > are linked into the executables.
> Without having tested this yet I want to remind that it is necessary for
> qom/cpu.c to be built twice

Hmm, it's not anymore actually (since libuser was removed).  It hasn't
been built twice for a month and apparently nothing broke.

> , to not run into similar issues like
> util/oslib-posix.c.

The only dependency is

#if !defined(CONFIG_USER_ONLY)
    int kvm_fd;
    bool kvm_vcpu_dirty;
#endif
    struct KVMState *kvm_state;
    struct kvm_run *kvm_run;

Plenty of other fields are meaningless for !CONFIG_USER_ONLY but are
unconditionally present in struct CPUState.  Given this inconsistency,
why is it still useful to build it twice?

Paolo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more
  2013-01-19 22:06   ` Paolo Bonzini
@ 2013-01-19 22:07     ` Paolo Bonzini
  2013-01-19 23:22     ` Andreas Färber
  1 sibling, 0 replies; 14+ messages in thread
From: Paolo Bonzini @ 2013-01-19 22:07 UTC (permalink / raw)
  Cc: blauwirbel, Andreas Färber, qemu-devel

Il 19/01/2013 23:06, Paolo Bonzini ha scritto:
> The only dependency is
> 
> #if !defined(CONFIG_USER_ONLY)
>     int kvm_fd;
>     bool kvm_vcpu_dirty;
> #endif
>     struct KVMState *kvm_state;
>     struct kvm_run *kvm_run;
> 
> Plenty of other fields are meaningless for !CONFIG_USER_ONLY but are
> unconditionally present in struct CPUState.

Sorry, plenty of other fields are meaningless for CONFIG_USER_ONLY.

Paolo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more
  2013-01-19 22:06   ` Paolo Bonzini
  2013-01-19 22:07     ` Paolo Bonzini
@ 2013-01-19 23:22     ` Andreas Färber
  2013-01-20  9:06       ` Paolo Bonzini
  1 sibling, 1 reply; 14+ messages in thread
From: Andreas Färber @ 2013-01-19 23:22 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: blauwirbel, qemu-devel, Anthony Liguori, Eduardo Habkost

Am 19.01.2013 23:06, schrieb Paolo Bonzini:
> Il 19/01/2013 19:11, Andreas Färber ha scritto:
>>>> The patches are mostly mechanical substitutions, and there is no
>>>> user-visible change---neither in total build time, nor in the files that
>>>> are linked into the executables.
>> Without having tested this yet I want to remind that it is necessary for
>> qom/cpu.c to be built twice
> 
> Hmm, it's not anymore actually (since libuser was removed).  It hasn't
> been built twice for a month and apparently nothing broke.

I surely didn't ack that. Have you actually tested linux-user to verify
it works? It might lead to unexpected CPUState field accesses.

>> , to not run into similar issues like
>> util/oslib-posix.c.
> 
> The only dependency is
> 
> #if !defined(CONFIG_USER_ONLY)
>     int kvm_fd;
>     bool kvm_vcpu_dirty;
> #endif
>     struct KVMState *kvm_state;
>     struct kvm_run *kvm_run;
> 
> Plenty of other fields are meaningless for !CONFIG_USER_ONLY but are
> unconditionally present in struct CPUState.  Given this inconsistency,
> why is it still useful to build it twice?

You are judging based on master. I have some more code movements queued
(qom-cpu-8) and I believe it was Anthony who insisted on suppressing
those unneeded user-only fields even if they were unconditional in
CPU_COMMON before.

qom/cpu.c is not intended to remain so small forever - any cpu_* code
that does not depend on CPUArchState can find a new home there.
cpu_interrupt() is being moved to qom/cpu.h and cpu_reset_interrupt() to
qom/cpu.c for instance. And I'm working on refactoring CPU VMState, that
either requires #ifdef'ery or lots of new stubs beyond what Eduardo added.

Andreas

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH 1/4] build: move around libcacard-y definition
  2013-01-19 22:01     ` Paolo Bonzini
@ 2013-01-19 23:26       ` Andreas Färber
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Färber @ 2013-01-19 23:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: blauwirbel, qemu-devel

Am 19.01.2013 23:01, schrieb Paolo Bonzini:
> Il 19/01/2013 19:05, Andreas Färber ha scritto:
>> Am 19.01.2013 11:06, schrieb Paolo Bonzini:
>>>> It is also needed if !CONFIG_SOFTMMU, unlike everything that surrounds it.
>> Why? linux-user should not depend on it - bad wording only?
> 
> It is needed by libcacard/Makefile.  You can build it even if you do not
> configure any softmmu target.

Suggest wording: "It is also valid to build libcacard if
!CONFIG_SOFTMMU, unlike everything that surrounds it." or so
(avoids "also *needed* if !CONFIG_SOFTMMU" which wrongly suggested to me
!CONFIG_SOFTMMU == CONFIG_USER_ONLY)

Andreas

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more
  2013-01-19 23:22     ` Andreas Färber
@ 2013-01-20  9:06       ` Paolo Bonzini
  0 siblings, 0 replies; 14+ messages in thread
From: Paolo Bonzini @ 2013-01-20  9:06 UTC (permalink / raw)
  To: Andreas Färber
  Cc: blauwirbel, qemu-devel, Anthony Liguori, Eduardo Habkost

Il 20/01/2013 00:22, Andreas Färber ha scritto:
> Am 19.01.2013 23:06, schrieb Paolo Bonzini:
>> Il 19/01/2013 19:11, Andreas Färber ha scritto:
>>>>> The patches are mostly mechanical substitutions, and there is no
>>>>> user-visible change---neither in total build time, nor in the files that
>>>>> are linked into the executables.
>>> Without having tested this yet I want to remind that it is necessary for
>>> qom/cpu.c to be built twice
>>
>> Hmm, it's not anymore actually (since libuser was removed).  It hasn't
>> been built twice for a month and apparently nothing broke.
> 
> I surely didn't ack that.

At the time I did the move, there was no conditional CPUState field
(commit 8e98e2e80b92e08e79e27a0c20a172906cfa12d2).  The only difference
between the user and softmmu qom/cpu.c was that the user version ended
up in libuser.  ISTR I asked around about libuser, and the conclusion
was that it was only needed for --enable-user-pie.

> Have you actually tested linux-user to verify
> it works? It might lead to unexpected CPUState field accesses.

As I said, at the time I did the move there was no difference between
the two.  Now, I am indeed quite surprised that it works, but yes---it
does, at least trivial /bin/ls.

> You are judging based on master. I have some more code movements queued
> (qom-cpu-8) and I believe it was Anthony who insisted on suppressing
> those unneeded user-only fields even if they were unconditional in
> CPU_COMMON before.
> 
> qom/cpu.c is not intended to remain so small forever - any cpu_* code
> that does not depend on CPUArchState can find a new home there.
> cpu_interrupt() is being moved to qom/cpu.h and cpu_reset_interrupt() to
> qom/cpu.c for instance. And I'm working on refactoring CPU VMState, that
> either requires #ifdef'ery or lots of new stubs beyond what Eduardo added.

You can place those in a qom/cpu-softmmu.c.

What I care about is having an understandable build system.  At some
point we had 12 recursive -obj-y variables and a few other non-recursive
ones.  The interactions and inclusions were completely impossible to
understand.

Paolo

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-01-20  9:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-19 10:06 [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Paolo Bonzini
2013-01-19 10:06 ` [Qemu-devel] [PATCH 1/4] build: move around libcacard-y definition Paolo Bonzini
2013-01-19 18:05   ` Andreas Färber
2013-01-19 22:01     ` Paolo Bonzini
2013-01-19 23:26       ` Andreas Färber
2013-01-19 10:06 ` [Qemu-devel] [PATCH 2/4] build: use -$(CONFIG_SECCOMP) instead of ifeq Paolo Bonzini
2013-01-19 18:06   ` Andreas Färber
2013-01-19 10:06 ` [Qemu-devel] [PATCH 3/4] build: remove universal-obj-y Paolo Bonzini
2013-01-19 10:06 ` [Qemu-devel] [PATCH 4/4] build: remove extra-obj-y Paolo Bonzini
2013-01-19 18:11 ` [Qemu-devel] [PATCH for 1.4 0/4] Simplify Makefile.objs some more Andreas Färber
2013-01-19 22:06   ` Paolo Bonzini
2013-01-19 22:07     ` Paolo Bonzini
2013-01-19 23:22     ` Andreas Färber
2013-01-20  9:06       ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.