[PATCH v2 0/6] kconfig: express dependency of individual boards on libfdt

Paolo Bonzini posted 6 patches 6 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240508075105.15510-1-pbonzini@redhat.com
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Song Gao <gaosong@loongson.cn>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bmeng.cn@gmail.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Peter Maydell <peter.maydell@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Stafford Horne <shorne@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Max Filippov <jcmvbkbc@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
configs/targets/aarch64-softmmu.mak      |   1 +
configs/targets/arm-softmmu.mak          |   1 +
configs/targets/i386-softmmu.mak         |   1 -
configs/targets/loongarch64-softmmu.mak  |   1 +
configs/targets/microblaze-softmmu.mak   |   1 +
configs/targets/microblazeel-softmmu.mak |   1 +
configs/targets/mips64el-softmmu.mak     |   1 -
configs/targets/or1k-softmmu.mak         |   1 +
configs/targets/ppc-softmmu.mak          |   1 -
configs/targets/ppc64-softmmu.mak        |   1 +
configs/targets/riscv32-softmmu.mak      |   1 +
configs/targets/riscv64-softmmu.mak      |   1 +
configs/targets/rx-softmmu.mak           |   1 +
configs/targets/x86_64-softmmu.mak       |   1 -
meson.build                              | 100 +++++++++++++----------
include/monitor/hmp.h                    |   1 +
include/sysemu/device_tree.h             |   1 -
hw/xtensa/xtfpga.c                       |   9 --
monitor/hmp-cmds.c                       |  17 ++++
system/device_tree-stub.c                |  10 +++
system/device_tree.c                     |  14 ----
.gitlab-ci.d/buildtest.yml               |   8 +-
Kconfig.host                             |   3 +
hw/arm/Kconfig                           |   5 ++
hw/arm/meson.build                       |   2 +-
hw/core/Kconfig                          |   9 +-
hw/core/meson.build                      |   2 +-
hw/i386/Kconfig                          |   3 +-
hw/loongarch/Kconfig                     |   3 +-
hw/loongarch/meson.build                 |   2 +-
hw/mips/Kconfig                          |   3 +-
hw/mips/meson.build                      |   2 +-
hw/openrisc/Kconfig                      |   2 +
hw/openrisc/meson.build                  |   4 +-
hw/ppc/Kconfig                           |  15 ++--
hw/ppc/meson.build                       |   4 +-
hw/riscv/Kconfig                         |   4 +
hw/riscv/meson.build                     |   2 +-
hw/rx/Kconfig                            |   3 +-
hw/xtensa/Kconfig                        |   3 +-
system/meson.build                       |   4 +-
target/arm/Kconfig                       |   2 +
target/microblaze/Kconfig                |   1 +
target/openrisc/Kconfig                  |   1 +
target/riscv/Kconfig                     |   2 +
45 files changed, 154 insertions(+), 101 deletions(-)
create mode 100644 system/device_tree-stub.c
[PATCH v2 0/6] kconfig: express dependency of individual boards on libfdt
Posted by Paolo Bonzini 6 months, 3 weeks ago
This is a follow up to the "default y" patch series at
https://lore.kernel.org/qemu-devel/20240423131612.28362-1-pbonzini@redhat.com/
and shows an example of what that series enables.

With this change, individual boards will be enabled/disabled depending
on whether libfdt is present or not.  In particular, x86 will simply
disable microvm and build the "traditional" chipsets if libfdt is not
found.

All boards or targets that need libfdt now have an explicit "depends on
FDT" (sometimes the boards delegate that to the target).  TARGET_NEED_FDT
is only used for targets that absolutely cannot build without libfdt,
or for which all boards require it.

For simplicity, patch 1 simplifies the libfdt handling in meson.build,
removing the ability to force use of the subproject.  There is no
use case that I can imagine, if you want to use the subproject just
delete libfdt from your OS installation.

Paolo

v1->v2:
- use libfdt CPPFLAGS when building target-specific files
- limited scope of libfdt detection changes: keep it enabled when building
  --without-default-features (see commit message for 0577e84d374,
  "configure: Disable capstone and slirp in the --without-default-features
  mode", 2022-02-21)
- patch 6 does not 
- split patch 3 in two parts
- fix compilation errors due to missing qmp_dumpdtb/hmp_dumpdtb
- make MIPS_BOSTON depend on FDT

Paolo Bonzini (6):
  meson: pick libfdt from common_ss when building target-specific files
  meson: move libfdt together with other dependencies
  kconfig: allow compiling out QEMU device tree code per target
  kconfig: express dependency of individual boards on libfdt
  hw/xtensa: require libfdt
  configs: disable emulators that require it if libfdt is not found

 configs/targets/aarch64-softmmu.mak      |   1 +
 configs/targets/arm-softmmu.mak          |   1 +
 configs/targets/i386-softmmu.mak         |   1 -
 configs/targets/loongarch64-softmmu.mak  |   1 +
 configs/targets/microblaze-softmmu.mak   |   1 +
 configs/targets/microblazeel-softmmu.mak |   1 +
 configs/targets/mips64el-softmmu.mak     |   1 -
 configs/targets/or1k-softmmu.mak         |   1 +
 configs/targets/ppc-softmmu.mak          |   1 -
 configs/targets/ppc64-softmmu.mak        |   1 +
 configs/targets/riscv32-softmmu.mak      |   1 +
 configs/targets/riscv64-softmmu.mak      |   1 +
 configs/targets/rx-softmmu.mak           |   1 +
 configs/targets/x86_64-softmmu.mak       |   1 -
 meson.build                              | 100 +++++++++++++----------
 include/monitor/hmp.h                    |   1 +
 include/sysemu/device_tree.h             |   1 -
 hw/xtensa/xtfpga.c                       |   9 --
 monitor/hmp-cmds.c                       |  17 ++++
 system/device_tree-stub.c                |  10 +++
 system/device_tree.c                     |  14 ----
 .gitlab-ci.d/buildtest.yml               |   8 +-
 Kconfig.host                             |   3 +
 hw/arm/Kconfig                           |   5 ++
 hw/arm/meson.build                       |   2 +-
 hw/core/Kconfig                          |   9 +-
 hw/core/meson.build                      |   2 +-
 hw/i386/Kconfig                          |   3 +-
 hw/loongarch/Kconfig                     |   3 +-
 hw/loongarch/meson.build                 |   2 +-
 hw/mips/Kconfig                          |   3 +-
 hw/mips/meson.build                      |   2 +-
 hw/openrisc/Kconfig                      |   2 +
 hw/openrisc/meson.build                  |   4 +-
 hw/ppc/Kconfig                           |  15 ++--
 hw/ppc/meson.build                       |   4 +-
 hw/riscv/Kconfig                         |   4 +
 hw/riscv/meson.build                     |   2 +-
 hw/rx/Kconfig                            |   3 +-
 hw/xtensa/Kconfig                        |   3 +-
 system/meson.build                       |   4 +-
 target/arm/Kconfig                       |   2 +
 target/microblaze/Kconfig                |   1 +
 target/openrisc/Kconfig                  |   1 +
 target/riscv/Kconfig                     |   2 +
 45 files changed, 154 insertions(+), 101 deletions(-)
 create mode 100644 system/device_tree-stub.c

-- 
2.45.0