Skip to content

Compile only devices that are used

Juan Quintela qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest31 patches 1 replyIn review
  2. v430 patches 0 repliesSuperseded
  3. v330 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v215 patches0 repliesSuperseded
v114 patches4 repliesSuperseded

Changes in v5 from the cover letter

Found problem why it failed to compile some times.
We moved config.h from target directory to home directory. If you find that compilation don't work you have to:
make distclean (this remove target directories)
rm -f */config.* (this remove the conflictiong files)
Why did the files got renamed? Because now we put more stuff inside that file, and it is better to have to do a make distclean that search and replace s/config.h/config-other-name.h/ in all files.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/31Don't include config-host.mak from inside config.makMakefile.target configure+1 -20 replies
2/31Move generation of config-host.h to Makefile from configureMakefile configure create_config +1 more+21 -231 reply
3/31Remove useless check for config-host.makMakefile+3 -60 replies
4/31Rename config.{h, mak} config-target.{h, mak}.gitignore Makefile Makefile.target +2 more+64 -600 replies
5/31Move generation of config-target.h to Makefile from configureMakefile.target configure+6 -180 replies
6/31Add new config-devices.mak for each target.gitignore Makefile Makefile.hw +43 more+57 -00 replies
7/31Generate config-devices.hMakefile Makefile.target config.h+19 -30 replies
8/31Generate gdbstub-xml.c only when neededMakefile.target configure default-configs/arm-linux-user.mak +11 more+31 -90 replies
9/31Only compile usb_ohci when one target uses itMakefile.target default-configs/arm-softmmu.mak default-configs/ppc-softmmu.mak +4 more+9 -10 replies
10/31Only compile isa_mmio when one target uses itMakefile.target default-configs/arm-softmmu.mak default-configs/mips-softmmu.mak +7 more+16 -30 replies
11/31Only compile qdev_addr when one target uses itMakefile.hw default-configs/sparc-softmmu.mak+4 -10 replies
12/31Only compile nand when one target uses itMakefile.hw default-configs/arm-softmmu.mak default-configs/cris-softmmu.mak+5 -10 replies
13/31Only compile ecc when one target uses itMakefile.hw default-configs/arm-softmmu.mak default-configs/sparc-softmmu.mak+3 -10 replies
14/31Only compile esp when one target uses itMakefile.hw default-configs/mips-softmmu.mak default-configs/mips64-softmmu.mak +3 more+7 -10 replies
15/31Only compile escc when one target uses itMakefile.hw default-configs/ppc-softmmu.mak default-configs/ppc64-softmmu.mak +2 more+7 -10 replies
16/31Only compile m48t59 when one target uses itMakefile.hw default-configs/ppc-softmmu.mak default-configs/ppc64-softmmu.mak +3 more+6 -20 replies
17/31Only compile ptimer when one target uses itMakefile default-configs/arm-softmmu.mak default-configs/cris-softmmu.mak +6 more+11 -10 replies
18/31Only compile sd when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
19/31Only compile max7310 when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
20/31Only compile wm8750 when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
21/31Only compile twl92230 when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
22/31Only compile tsc2005 when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
23/31Only compile lm832x when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
24/31Only compile tmp105 when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
25/31Only compile stellaris_input when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
26/31Only compile sd0303 when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
27/31Only compile sd0323 when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
28/31Only compile ads7846 when one target uses itMakefile default-configs/arm-softmmu.mak+2 -10 replies
29/31Only compile max111x when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies
30/31Only compile ssi-sd when one target uses itMakefile default-configs/arm-softmmu.mak+2 -10 replies
31/31Only compile ssi when one target uses itMakefile default-configs/arm-softmmu.mak+3 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [Qemu-devel] [PATCH v5 00/31] Compile only devices that are used

The new config file version! .... (again)
This time works!

v5:
Found problem why it failed to compile some times.
We moved config.h from target directory to home directory. If you find that compilation don't work you have to:
make distclean (this remove target directories)
rm -f */config.* (this remove the conflictiong files)
Why did the files got renamed? Because now we put more stuff inside that file, and it is better to have to do a make distclean that search and replace s/config.h/config-other-name.h/ in all files.

Once that I fixed the build problems, just created again config-devices.h it is always included by default.
Important bit is:
#if defined(NEED_CPU_H)
#include "config-devices.h"
#else
#include "config-all-devices.h"
#endif

I have a different name for the all devices include files that for the target one, reason for this is that we don't want to trust the patch to find the right file.

I tested that all archs compiled as expected compiling them separately, i.e. ./confige --target-list=i386-softmmu
repeat for all architectures. This made me fix a cople of errors in the previous version. Compiled in place and in an external directory, Everything worked.

v4: Now creation of config-host.h and config-target.h fixed
(many thanks to Paolo Bonzini)

v3:
- Now we have a config file by target!!!
- We have configure tool to choose what drivers to compile
vi <target>/config-devices.mak
- We have another nice tool to check if a config file is valid
make: if it compiles, it is good, otherwise go to previous step
- Renamed config.h/config.mak to config-target.h and config-target.{h,mak} now config.h is not generated, and we can put more stuff there
- I did a go at trying to create config-devices.h, but it is _interesting_ as we have different names, and have to put one of the files. That is the reason why I did the automatic generation of *.h files from *.mak files.
- I switched previus patches to this new series.

ToDo:
- there is still a bug when compiling with make -j<n>, sometimes it don't generate config-host.h. Still haven't been able to catch why. Normally it works, that is the reason why it is not esay to find what is wrong.
- Pass more stuff to that configuration files.

Comments?

v2:
- ptimer is also used in sparc64 (Blue Swirl)
- generate and compile gdbstub-xml only when needed.

v1:
This series disable complilation of devices that are not used in any of the selected targets. Patch series remove all the devices that are not used for x86_64/i386-softmmu alone. If you also compiles the softmmu targets that need them, they are compiled back in.

I sent similar patches to this series a couple of months ago. The big different (for those with good memory) is that now I don't move devices from Makefile.hw and Makefile to Makefile.target. I just enable/disable them with CONFIG_FOO and normal building system.

I didn't do it for other platform because I don't have an easy way to test that I haven't broke anything. Anyone that uses other platform can do the same simplification there.

Juan Quintela (31):
Don't include config-host.mak from inside config.mak Move generation of config-host.h to Makefile from configure Remove useless check for config-host.mak
Rename config.{h,mak} config-target.{h,mak}
Move generation of config-target.h to Makefile from configure Add new config-devices.mak for each target
Generate config-devices.h
Generate gdbstub-xml.c only when needed
Only compile usb_ohci when one target uses it
Only compile isa_mmio when one target uses it
Only compile qdev_addr when one target uses it
Only compile nand when one target uses it
Only compile ecc when one target uses it
Only compile esp when one target uses it
Only compile escc when one target uses it
Only compile m48t59 when one target uses it
Only compile ptimer when one target uses it
Only compile sd when one target uses it
Only compile max7310 when one target uses it
Only compile wm8750 when one target uses it
Only compile twl92230 when one target uses it
Only compile tsc2005 when one target uses it
Only compile lm832x when one target uses it
Only compile tmp105 when one target uses it
Only compile stellaris_input when one target uses it Only compile sd0303 when one target uses it
Only compile sd0323 when one target uses it
Only compile ads7846 when one target uses it
Only compile max111x when one target uses it
Only compile ssi-sd when one target uses it
Only compile ssi when one target uses it

 .gitignore                                 |    3 +
 Makefile                                   |   57 ++++++++---
 Makefile.hw                                |   13 ++-
 Makefile.target                            |   33 ++++---
 config.h                                   |   13 +++
 configure                                  |  140 +++++++++++-----------------
 create_config                              |    2 +
 default-configs/alpha-linux-user.mak       |    1 +
 default-configs/arm-linux-user.mak         |    3 +
 default-configs/arm-softmmu.mak            |   22 +++++
 default-configs/armeb-linux-user.mak       |    3 +
 default-configs/cris-linux-user.mak        |    1 +
 default-configs/cris-softmmu.mak           |    4 +
 default-configs/i386-bsd-user.mak          |    1 +
 default-configs/i386-darwin-user.mak       |    1 +
 default-configs/i386-linux-user.mak        |    1 +
 default-configs/i386-softmmu.mak           |    1 +
 default-configs/m68k-linux-user.mak        |    3 +
 default-configs/m68k-softmmu.mak           |    4 +
 default-configs/microblaze-linux-user.mak  |    1 +
 default-configs/microblaze-softmmu.mak     |    3 +
 default-configs/mips-linux-user.mak        |    1 +
 default-configs/mips-softmmu.mak           |    4 +
 default-configs/mips64-softmmu.mak         |    4 +
 default-configs/mips64el-softmmu.mak       |    4 +
 default-configs/mipsel-linux-user.mak      |    1 +
 default-configs/mipsel-softmmu.mak         |    4 +
 default-configs/ppc-darwin-user.mak        |    3 +
 default-configs/ppc-linux-user.mak         |    3 +
 default-configs/ppc-softmmu.mak            |    7 ++
 default-configs/ppc64-linux-user.mak       |    3 +
 default-configs/ppc64-softmmu.mak          |    7 ++
 default-configs/ppc64abi32-linux-user.mak  |    3 +
 default-configs/ppcemb-softmmu.mak         |    7 ++
 default-configs/sh4-linux-user.mak         |    1 +
 default-configs/sh4-softmmu.mak            |    4 +
 default-configs/sh4eb-linux-user.mak       |    1 +
 default-configs/sh4eb-softmmu.mak          |    4 +
 default-configs/sparc-bsd-user.mak         |    1 +
 default-configs/sparc-linux-user.mak       |    1 +
 default-configs/sparc-softmmu.mak          |    8 ++
 default-configs/sparc32plus-linux-user.mak |    1 +
 default-configs/sparc64-bsd-user.mak       |    1 +
 default-configs/sparc64-linux-user.mak     |    1 +
 default-configs/sparc64-softmmu.mak        |    5 +
 default-configs/x86_64-bsd-user.mak        |    1 +
 default-configs/x86_64-linux-user.mak      |    1 +
 default-configs/x86_64-softmmu.mak         |    1 +
 rules.mak                                  |    9 ++
 49 files changed, 282 insertions(+), 119 deletions(-)
 create mode 100644 config.h
 create mode 100644 default-configs/alpha-linux-user.mak
 create mode 100644 default-configs/arm-linux-user.mak
 create mode 100644 default-configs/arm-softmmu.mak
 create mode 100644 default-configs/armeb-linux-user.mak
 create mode 100644 default-configs/cris-linux-user.mak
 create mode 100644 default-configs/cris-softmmu.mak
 create mode 100644 default-configs/i386-bsd-user.mak
 create mode 100644 default-configs/i386-darwin-user.mak
 create mode 100644 default-configs/i386-linux-user.mak
 create mode 100644 default-configs/i386-softmmu.mak
 create mode 100644 default-configs/m68k-linux-user.mak
 create mode 100644 default-configs/m68k-softmmu.mak
 create mode 100644 default-configs/microblaze-linux-user.mak
 create mode 100644 default-configs/microblaze-softmmu.mak
 create mode 100644 default-configs/mips-linux-user.mak
 create mode 100644 default-configs/mips-softmmu.mak
 create mode 100644 default-configs/mips64-softmmu.mak
 create mode 100644 default-configs/mips64el-softmmu.mak
 create mode 100644 default-configs/mipsel-linux-user.mak
 create mode 100644 default-configs/mipsel-softmmu.mak
 create mode 100644 default-configs/ppc-darwin-user.mak
 create mode 100644 default-configs/ppc-linux-user.mak
 create mode 100644 default-configs/ppc-softmmu.mak
 create mode 100644 default-configs/ppc64-linux-user.mak
 create mode 100644 default-configs/ppc64-softmmu.mak
 create mode 100644 default-configs/ppc64abi32-linux-user.mak
 create mode 100644 default-configs/ppcemb-softmmu.mak
 create mode 100644 default-configs/sh4-linux-user.mak
 create mode 100644 default-configs/sh4-softmmu.mak
 create mode 100644 default-configs/sh4eb-linux-user.mak
 create mode 100644 default-configs/sh4eb-softmmu.mak
 create mode 100644 default-configs/sparc-bsd-user.mak
 create mode 100644 default-configs/sparc-linux-user.mak
 create mode 100644 default-configs/sparc-softmmu.mak
 create mode 100644 default-configs/sparc32plus-linux-user.mak
 create mode 100644 default-configs/sparc64-bsd-user.mak
 create mode 100644 default-configs/sparc64-linux-user.mak
 create mode 100644 default-configs/sparc64-softmmu.mak
 create mode 100644 default-configs/x86_64-bsd-user.mak
 create mode 100644 default-configs/x86_64-linux-user.mak
 create mode 100644 default-configs/x86_64-softmmu.mak