buildsys: Build quicker (mostly tools and linux-user)
cover buildsys: Build quicker (mostly tools and linux-user)
In some configuration (linux-user, tools) we can ignore building various objects (and the libfdt).
Philippe Mathieu-Daudé (4):
configure: Do not build libfdt is not required
Makefile: Clarify all the codebase requires qom/ objects
Makefile: Restrict system emulation and tools objects
Makefile: Remove unhelpful comment
configure | 2 ++ Makefile.objs | 31 ++++++++++--------------------- 2 files changed, 12 insertions(+), 21 deletions(-)
Signature · 1 line
2.21.1
PATCH 1/4 configure: Do not build libfdt is not required
We only require libfdt for system emulation, in a small set of architecture:
4077 # fdt support is mandatory for at least some target architectures, 4078 # so insist on it if we're building those system emulators. 4079 fdt_required=no 4080 for target in $target_list; do
4081 case $target in
4082 aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu|riscv*-softmmu)
4083 fdt_required=yes
Do not build libfdt if we did not manually specified --enable-fdt.
--- configure | 2 ++ 1 file changed, 2 insertions(+)
configure +2 -0
@@ -4092,6 +4092,8 @@ if test "$fdt_required" = "yes"; then "targets which need it (by specifying a cut down --target-list)." fi fdt=yes +elif test "$fdt" != "yes" ; then + fdt=no fi if test "$fdt" != "no" ; then
Signature · 1 line
2.21.1
Re: [PATCH 1/4] configure: Do not build libfdt is not required
Quoted 7 lines · Philippe Mathieu-Daudé
We only require libfdt for system emulation, in a small set of architecture:
4077 # fdt support is mandatory for at least some target architectures, 4078 # so insist on it if we're building those system emulators. 4079 fdt_required=no 4080 for target in $target_list; do
Quoted 5 lines
4081 case $target in
4082 aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu|riscv*-softmmu)
4083 fdt_required=yesDo not build libfdt if we did not manually specified --enable-fdt.
I suggest to add:
"... or have one of the platforms that require it in our target list."
Quoted 11 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- configure | 2 ++ 1 file changed, 2 insertions(+)configure +0
-0
configure if test "$fdt_required" = "yes"; then · line 4099
Quoted 8 lines
configure +2
-0@@ -4092,6 +4092,8 @@ if test "$fdt_required" = "yes"; then "targets which need it (by specifying a cut down --target-list)." fi fdt=yes +elif test "$fdt" != "yes" ; then + fdt=no fi if test "$fdt" != "no" ; then
Re: [PATCH 1/4] configure: Do not build libfdt is not required
In reply to Philippe Mathieu-DaudéQuoted 8 lines · Philippe Mathieu-Daudé
We only require libfdt for system emulation, in a small set of architecture:
4077 # fdt support is mandatory for at least some target architectures, 4078 # so insist on it if we're building those system emulators. 4079 fdt_required=no 4080 for target in $target_list; do
Quoted 7 lines
4081 case $target in
4082 aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu|riscv*-softmmu)
4083 fdt_required=yesDo not build libfdt if we did not manually specified --enable-fdt.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Alistair
Quoted 21 lines
--- configure | 2 ++ 1 file changed, 2 insertions(+)configure +2
-1@@ -4092,6 +4092,8 @@ if test "$fdt_required" = "yes"; then "targets which need it (by specifying a cut down --target-list)." fi fdt=yes +elif test "$fdt" != "yes" ; then + fdt=no fi if test "$fdt" != "no" ; then --2.21.1
PATCH 2/4 Makefile: Clarify all the codebase requires qom/ objects
In reply to Philippe Mathieu-DaudéQEMU user-mode also requires the qom/ objects, it is not only used by "system emulation and qemu-img". As we will use a big if() block, move it upper in the "Common libraries for tools and emulators" section.
--- Makefile.objs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
Makefile.objs +1 -5
@@ -2,6 +2,7 @@ # Common libraries for tools and emulators stub-obj-y = stubs/ util-obj-y = crypto/ util/ qobject/ qapi/ +qom-obj-y = qom/ chardev-obj-y = chardev/
@@ -26,11 +27,6 @@ block-obj-m = block/ crypto-obj-y = crypto/ -####################################################################### -# qom-obj-y is code used by both qemu system emulation and qemu-img - -qom-obj-y = qom/ - ####################################################################### # io-obj-y is code used by both qemu system emulation and qemu-img
Signature · 1 line
2.21.1
Re: [PATCH 2/4] Makefile: Clarify all the codebase requires qom/ objects
Quoted 25 lines · Philippe Mathieu-Daudé
QEMU user-mode also requires the qom/ objects, it is not only used by "system emulation and qemu-img". As we will use a big
if()block, move it upper in the "Common libraries for tools and emulators" section.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- Makefile.objs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)Makefile.objs +1
-0@@ -2,6 +2,7 @@ # Common libraries for tools and emulators stub-obj-y = stubs/ util-obj-y = crypto/ util/ qobject/ qapi/ +qom-obj-y = qom/ chardev-obj-y = chardev/@@ -26,11 +27,6 @@ block-obj-m = block/
Makefile.objs block-obj-m = block/ · line 32
Quoted 10 lines
Makefile.objs +0
-5crypto-obj-y = crypto/ -####################################################################### -# qom-obj-y is code used by both qemu system emulation and qemu-img - -qom-obj-y = qom/ - ####################################################################### # io-obj-y is code used by both qemu system emulation and qemu-img
PATCH 3/4 Makefile: Restrict system emulation and tools objects
In reply to Philippe Mathieu-DaudéRestrict all the system emulation and tools objects with a Makefile IF (CONFIG_SOFTMMU OR CONFIG_TOOLS) check.
Using the same description over and over is not very helpful. Use it once, just before the if() block.
--- Makefile.objs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
Makefile.objs +7 -12
@@ -4,16 +4,15 @@ stub-obj-y = stubs/ util-obj-y = crypto/ util/ qobject/ qapi/ qom-obj-y = qom/ +####################################################################### +# code used by both qemu system emulation and qemu-img + +ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y) + chardev-obj-y = chardev/ -####################################################################### -# authz-obj-y is code used by both qemu system emulation and qemu-img - authz-obj-y = authz/ -####################################################################### -# block-obj-y is code used by both qemu system emulation and qemu-img - block-obj-y = nbd/ block-obj-y += block.o blockjob.o job.o block-obj-y += block/ scsi/
@@ -22,16 +21,12 @@ block-obj-$(CONFIG_REPLICATION) += replication.o block-obj-m = block/ -####################################################################### -# crypto-obj-y is code used by both qemu system emulation and qemu-img - crypto-obj-y = crypto/ -####################################################################### -# io-obj-y is code used by both qemu system emulation and qemu-img - io-obj-y = io/ +endif # CONFIG_SOFTMMU or CONFIG_TOOLS + ###################################################################### # 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
Signature · 1 line
2.21.1
Re: [PATCH 3/4] Makefile: Restrict system emulation and tools objects
Quoted 16 lines · Philippe Mathieu-Daudé
Restrict all the system emulation and tools objects with a
MakefileIF (CONFIG_SOFTMMUORCONFIG_TOOLS) check.Using the same description over and over is not very helpful. Use it once, just before the
if()block.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- Makefile.objs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)Makefile.objs +0
-0
Makefile.objs stub-obj-y = stubs/ · line 10
Quoted 7 lines
Makefile.objs +4
-0@@ -4,16 +4,15 @@ stub-obj-y = stubs/ util-obj-y = crypto/ util/ qobject/ qapi/ qom-obj-y = qom/ +####################################################################### +# code used by both qemu system emulation and qemu-img + +ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y)
That ",y" at the end looks wrong?
Thomas
Re: [PATCH 3/4] Makefile: Restrict system emulation and tools objects
Quoted 20 lines · Thomas Huth
Quoted 19 lines · Philippe Mathieu-Daudé
Restrict all the system emulation and tools objects with a
MakefileIF (CONFIG_SOFTMMUORCONFIG_TOOLS) check.Using the same description over and over is not very helpful. Use it once, just before the
if()block.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- Makefile.objs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)Makefile.objs +0
-0@@ -4,16 +4,15 @@ stub-obj-y = stubs/ util-obj-y = crypto/ util/ qobject/ qapi/ qom-obj-y = qom/
Quoted 7 lines
Makefile.objs stub-obj-y = stubs/ · line 10
Quoted 4 lines
Makefile.objs +4
-0+####################################################################### +# code used by both qemu system emulation and qemu-img + +ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y)That ",y" at the end looks wrong?
It's the result of the logical OR.
Thomas Huth
Reviewed-byRe: [PATCH 3/4] Makefile: Restrict system emulation and tools objects
Quoted 33 lines · Philippe Mathieu-Daudé
Le ven. 10 janv. 2020 09:18, Thomas Huth <[email protected] <mailto:[email protected]>> a écrit :
On 09/01/2020 16.39, Philippe Mathieu-Daudé wrote: > Restrict all the system emulation and tools objects with a > Makefile IF (CONFIG_SOFTMMU OR CONFIG_TOOLS) check. > > Using the same description over and over is not very helpful. > Use it once, just before the if() block. > > Signed-off-by: Philippe Mathieu-Daudé <[email protected] <mailto:[email protected]>> > --- > Makefile.objs | 19 +++++++------------ > 1 file changed, 7 insertions(+), 12 deletions(-) > > diff --git a/Makefile.objs b/Makefile.objs > index 5aae561984..395dd1e670 100644 > --- a/Makefile.objs > +++ b/Makefile.objs > @@ -4,16 +4,15 @@ stub-obj-y = stubs/ > util-obj-y = crypto/ util/ qobject/ qapi/ > qom-obj-y = qom/ > > +####################################################################### > +# code used by both qemu system emulation and qemu-img > + > +ifeq ($(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)),y) That ",y" at the end looks wrong?
Quoted 1 line
It's the result of the logical OR.
-ENOTENOUGHCOFFEEYET
Your code is fine, of course.
PATCH 4/4 Makefile: Remove unhelpful comment
In reply to Philippe Mathieu-DaudéIt is pointless to keep qapi/ object separate from the other common-objects. Drop the comment.
--- Makefile.objs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Makefile.objs +2 -4
@@ -71,11 +71,9 @@ qemu-seccomp.o-libs := $(SECCOMP_LIBS) common-obj-$(CONFIG_FDT) += device_tree.o -###################################################################### -# qapi - common-obj-y += qapi/ -endif + +endif # CONFIG_SOFTMMU ####################################################################### # Target-independent parts used in system and user emulation
Signature · 1 line
2.21.1
Re: [PATCH 4/4] Makefile: Remove unhelpful comment
Quoted 17 lines · Philippe Mathieu-Daudé
It is pointless to keep qapi/ object separate from the other common-objects. Drop the comment.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- Makefile.objs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)Makefile.objs +0
-0@@ -71,11 +71,9 @@ qemu-seccomp.o-libs := $(SECCOMP_LIBS) common-obj-$(CONFIG_FDT) += device_tree.o
Makefile.objs qemu-seccomp.o-libs := $(SECCOMP_LIBS) · line 79
Quoted 10 lines
Makefile.objs +2
-4-###################################################################### -# qapi - common-obj-y += qapi/ -endif + +endif # CONFIG_SOFTMMU ####################################################################### # Target-independent parts used in system and user emulation
Le 09/01/2020 à 16:39, Philippe Mathieu-Daudé a écrit :
Quoted 9 lines
In some configuration (linux-user, tools) we can ignore building various objects (and the libfdt).
Philippe Mathieu-Daudé (4):
configure: Do not build libfdt is not required
Makefile: Clarify all the codebase requires qom/ objects
Makefile: Restrict system emulation and tools objects
Makefile: Remove unhelpful comment
Quoted 4 lines
configure | 2 ++ Makefile.objs | 31 ++++++++++--------------------- 2 files changed, 12 insertions(+), 21 deletions(-)
Did you test this with all the combinations of --[enable|disable]-tools, --[enable|disable]-user and --[enable|disable]-system?
Thanks,
Laurent
Quoted 10 lines · Laurent Vivier
Quoted 9 lines · Philippe Mathieu-Daudé
In some configuration (linux-user, tools) we can ignore building various objects (and the libfdt).
Philippe Mathieu-Daudé (4):
configure: Do not build libfdt is not required
Makefile: Clarify all the codebase requires qom/ objects
Makefile: Restrict system emulation and tools objects
Makefile: Remove unhelpful comment
Quoted 8 lines
Quoted 4 lines
configure | 2 ++ Makefile.objs | 31 ++++++++++--------------------- 2 files changed, 12 insertions(+), 21 deletions(-)Did you test this with all the combinations of --[enable|disable]-tools, --[enable|disable]-user and --[enable|disable]-system
I tested 12 of 27 because I thought some sets might overlap but I might have missed something, what combination is giving you problem?
Quoted 1 line
Le 10/01/2020 à 10:17, Philippe Mathieu-Daudé a écrit :
Quoted 18 lines
Le ven. 10 janv. 2020 09:36, Laurent Vivier <[email protected] <mailto:[email protected]>> a écrit :
Le 09/01/2020 à 16:39, Philippe Mathieu-Daudé a écrit :
> In some configuration (linux-user, tools) we can ignore building > various objects (and the libfdt).
>
> Philippe Mathieu-Daudé (4):
> configure: Do not build libfdt is not required
> Makefile: Clarify all the codebase requires qom/ objects > Makefile: Restrict system emulation and tools objects > Makefile: Remove unhelpful comment
>
> configure | 2 ++
> Makefile.objs | 31 ++++++++++---------------------
> 2 files changed, 12 insertions(+), 21 deletions(-)
>
Quoted 7 lines
Did you test this with all the combinations of --[enable|disable]-tools, --[enable|disable]-user and --[enable|disable]-system
I tested 12 of 27 because I thought some sets might overlap but I might have missed something, what combination is giving you problem?
I didn't test your series, but I did this kind of change in the past and sometime enabling tools without enabling softmmu can show missing objects at build time, or you can also see if tools are built with softmmu while tools are disabled.
I used to test with something like
for user in enable disable; do
for tools in enable disable; do
for system in enable disable; do
rm -fr build
mkdir build && \
(cd build && \
../configure --$user-user \
--$system-system \
--$tools-tools && \
make || exit)
done
donedone
Thanks,
Laurent
Quoted 46 lines · Laurent Vivier
Le 10/01/2020 à 10:17, Philippe Mathieu-Daudé a écrit :
Quoted 18 lines
Le ven. 10 janv. 2020 09:36, Laurent Vivier <[email protected] <mailto:[email protected]>> a écrit :
Le 09/01/2020 à 16:39, Philippe Mathieu-Daudé a écrit :
> In some configuration (linux-user, tools) we can ignore building > various objects (and the libfdt).
>
> Philippe Mathieu-Daudé (4):
> configure: Do not build libfdt is not required
> Makefile: Clarify all the codebase requires qom/ objects > Makefile: Restrict system emulation and tools objects > Makefile: Remove unhelpful comment
>
> configure | 2 ++
> Makefile.objs | 31 ++++++++++---------------------
> 2 files changed, 12 insertions(+), 21 deletions(-)
>Quoted 7 lines
Did you test this with all the combinations of --[enable|disable]-tools, --[enable|disable]-user and --[enable|disable]-system
I tested 12 of 27 because I thought some sets might overlap but I might have missed something, what combination is giving you problem?
I didn't test your series, but I did this kind of change in the past and sometime enabling tools without enabling softmmu can show missing objects at build time, or you can also see if tools are built with softmmu while tools are disabled.
I used to test with something like
for user in enable disable; do
for tools in enable disable; do for system in enable disable; do rm -fr build mkdir build && \ (cd build && \ ../configure --$user-user \ --$system-system \ --$tools-tools && \ make || exit) done done
Quoted 1 line
done
I tested all these 8 combinations, no problem.