configure cleanups for QEMU 8.2
Subsystems (2)
cover configure cleanups for QEMU 8.2
This includes a few more patches cleaning up the configure/meson separation. The highlights are fixing --host-cc, removing the last traces of compiler detection from config-host.mak, and dropping the useless pc-bios/Makefile.
Paolo Bonzini (10):
meson: do not unnecessarily use cmake for dependencies
meson: update unsupported host/CPU messages
configure: remove HOST_CC
configure: create native file with contents of $host_cc
meson: compile bundled device trees contrib/plugins: use an independent makefile
meson: do not use config_host to pick tap implementations configure, meson: move simple OS definitions to meson
configure: remove $linux and $mingw32 variables
configure: move --enable-debug-tcg to meson
configure | 65 +++++++++-------------- contrib/plugins/Makefile | 18 +++---- hw/9pfs/meson.build | 4 +- meson.build | 43 ++++++++------- meson_options.txt | 2 + net/meson.build | 18 ++++--- pc-bios/Makefile | 19 ------- pc-bios/meson.build | 25 +++++++-- scripts/meson-buildoptions.sh | 3 ++ tests/migration/meson.build | 2 +- tests/qtest/meson.build | 2 +- tests/tcg/tricore/Makefile.softmmu-target | 2 +- 12 files changed, 101 insertions(+), 102 deletions(-) delete mode 100644 pc-bios/Makefile
Signature · 1 line
2.41.0
PATCH 1/10 meson: do not unnecessarily use cmake for dependencies
Both gvnc and sysprof-capture come with pkg-config files, so specify the method to find them.
--- tests/migration/meson.build | 2 +- tests/qtest/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tests/migration/meson.build +1 -1
@@ -1,4 +1,4 @@ -sysprof = dependency('sysprof-capture-4', required: false) +sysprof = dependency('sysprof-capture-4', method: 'pkg-config', required: false) glib_static = dependency('glib-2.0', version: glib_req_ver, required: false, method: 'pkg-config', static: true)
tests/qtest/meson.build +1 -1
@@ -321,7 +321,7 @@ qtests = { } if vnc.found() - gvnc = dependency('gvnc-1.0', required: false) + gvnc = dependency('gvnc-1.0', method: 'pkg-config', required: false) if gvnc.found() qtests += {'vnc-display-test': [gvnc]} qtests_generic += [ 'vnc-display-test' ]
Signature · 1 line
2.41.0
Re: [PATCH 01/10] meson: do not unnecessarily use cmake for dependencies
Quoted 8 lines · Paolo Bonzini
Both gvnc and sysprof-capture come with pkg-config files, so specify the method to find them.
Signed-off-by Paolo Bonzini <[email protected]>--- tests/migration/meson.build | 2 +- tests/qtest/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 2/10 meson: update unsupported host/CPU messages
In reply to Paolo BonziniUnsupported CPU and OSes are not really going away, but the project simply does not guarantee that they work. Rephrase the messages accordingly. While at it, move the warning for TCI performance at the end where it is more visible.
--- meson.build | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-)
meson.build +21 -17
@@ -678,9 +678,7 @@ endif tcg_arch = host_arch if get_option('tcg').allowed() if host_arch == 'unknown' - if get_option('tcg_interpreter') - warning('Unsupported CPU @0@, will use TCG with TCI (slow)'.format(cpu)) - else + if not get_option('tcg_interpreter') error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu)) endif elif get_option('tcg_interpreter')
@@ -4317,28 +4315,34 @@ summary_info += {'selinux': selinux} summary_info += {'libdw': libdw} summary(summary_info, bool_yn: true, section: 'Dependencies') -if not supported_cpus.contains(cpu) +if host_arch == 'unknown' message() - warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!') + warning('UNSUPPORTED HOST CPU') message() - message('CPU host architecture ' + cpu + ' support is not currently maintained.') - message('The QEMU project intends to remove support for this host CPU in') - message('a future release if nobody volunteers to maintain it and to') - message('provide a build host for our continuous integration setup.') - message('configure has succeeded and you can continue to build, but') - message('if you care about QEMU on this platform you should contact') - message('us upstream at [email protected].') + message('Support for CPU host architecture ' + cpu + ' is not currently') + message('maintained. The QEMU project does not guarantee that QEMU will') + message('compile or work on this host CPU. You can help by volunteering') + message('to maintain it and providing a build host for our continuous.') + message('integration setup.') endif if not supported_oses.contains(targetos) message() - warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!') + warning('UNSUPPORTED HOST OS') + message() + message('Support for host OS ' + targetos + 'is not currently maintained.') + message('The QEMU project does not guarantee that QEMU will compile or') + message('work on this operating system. You can help by volunteering') + message('to maintain it and providing a build host for our continuous.') + message('integration setup.') +endif + +if host_arch == 'unknown' or not supported_oses.contains(targetos) message() - message('Host OS ' + targetos + 'support is not currently maintained.') - message('The QEMU project intends to remove support for this host OS in') - message('a future release if nobody volunteers to maintain it and to') - message('provide a build host for our continuous integration setup.') message('configure has succeeded and you can continue to build, but') + if host_arch == 'unknown' and get_option('tcg').allowed() and target_dirs.length() > 0 + message('QEMU will use a slow interpreter to emulate the target CPU;') + endif message('if you care about QEMU on this platform you should contact') message('us upstream at [email protected].') endif
Signature · 1 line
2.41.0
Re: [PATCH 02/10] meson: update unsupported host/CPU messages
Quoted 4 lines · Paolo Bonzini
Unsupported CPU and OSes are not really going away, but the project simply does not guarantee that they work. Rephrase the messages accordingly. While at it, move the warning for TCI performance at the end where it is more visible.
I think I agree wrt to CPUs, but in the case of OS I think it is fairly accurate as-is.
When we bump the minimum version of libraries we will not pay attention to unsupported OS, so it is entirely possible to bump to a version that means the ability to run on an OS goes away entirely (unless the user is willing to rebuild packages at newer versions).
When writing #ifdefs for portability we also may explicitly delete #ifdefs from unsupported OS platforms if we consider them obsolete enough. So again I think the ability to use an unsupported OS may indeed goaway entirely.
Quoted 74 lines
Signed-off-by Paolo Bonzini <[email protected]>--- meson.build | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-)meson.build +21
-17@@ -678,9 +678,7 @@ endif tcg_arch = host_arch if get_option('tcg').allowed() if host_arch == 'unknown' - if get_option('tcg_interpreter') - warning('Unsupported CPU @0@, will use TCG with TCI (slow)'.format(cpu)) - else + if not get_option('tcg_interpreter') error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu)) endif elif get_option('tcg_interpreter')@@ -4317,28 +4315,34 @@ summary_info += {'selinux': selinux} summary_info += {'libdw': libdw} summary(summary_info, bool_yn: true, section: 'Dependencies') -if not supported_cpus.contains(cpu) +if host_arch == 'unknown' message() - warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!') + warning('UNSUPPORTED HOST CPU') message() - message('CPU host architecture ' + cpu + ' support is not currently maintained.') - message('The QEMU project intends to remove support for this host CPU in') - message('a future release if nobody volunteers to maintain it and to') - message('provide a build host for our continuous integration setup.') - message('configure has succeeded and you can continue to build, but') - message('if you care about QEMU on this platform you should contact') - message('us upstream at [email protected].') + message('Support for CPU host architecture ' + cpu + ' is not currently') + message('maintained. The QEMU project does not guarantee that QEMU will') + message('compile or work on this host CPU. You can help by volunteering') + message('to maintain it and providing a build host for our continuous.') + message('integration setup.') endif if not supported_oses.contains(targetos) message() - warning('WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!') + warning('UNSUPPORTED HOST OS') + message() + message('Support for host OS ' + targetos + 'is not currently maintained.') + message('The QEMU project does not guarantee that QEMU will compile or') + message('work on this operating system. You can help by volunteering') + message('to maintain it and providing a build host for our continuous.') + message('integration setup.') +endif + +if host_arch == 'unknown' or not supported_oses.contains(targetos) message() - message('Host OS ' + targetos + 'support is not currently maintained.') - message('The QEMU project intends to remove support for this host OS in') - message('a future release if nobody volunteers to maintain it and to') - message('provide a build host for our continuous integration setup.') message('configure has succeeded and you can continue to build, but') + if host_arch == 'unknown' and get_option('tcg').allowed() and target_dirs.length() > 0 + message('QEMU will use a slow interpreter to emulate the target CPU;') + endif message('if you care about QEMU on this platform you should contact') message('us upstream at [email protected].') endifSignature · 1 line
2.41.0
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH 02/10] meson: update unsupported host/CPU messages
Quoted 2 lines · Daniel P. Berrangé
I think I agree wrt to CPUs, but in the case of OS I think it is fairly accurate as-is.
Ok, I wanted to leave out the "*intends* to remove support" part, which is too strong; but I agree that keeping some kind of "support may go away in future releases unless you act" is a good idea.
Paolo
Re: [PATCH 02/10] meson: update unsupported host/CPU messages
Quoted 7 lines · Paolo Bonzini
Quoted 2 lines · Daniel P. Berrangé
I think I agree wrt to CPUs, but in the case of OS I think it is fairly accurate as-is.
Ok, I wanted to leave out the "*intends* to remove support" part, which is too strong; but I agree that keeping some kind of "support may go away in future releases unless you act" is a good idea.
Yeah, making the language a little more fuzzy would be ok.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 3/10 configure: remove HOST_CC
In reply to Paolo Bonzini$(HOST_CC) is only used to invoke the preprocessor, and $(CC) can be used instead now that there is a Tricore C compiler. Remove the variable from config-host.mak.
--- configure | 1 - tests/tcg/tricore/Makefile.softmmu-target | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
configure +0 -1
@@ -1794,7 +1794,6 @@ fi mkdir -p tests/tcg echo "# Automatically generated by configure - do not modify" > $config_host_mak echo "SRC_PATH=$source_path" >> $config_host_mak -echo "HOST_CC=$host_cc" >> $config_host_mak # versioned checked in the main config_host.mak above if test -n "$gdb_bin"; then
tests/tcg/tricore/Makefile.softmmu-target +1 -1
@@ -28,7 +28,7 @@ TESTS += test_context_save_areas.c.tst QEMU_OPTS += -M tricore_testboard -cpu tc27x -nographic -kernel %.pS: $(ASM_TESTS_PATH)/%.S - $(HOST_CC) -E -o $@ $< + $(CC) -E -o $@ $< %.o: %.pS $(AS) $(ASFLAGS) -o $@ $<
Signature · 1 line
2.41.0
Re: [PATCH 03/10] configure: remove HOST_CC
Quoted 9 lines · Paolo Bonzini
$(HOST_CC) is only used to invoke the preprocessor, and $(CC) can be used instead now that there is a Tricore C compiler. Remove the variable from config-host.mak.
Signed-off-by Paolo Bonzini <[email protected]>--- configure | 1 - tests/tcg/tricore/Makefile.softmmu-target | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH 03/10] configure: remove HOST_CC
In reply to Paolo BonziniQuoted 9 lines · Paolo Bonzini
$(HOST_CC) is only used to invoke the preprocessor, and $(CC) can be used instead now that there is a Tricore C compiler. Remove the variable from config-host.mak.
Signed-off-by Paolo Bonzini<[email protected]>--- configure | 1 - tests/tcg/tricore/Makefile.softmmu-target | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
r~
PATCH 4/10 configure: create native file with contents of $host_cc
In reply to Paolo BonziniThe argument of --host-cc is not obeyed when cross compiling. To avoid this issue, place it in a configuration file and pass it to meson with --native-file.
While at it, clarify that --host-cc is not obeyed anyway when _not_ cross compiling.
--- configure | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
configure +9 -2
@@ -922,7 +922,7 @@ Advanced options (experts only): --cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank [$cross_prefix] --cc=CC use C compiler CC [$cc] --host-cc=CC use C compiler CC [$host_cc] for code run at - build time + build time when cross compiling --cxx=CXX use C++ compiler CXX [$cxx] --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] --extra-cflags=CFLAGS append extra C compiler flags CFLAGS
@@ -1886,7 +1886,6 @@ if test "$skip_meson" = no; then echo "windres = [$(meson_quote $windres)]" >> $cross echo "windmc = [$(meson_quote $windmc)]" >> $cross if test "$cross_compile" = "yes"; then - cross_arg="--cross-file config-meson.cross" echo "[host_machine]" >> $cross echo "system = '$targetos'" >> $cross case "$cpu" in
@@ -1903,6 +1902,14 @@ if test "$skip_meson" = no; then else echo "endian = 'little'" >> $cross fi + cross_arg="--cross-file config-meson.cross" + + native="config-meson.native.new" + echo "# Automatically generated by configure - do not modify" > $native + echo "[binaries]" >> $native + echo "c = [$(meson_quote $host_cc)]" >> $native + mv $native config-meson.native + cross_arg="$cross_arg --native-file config-meson.native" else cross_arg="--native-file config-meson.cross" fi
Signature · 1 line
2.41.0
Re: [PATCH 04/10] configure: create native file with contents of $host_cc
Quoted 18 lines · Paolo Bonzini
The argument of --host-cc is not obeyed when cross compiling. To avoid this issue, place it in a configuration file and pass it to meson with --native-file.
While at it, clarify that --host-cc is not obeyed anyway when _not_ cross compiling.
Signed-off-by Paolo Bonzini <[email protected]>--- configure | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)configure +0
-0
configure Advanced options (experts only): · line 922
Quoted 1 line
configure +0
-0@@ -922,7 +922,7 @@ Advanced options (experts only): --cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be
blank [$cross_prefix]
Quoted 16 lines
configure +1
-2--cc=CC use C compiler CC [$cc] --host-cc=CC use C compiler CC [$host_cc] for code run at - build time + build time when cross compiling --cxx=CXX use C++ compiler CXX [$cxx] --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] --extra-cflags=CFLAGS append extra C compiler flags CFLAGS@@ -1886,7 +1886,6 @@ if test "$skip_meson" = no; then echo "windres = [$(meson_quote $windres)]" >> $cross echo "windmc = [$(meson_quote $windmc)]" >> $cross if test "$cross_compile" = "yes"; then - cross_arg="--cross-file config-meson.cross" echo "[host_machine]" >> $cross echo "system = '$targetos'" >> $cross case "$cpu" in
configure if test "$skip_meson" = no; then · line 1908
Quoted 7 lines
configure +4
-0@@ -1903,6 +1902,14 @@ if test "$skip_meson" = no; then else echo "endian = 'little'" >> $cross fi + cross_arg="--cross-file config-meson.cross" + + native="config-meson.native.new" + echo "# Automatically generated by configure - do not modify" >
$native
configure if test "$skip_meson" = no; then
Quoted 8 lines
configure +4
-1+ echo "[binaries]" >> $native + echo "c = [$(meson_quote $host_cc)]" >> $native + mv $native config-meson.native + cross_arg="$cross_arg --native-file config-meson.native" else cross_arg="--native-file config-meson.cross" fi --
thanks
-- PMM
Re: [PATCH 04/10] configure: create native file with contents of $host_cc
In reply to Paolo BonziniQuoted 6 lines · Paolo Bonzini
The argument of --host-cc is not obeyed when cross compiling. To avoid this issue, place it in a configuration file and pass it to meson with --native-file.
While at it, clarify that --host-cc is not obeyed anyway when _not_ cross compiling.
I presume that's refering to this piece of code
if test -z "${CC}${cross_prefix}"; then
cc="$host_cc"
else
cc="${CC-${cross_prefix}gcc}"
fi
which is using $host_cc *before* --host-cc is processed, thus meaning it is always at its default value of 'cc'.
Perhaps the above code snippet should just be changed to
if test -z "${CC}${cross_prefix}"; then
cc="cc"
else
cc="${CC-${cross_prefix}gcc}"
fito make it clear that we were not intending to honour the --host-cc value for this code.
Quoted 5 lines
Signed-off-by Paolo Bonzini <[email protected]>--- configure | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
None the less, this patch is correct, so with or without that above change:
Quoted 41 lines
configure +9
-2@@ -922,7 +922,7 @@ Advanced options (experts only): --cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank [$cross_prefix] --cc=CC use C compiler CC [$cc] --host-cc=CC use C compiler CC [$host_cc] for code run at - build time + build time when cross compiling --cxx=CXX use C++ compiler CXX [$cxx] --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] --extra-cflags=CFLAGS append extra C compiler flags CFLAGS@@ -1886,7 +1886,6 @@ if test "$skip_meson" = no; then echo "windres = [$(meson_quote $windres)]" >> $cross echo "windmc = [$(meson_quote $windmc)]" >> $cross if test "$cross_compile" = "yes"; then - cross_arg="--cross-file config-meson.cross" echo "[host_machine]" >> $cross echo "system = '$targetos'" >> $cross case "$cpu" in@@ -1903,6 +1902,14 @@ if test "$skip_meson" = no; then else echo "endian = 'little'" >> $cross fi + cross_arg="--cross-file config-meson.cross" + + native="config-meson.native.new" + echo "# Automatically generated by configure - do not modify" > $native + echo "[binaries]" >> $native + echo "c = [$(meson_quote $host_cc)]" >> $native + mv $native config-meson.native + cross_arg="$cross_arg --native-file config-meson.native" else cross_arg="--native-file config-meson.cross" fiSignature · 1 line
2.41.0
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH 04/10] configure: create native file with contents of $host_cc
Quoted 11 lines · Daniel P. Berrangé
Quoted 6 lines · Paolo Bonzini
The argument of --host-cc is not obeyed when cross compiling. To avoid this issue, place it in a configuration file and pass it to meson with --native-file.
While at it, clarify that --host-cc is not obeyed anyway when _not_ cross compiling.
I presume that's refering to this piece of code
Quoted 8 lines
if test -z "${CC}${cross_prefix}"; then
cc="$host_cc"
else
cc="${CC-${cross_prefix}gcc}"
fiwhich is using $host_cc *before* --host-cc is processed, thus meaning it is always at its default value of 'cc'.
That, plus the fact that --native-file is only used in cross compilation scenarios; when doing a native compilation there's no difference between "native: true" and "native: false" as far as Meson is concerned.
Quoted 10 lines
Perhaps the above code snippet should just be changed to
if test -z "${CC}${cross_prefix}"; then cc="cc" else cc="${CC-${cross_prefix}gcc}" fito make it clear that we were not intending to honour the --host-cc value for this code.
Since I have to send a v2 anyway for the (un)supported OS message, I'll do the change.
Paolo
Re: [PATCH 04/10] configure: create native file with contents of $host_cc
In reply to Paolo BonziniQuoted 11 lines · Paolo Bonzini
The argument of --host-cc is not obeyed when cross compiling. To avoid this issue, place it in a configuration file and pass it to meson with --native-file.
While at it, clarify that --host-cc is not obeyed anyway
when_not_cross compiling.Signed-off-by Paolo Bonzini<[email protected]>--- configure | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
r~
PATCH 5/10 meson: compile bundled device trees
In reply to Paolo BonziniIf dtc is available, compile the .dts files in the pc-bios directory instead of using the precompiled binaries.
--- pc-bios/Makefile | 19 ------------------- pc-bios/meson.build | 25 +++++++++++++++++++++---- 2 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 pc-bios/Makefile
pc-bios/Makefile deleted +0 -19
@@ -1,19 +0,0 @@ -# -# NOTE: only compilable with x86 cross compile tools -# -include ../config-host.mak - -DEFINES= - -TARGETS= - -all: $(TARGETS) - -%.o: %.S - $(CC) $(DEFINES) -c -o $@ $< - -%.dtb: %.dts - dtc -I dts -O dtb -o $@ $< - -clean: - rm -f $(TARGETS) *.o *~
pc-bios/meson.build +21 -4
@@ -57,10 +57,6 @@ blobs = [ 'efi-e1000e.rom', 'efi-vmxnet3.rom', 'qemu-nsis.bmp', - 'bamboo.dtb', - 'canyonlands.dtb', - 'petalogix-s3adsp1800.dtb', - 'petalogix-ml605.dtb', 'multiboot.bin', 'multiboot_dma.bin', 'linuxboot.bin',
@@ -84,6 +80,27 @@ blobs = [ 'vof-nvram.bin', ] +dtc = find_program('dtc', required: false) +foreach f : [ + 'bamboo.dts', + 'canyonlands.dts', + 'petalogix-s3adsp1800.dts', + 'petalogix-ml605.dts', +] + out = fs.replace_suffix(f, '.dtb') + if dtc.found() + custom_target(f, + build_by_default: have_system, + input: files(f), + output: out, + install: get_option('install_blobs'), + install_dir: qemu_datadir, + command: [ dtc, '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT0@' ]) + else + blobs += out + endif +endforeach + if get_option('install_blobs') install_data(blobs, install_dir: qemu_datadir) endif
Signature · 1 line
2.41.0
Re: [PATCH 05/10] meson: compile bundled device trees
Quoted 11 lines · Paolo Bonzini
If dtc is available, compile the .dts files in the pc-bios directory instead of using the precompiled binaries.
Signed-off-by Paolo Bonzini <[email protected]>--- pc-bios/Makefile | 19 ------------------- pc-bios/meson.build | 25 +++++++++++++++++++++---- 2 files changed, 21 insertions(+), 23 deletions(-)delete mode 100644 pc-bios/Makefile
pc-bios/meson.build blobs = [ · line 90
Quoted 8 lines
pc-bios/meson.build +8
-0+dtc = find_program('dtc', required: false) +foreach f : [ + 'bamboo.dts', + 'canyonlands.dts', + 'petalogix-s3adsp1800.dts', + 'petalogix-ml605.dts', +] + out = fs.replace_suffix(f, '.dtb')
Does that work when building from read-only source directory?
Quoted 16 lines
pc-bios/meson.build +13
-0+ if dtc.found() + custom_target(f, + build_by_default: have_system, + input: files(f), + output: out, + install: get_option('install_blobs'), + install_dir: qemu_datadir, + command: [ dtc, '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT0@' ]) + else + blobs += out + endif +endforeach + if get_option('install_blobs') install_data(blobs, install_dir: qemu_datadir) endif
Re: [PATCH 05/10] meson: compile bundled device trees
Quoted 12 lines · Philippe Mathieu-Daudé
Quoted 9 lines · Paolo Bonzini
If dtc is available, compile the .dts files in the pc-bios directory instead of using the precompiled binaries.
Signed-off-by Paolo Bonzini <[email protected]>---
pc-bios/Makefile | 19 ------------------- pc-bios/meson.build | 25 +++++++++++++++++++++----2 files changed, 21 insertions(+), 23 deletions(-)delete mode 100644 pc-bios/Makefile
Quoted 16 lines
pc-bios/meson.build blobs = [ · line 90
Quoted 8 lines
pc-bios/meson.build +8
-0+dtc = find_program('dtc', required: false) +foreach f : [ + 'bamboo.dts', + 'canyonlands.dts', + 'petalogix-s3adsp1800.dts', + 'petalogix-ml605.dts', +] + out = fs.replace_suffix(f, '.dtb')Does that work when building from read-only source directory?
Quoted 5 lines
+ if
dtc.found()
+ custom_target(f,
+build_by_default:have_system,
+ input: files(f),
+ output: out,
Yes, because the output will be in the build directory, and installed from there,
Quoted 5 lines
Quoted 5 lines
+ install:
get_option('install_blobs'),
+install_dir:qemu_datadir,
+ command: [ dtc, '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT0@' ]) + else
+ blobs += out
whereas the fallback case copies from the source directory.
r~
Quoted 8 lines
Quoted 6 lines
+ endif
pc-bios/meson.build +2
-0+endforeach +if
get_option('install_blobs')install_data(blobs, install_dir: qemu_datadir)endif
Re: [PATCH 05/10] meson: compile bundled device trees
In reply to Paolo BonziniQuoted 9 lines · Paolo Bonzini
If dtc is available, compile the .dts files in the pc-bios directory instead of using the precompiled binaries.
Signed-off-by Paolo Bonzini<[email protected]>--- pc-bios/Makefile | 19 ------------------- pc-bios/meson.build | 25 +++++++++++++++++++++---- 2 files changed, 21 insertions(+), 23 deletions(-)delete mode 100644 pc-bios/Makefile
r~
PATCH 6/10 contrib/plugins: use an independent makefile
In reply to Paolo BonziniThe initial reason to write this patch was to remove the last use of CONFIG_DEBUG_TCG from the makefiles; the flags to use to build TCG plugins are unrelated to --enable-debug-tcg, and instead they should be the same as those used to build emulators (the plugins are not build via meson for demonstration reasons only).
However, since contrib/plugins/Makefile is also the last case of doing a compilation job using config-host.mak, go a step further and make it use a completely separate configuration file, removing all references to compilers from the toplevel config-host.mak. Clean up references to empty variables, and use .SECONDARY so that intermediate object files are not deleted.
--- configure | 12 +++++++++--- contrib/plugins/Makefile | 18 +++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-)
configure +9 -3
@@ -245,7 +245,7 @@ for opt do esac done - +default_cflags='-O2 -g' git_submodules_action="update" git="git" debug_tcg="no"
@@ -768,6 +768,7 @@ for opt do meson_option_parse --enable-debug-graph-lock "" meson_option_parse --enable-debug-mutex "" meson_option_add -Doptimization=0 + default_cflags='-O0 -g' ;; --disable-tcg) tcg="disabled" plugins="no"
@@ -1763,8 +1764,6 @@ echo "PYTHON=$python" >> $config_host_mak echo "GENISOIMAGE=$genisoimage" >> $config_host_mak echo "MESON=$meson" >> $config_host_mak echo "NINJA=$ninja" >> $config_host_mak -echo "PKG_CONFIG=${pkg_config}" >> $config_host_mak -echo "CC=$cc" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak # use included Linux headers for KVM architectures
@@ -1789,6 +1788,13 @@ if test "$ccache_cpp2" = "yes"; then echo "export CCACHE_CPP2=y" >> $config_host_mak fi +# contrib/plugins configuration +echo "# Automatically generated by configure - do not modify" > contrib/plugins/$config_host_mak +echo "SRC_PATH=$source_path/contrib/plugins" >> contrib/plugins/$config_host_mak +echo "PKG_CONFIG=${pkg_config}" >> $config_host_mak +echo "CC=$cc $CPU_CFLAGS" >> contrib/plugins/$config_host_mak +echo "CFLAGS=${CFLAGS-$default_cflags} $EXTRA_CFLAGS" >> contrib/plugins/$config_host_mak + # tests/tcg configuration (config_host_mak=tests/tcg/config-host.mak mkdir -p tests/tcg
contrib/plugins/Makefile +9 -9
@@ -6,11 +6,11 @@ # programs that the main configure has already done for us. # -BUILD_DIR := $(CURDIR)/../.. +include config-host.mak -include $(BUILD_DIR)/config-host.mak +TOP_SRC_PATH = $(SRC_PATH)/../.. -VPATH += $(SRC_PATH)/contrib/plugins +VPATH += $(SRC_PATH) NAMES := NAMES += execlog
@@ -26,21 +26,21 @@ SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) # The main QEMU uses Glib extensively so it's perfectly fine to use it # in plugins (which many example do). -CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0) -CFLAGS += -fPIC -Wall -CFLAGS += $(if $(CONFIG_DEBUG_TCG), -ggdb -O0) -CFLAGS += -I$(SRC_PATH)/include/qemu +PLUGIN_CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0) +PLUGIN_CFLAGS += -fPIC -Wall +PLUGIN_CFLAGS += -I$(TOP_SRC_PATH)/include/qemu all: $(SONAMES) %.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) $(PLUGIN_CFLAGS) -c -o $@ $< lib%.so: %.o - $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS) + $(CC) -shared -Wl,-soname,$@ -o $@ $^ clean: rm -f *.o *.so *.d rm -Rf .libs .PHONY: all clean +.SECONDARY:
Signature · 1 line
2.41.0
Re: [PATCH 06/10] contrib/plugins: use an independent makefile
Quoted 13 lines · Paolo Bonzini
The initial reason to write this patch was to remove the last use of
CONFIG_DEBUG_TCGfrom the makefiles; the flags to use to build TCG plugins are unrelated to --enable-debug-tcg, and instead they should be the same as those used to build emulators (the plugins are not build via meson for demonstration reasons only).However, since contrib/plugins/Makefile is also the last case of doing a compilation job using config-host.mak, go a step further and make it use a completely separate configuration file, removing all references to compilers from the toplevel config-host.mak. Clean up references to empty variables, and use .SECONDARY so that intermediate object files are not deleted.
Quoted 5 lines
Signed-off-by Paolo Bonzini <[email protected]>--- configure | 12 +++++++++--- contrib/plugins/Makefile | 18 +++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-)
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 7/10 meson: do not use config_host to pick tap implementations
In reply to Paolo BonziniThe target OS is invariant and does not depend on the configuration, so move away from config_host and just use unconditional rules in softmmu_ss.
--- net/meson.build | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
net/meson.build +10 -8
@@ -41,15 +41,17 @@ if have_vhost_net_user system_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-user-stub.c')) endif -system_ss.add(when: 'CONFIG_LINUX', if_true: files('tap-linux.c')) -system_ss.add(when: 'CONFIG_BSD', if_true: files('tap-bsd.c')) -system_ss.add(when: 'CONFIG_SOLARIS', if_true: files('tap-solaris.c')) -tap_posix = ['tap.c'] -if not config_host.has_key('CONFIG_LINUX') and not config_host.has_key('CONFIG_BSD') and not config_host.has_key('CONFIG_SOLARIS') - tap_posix += 'tap-stub.c' +if targetos == 'windows' + system_ss.add(files('tap-win32.c')) +elif targetos == 'linux' + system_ss.add(files('tap.c', 'tap-linux.c')) +elif targetos in bsd_oses + system_ss.add(files('tap.c', 'tap-bsd.c')) +elif targetos == 'solaris' + system_ss.add(files('tap.c', 'tap-solaris.c')) +else + system_ss.add(files('tap.c', 'tap-stub.c')) endif -system_ss.add(when: 'CONFIG_POSIX', if_true: files(tap_posix)) -system_ss.add(when: 'CONFIG_WIN32', if_true: files('tap-win32.c')) if have_vhost_net_vdpa system_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-vdpa.c'), if_false: files('vhost-vdpa-stub.c')) system_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-vdpa-stub.c'))
Signature · 1 line
2.41.0
Re: [PATCH 07/10] meson: do not use config_host to pick tap implementations
Quoted 7 lines · Paolo Bonzini
The target OS is invariant and does not depend on the configuration, so move away from
config_hostand just use unconditional rules insoftmmu_ss.Signed-off-by Paolo Bonzini <[email protected]>--- net/meson.build | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
Nice.
Re: [PATCH 07/10] meson: do not use config_host to pick tap implementations
In reply to Paolo BonziniQuoted 7 lines · Paolo Bonzini
The target OS is invariant and does not depend on the configuration, so move away from
config_hostand just use unconditional rules insoftmmu_ss.Signed-off-by Paolo Bonzini <[email protected]>--- net/meson.build | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 8/10 configure, meson: move simple OS definitions to meson
In reply to Paolo BonziniCONFIG_DARWIN and CONFIG_SOLARIS are only used in C sources. Move them to config_host_data.
--- configure | 12 ------------ hw/9pfs/meson.build | 4 +++- meson.build | 2 ++ 3 files changed, 5 insertions(+), 13 deletions(-)
configure +0 -12
@@ -377,7 +377,6 @@ fi mingw32="no" bsd="no" linux="no" -solaris="no" case $targetos in windows) mingw32="yes"
@@ -402,10 +401,6 @@ openbsd) ;; darwin) bsd="yes" - darwin="yes" -;; -sunos) - solaris="yes" ;; haiku) pie="no"
@@ -1726,13 +1721,6 @@ if test "$linux" = "yes" ; then echo "CONFIG_LINUX=y" >> $config_host_mak fi -if test "$darwin" = "yes" ; then - echo "CONFIG_DARWIN=y" >> $config_host_mak -fi - -if test "$solaris" = "yes" ; then - echo "CONFIG_SOLARIS=y" >> $config_host_mak -fi echo "SRC_PATH=$source_path" >> $config_host_mak echo "TARGET_DIRS=$target_list" >> $config_host_mak
hw/9pfs/meson.build +3 -1
@@ -14,7 +14,9 @@ fs_ss.add(files( 'coxattr.c', )) fs_ss.add(when: 'CONFIG_LINUX', if_true: files('9p-util-linux.c')) -fs_ss.add(when: 'CONFIG_DARWIN', if_true: files('9p-util-darwin.c')) +if targetos == 'darwin' + fs_ss.add(files('9p-util-darwin.c')) +endif fs_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-9p-backend.c')) system_ss.add_all(when: 'CONFIG_FSDEV_9P', if_true: fs_ss)
meson.build +2 -0
@@ -2070,6 +2070,7 @@ config_host_data.set('CONFIG_ATTR', libattr.found()) config_host_data.set('CONFIG_BDRV_WHITELIST_TOOLS', get_option('block_drv_whitelist_in_tools')) config_host_data.set('CONFIG_BRLAPI', brlapi.found()) config_host_data.set('CONFIG_COCOA', cocoa.found()) +config_host_data.set('CONFIG_DARWIN', targetos == 'darwin') config_host_data.set('CONFIG_FUZZ', get_option('fuzzing')) config_host_data.set('CONFIG_GCOV', get_option('b_coverage')) config_host_data.set('CONFIG_LIBUDEV', libudev.found())
@@ -2125,6 +2126,7 @@ if seccomp.found() config_host_data.set('CONFIG_SECCOMP_SYSRAWRC', seccomp_has_sysrawrc) endif config_host_data.set('CONFIG_SNAPPY', snappy.found()) +config_host_data.set('CONFIG_SOLARIS', targetos == 'sunos') config_host_data.set('CONFIG_TPM', have_tpm) config_host_data.set('CONFIG_TSAN', get_option('tsan')) config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())
Signature · 1 line
2.41.0
Re: [PATCH 08/10] configure, meson: move simple OS definitions to meson
Quoted 9 lines · Paolo Bonzini
CONFIG_DARWINandCONFIG_SOLARISare only used in C sources. Move them toconfig_host_data.Signed-off-by Paolo Bonzini <[email protected]>--- configure | 12 ------------ hw/9pfs/meson.build | 4 +++- meson.build | 2 ++ 3 files changed, 5 insertions(+), 13 deletions(-)
PATCH 9/10 configure: remove $linux and $mingw32 variables
In reply to Paolo BonziniJust use $targetos always.
--- configure | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
configure +6 -12
@@ -374,12 +374,9 @@ fi # OS specific -mingw32="no" bsd="no" -linux="no" case $targetos in windows) - mingw32="yes" plugins="no" pie="no" ;;
@@ -405,9 +402,6 @@ darwin) haiku) pie="no" ;; -linux) - linux="yes" -;; esac if test ! -z "$cpu" ; then
@@ -622,7 +616,7 @@ do fi done -if test "$mingw32" = "yes" ; then +if test "$targetos" = "windows" ; then EXESUF=".exe" prefix="/qemu" bindir=""
@@ -805,7 +799,7 @@ for opt do ;; --enable-download) download="enabled"; git_submodules_action=update; ;; - --enable-plugins) if test "$mingw32" = "yes"; then + --enable-plugins) if test "$targetos" = "windows"; then error_exit "TCG plugins not currently supported on Windows platforms" else plugins="yes"
@@ -1070,7 +1064,7 @@ fi # by default. Only enable by default for git builds if test -z "$werror" ; then if test -e "$source_path/.git" && \ - { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then + { test "$targetos" = linux || test "$targetos" = "windows"; }; then werror="yes" else werror="no"
@@ -1708,7 +1702,7 @@ echo all: >> $config_host_mak if test "$debug_tcg" = "yes" ; then echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak fi -if test "$mingw32" = "yes" ; then +if test "$targetos" = "windows"; then echo "CONFIG_WIN32=y" >> $config_host_mak echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER-QEMU}" >> $config_host_mak echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO-Linux}" >> $config_host_mak
@@ -1717,7 +1711,7 @@ else echo "CONFIG_POSIX=y" >> $config_host_mak fi -if test "$linux" = "yes" ; then +if test "$targetos" = "linux" ; then echo "CONFIG_LINUX=y" >> $config_host_mak fi
@@ -1755,7 +1749,7 @@ echo "NINJA=$ninja" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak # use included Linux headers for KVM architectures -if test "$linux" = "yes" && test -n "$linux_arch"; then +if test "$targetos" = "linux" && test -n "$linux_arch"; then symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm fi
Signature · 1 line
2.41.0
Re: [PATCH 09/10] configure: remove $linux and $mingw32 variables
Quoted 6 lines · Paolo Bonzini
Just use $targetos always.
Signed-off-by Paolo Bonzini <[email protected]>--- configure | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
Re: [PATCH 09/10] configure: remove $linux and $mingw32 variables
In reply to Paolo BonziniQuoted 6 lines · Paolo Bonzini
Just use $targetos always.
Signed-off-by Paolo Bonzini <[email protected]>--- configure | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH 10/10 configure: move --enable-debug-tcg to meson
In reply to Paolo Bonzini--- configure | 11 +---------- meson.build | 3 ++- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 8 insertions(+), 11 deletions(-)
configure +1 -10
@@ -248,7 +248,6 @@ done default_cflags='-O2 -g' git_submodules_action="update" git="git" -debug_tcg="no" docs="auto" EXESUF="" prefix="/usr/local"
@@ -747,13 +746,9 @@ for opt do # configure to be used by RPM and similar macros that set # lots of directory switches by default. ;; - --enable-debug-tcg) debug_tcg="yes" - ;; - --disable-debug-tcg) debug_tcg="no" - ;; --enable-debug) # Enable debugging options that aren't excessively noisy - debug_tcg="yes" + meson_option_parse --enable-debug-tcg "" meson_option_parse --enable-debug-graph-lock "" meson_option_parse --enable-debug-mutex "" meson_option_add -Doptimization=0
@@ -948,7 +943,6 @@ cat << EOF linux-user all linux usermode emulation targets bsd-user all BSD usermode emulation targets pie Position Independent Executables - debug-tcg TCG debugging (default is disabled) NOTE: The object files are built at the place where configure is launched EOF
@@ -1699,9 +1693,6 @@ echo >> $config_host_mak echo all: >> $config_host_mak -if test "$debug_tcg" = "yes" ; then - echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak -fi if test "$targetos" = "windows"; then echo "CONFIG_WIN32=y" >> $config_host_mak echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER-QEMU}" >> $config_host_mak
meson.build +2 -1
@@ -2201,6 +2201,7 @@ config_host_data.set10('CONFIG_COROUTINE_POOL', have_coroutine_pool) config_host_data.set('CONFIG_DEBUG_GRAPH_LOCK', get_option('debug_graph_lock')) config_host_data.set('CONFIG_DEBUG_MUTEX', get_option('debug_mutex')) config_host_data.set('CONFIG_DEBUG_STACK_USAGE', get_option('debug_stack_usage')) +config_host_data.set('CONFIG_DEBUG_TCG', get_option('debug_tcg')) config_host_data.set('CONFIG_GPROF', get_option('gprof')) config_host_data.set('CONFIG_LIVE_BLOCK_MIGRATION', get_option('live_block_migration').allowed()) config_host_data.set('CONFIG_QOM_CAST_DEBUG', get_option('qom_cast_debug'))
@@ -4158,7 +4159,7 @@ if config_all.has_key('CONFIG_TCG') summary_info += {'TCG backend': 'native (@0@)'.format(cpu)} endif summary_info += {'TCG plugins': config_host.has_key('CONFIG_PLUGIN')} - summary_info += {'TCG debug enabled': config_host.has_key('CONFIG_DEBUG_TCG')} + summary_info += {'TCG debug enabled': get_option('debug_tcg')} endif summary_info += {'target list': ' '.join(target_dirs)} if have_system
meson_options.txt +2 -0
@@ -83,6 +83,8 @@ option('xen_pci_passthrough', type: 'feature', value: 'auto', description: 'Xen PCI passthrough support') option('tcg', type: 'feature', value: 'enabled', description: 'TCG support') +option('debug_tcg', type: 'boolean', value: false, + description: 'TCG debugging') option('tcg_interpreter', type: 'boolean', value: false, description: 'TCG with bytecode interpreter (slow)') option('safe_stack', type: 'boolean', value: false,
scripts/meson-buildoptions.sh +3 -0
@@ -29,6 +29,7 @@ meson_options_help() { printf "%s\n" ' --enable-debug-mutex mutex debugging support' printf "%s\n" ' --enable-debug-stack-usage' printf "%s\n" ' measure coroutine stack usage' + printf "%s\n" ' --enable-debug-tcg TCG debugging' printf "%s\n" ' --enable-fdt[=CHOICE] Whether and how to find the libfdt library' printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)' printf "%s\n" ' --enable-fuzzing build fuzzing targets'
@@ -276,6 +277,8 @@ _meson_option_parse() { --disable-debug-mutex) printf "%s" -Ddebug_mutex=false ;; --enable-debug-stack-usage) printf "%s" -Ddebug_stack_usage=true ;; --disable-debug-stack-usage) printf "%s" -Ddebug_stack_usage=false ;; + --enable-debug-tcg) printf "%s" -Ddebug_tcg=true ;; + --disable-debug-tcg) printf "%s" -Ddebug_tcg=false ;; --enable-dmg) printf "%s" -Ddmg=enabled ;; --disable-dmg) printf "%s" -Ddmg=disabled ;; --docdir=*) quote_sh "-Ddocdir=$2" ;;
Signature · 1 line
2.41.0
Re: [PATCH 10/10] configure: move --enable-debug-tcg to meson
Quoted 8 lines · Paolo Bonzini
Signed-off-by Paolo Bonzini <[email protected]>--- configure | 11 +---------- meson.build | 3 ++- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 8 insertions(+), 11 deletions(-)
thanks
-- PMM
Re: [PATCH 10/10] configure: move --enable-debug-tcg to meson
In reply to Paolo BonziniQuoted 7 lines · Paolo Bonzini
Signed-off-by Paolo Bonzini<[email protected]>--- configure | 11 +---------- meson.build | 3 ++- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 8 insertions(+), 11 deletions(-)
r~
Re: [PATCH 10/10] configure: move --enable-debug-tcg to meson
In reply to Paolo BonziniQuoted 7 lines · Paolo Bonzini
Signed-off-by Paolo Bonzini <[email protected]>--- configure | 11 +---------- meson.build | 3 ++- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 8 insertions(+), 11 deletions(-)