[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v16 98/99] configure: allow the overriding of default-config in t
From: |
Alex Bennée |
Subject: |
[PATCH v16 98/99] configure: allow the overriding of default-config in the build |
Date: |
Fri, 4 Jun 2021 16:53:11 +0100 |
While the default config works well enough it does end up enabling a
lot of stuff. For more minimal builds we can pass a slimmed down list
of devices and let Kconfig work out what we want. For example:
../../configure --without-default-features \
--target-list=arm-softmmu,aarch64-softmmu \
--with-devices-aarch64=(pwd)/../../configs/aarch64-softmmu/64bit-only.mak
will override the aarch64-softmmu default devices to one of our own
choosing. Currently there are two configs provided:
- 64bit-only, to build without any 32 bit boards at all
- virt, even more minimal set for --disable-tcg builds
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210528163116.31902-1-alex.bennee@linaro.org>
---
v2
- remove extraneous cc
- dropped pathname from config
- add virt.mak config
- drop ZYNQMP from the 64bit only build
- test -f the --with-devices-FOO file
---
configure | 20 ++++++++++++++++++++
configs/aarch64-softmmu/64bit-only.mak | 10 ++++++++++
configs/aarch64-softmmu/virt-only.mak | 8 ++++++++
meson.build | 3 ++-
4 files changed, 40 insertions(+), 1 deletion(-)
create mode 100644 configs/aarch64-softmmu/64bit-only.mak
create mode 100644 configs/aarch64-softmmu/virt-only.mak
diff --git a/configure b/configure
index f0c8629dc6..5bf2f56ac6 100755
--- a/configure
+++ b/configure
@@ -920,6 +920,16 @@ for opt do
;;
--without-default-devices) default_devices="false"
;;
+ --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO
option"
+ ;;
+ --with-devices-*) device_arch=${opt#--with-devices-};
device_arch=${device_arch%%=*}
+ if test -f "$optarg"; then
+ device_archs="$device_archs $device_arch"
+ eval "devices_${device_arch}=\$optarg"
+ else
+ error_exit "File $optarg does not exist"
+ fi
+ ;;
--without-default-features) # processed above
;;
--enable-gprof) gprof="yes"
@@ -1766,6 +1776,7 @@ Advanced options (experts only):
--without-default-devices do not include any device that is not needed to
start the emulator (only use if you are including
desired devices in default-configs/devices/)
+ --with-devices-ARCH=PATH override default-configs/devices with your own file
--enable-debug enable common debug build options
--enable-sanitizers enable default sanitizers
--enable-tsan enable thread sanitizer
@@ -6343,6 +6354,15 @@ if test "$skip_meson" = no; then
echo "# Automatically generated by configure - do not modify" > $cross
echo "[properties]" >> $cross
+
+ # unroll any custom device configs
+ if test -n "$device_archs"; then
+ for a in $device_archs; do
+ eval "c=\$devices_${a}"
+ echo "${a}-softmmu = [ '$c' ]" >> $cross
+ done
+ fi
+
test -z "$cxx" && echo "link_language = 'c'" >> $cross
echo "[built-in options]" >> $cross
echo "c_args = [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross
diff --git a/configs/aarch64-softmmu/64bit-only.mak
b/configs/aarch64-softmmu/64bit-only.mak
new file mode 100644
index 0000000000..19638a56cf
--- /dev/null
+++ b/configs/aarch64-softmmu/64bit-only.mak
@@ -0,0 +1,10 @@
+#
+# A version of the config that only supports 64bits and their devices.
+# This doesn't quite eliminate all 32 bit devices as some boards like
+# "virt" support both. The CONFIG_XLNX_ZYNQMP_ARM isn't included as it
+# also requires 32 bit support for the R5s
+#
+
+CONFIG_ARM_VIRT=y
+CONFIG_XLNX_VERSAL=y
+CONFIG_SBSA_REF=y
diff --git a/configs/aarch64-softmmu/virt-only.mak
b/configs/aarch64-softmmu/virt-only.mak
new file mode 100644
index 0000000000..cadacf3e89
--- /dev/null
+++ b/configs/aarch64-softmmu/virt-only.mak
@@ -0,0 +1,8 @@
+#
+# A version of the config that only supports virtual machines. This is
+# intended to be combined with options like --disable-tcg for a
+# minimal build supporting only machines we can virtualise with a
+# hypervisor.
+#
+
+CONFIG_ARM_VIRT=y
diff --git a/meson.build b/meson.build
index 09c7809d6b..9d25906219 100644
--- a/meson.build
+++ b/meson.build
@@ -1350,9 +1350,10 @@ foreach target : target_dirs
configuration:
config_target_data)}
if target.endswith('-softmmu')
+ config_input = meson.get_external_property(target,
'default-configs/devices' / target + '.mak')
config_devices_mak = target + '-config-devices.mak'
config_devices_mak = configure_file(
- input: ['default-configs/devices' / target + '.mak', 'Kconfig'],
+ input: [config_input, 'Kconfig'],
output: config_devices_mak,
depfile: config_devices_mak + '.d',
capture: true,
--
2.20.1
- Re: [PATCH v16 73/99] target/arm: cpu-sve: split TCG and KVM functionality, (continued)
- [PATCH v16 38/99] target/arm: move arm_sctlr away from tcg helpers, Alex Bennée, 2021/06/04
- [PATCH v16 57/99] target/arm: remove kvm include file for PSCI and arm-powerctl, Alex Bennée, 2021/06/04
- [PATCH v16 27/99] target/arm: fix style in preparation of new cpregs module, Alex Bennée, 2021/06/04
- [PATCH v16 48/99] target/arm: remove now useless ifndef from fp_exception_el, Alex Bennée, 2021/06/04
- [PATCH v16 90/99] XXX target/arm: experiment refactoring cpu "max", Alex Bennée, 2021/06/04
- [PATCH v16 49/99] target/arm: make further preparation for the exception code to move, Alex Bennée, 2021/06/04
- [PATCH v16 98/99] configure: allow the overriding of default-config in the build,
Alex Bennée <=
- [PATCH v16 91/99] target/arm: tcg: remove superfluous CONFIG_TCG check, Alex Bennée, 2021/06/04
- [PATCH v16 22/99] target/arm: tcg: split m_helper user-only and sysemu-only parts, Alex Bennée, 2021/06/04
- [PATCH v16 81/99] target/arm: tcg-sve: rename the narrow_vq and change_el functions, Alex Bennée, 2021/06/04
- [PATCH v16 66/99] tests: do not run qom-test on all machines for ARM KVM-only, Alex Bennée, 2021/06/04
- [PATCH v16 65/99] tests: device-introspect-test: cope with ARM TCG-only devices, Alex Bennée, 2021/06/04
- [PATCH v16 14/99] accel: add cpu_reset, Alex Bennée, 2021/06/04