On Wed, 19 Jun 2024 06:31, Richard Henderson <richard.hender...@linaro.org>
wrote:
On 6/11/24 03:33, Manos Pitsidianakis wrote:
If `cargo` and `bindgen` is installed in your system, you should be able
to build qemu-system-aarch64 with configure flag --enable-rust and
launch an arm virt VM. One of the patches hardcodes the default UART of
the machine to the Rust one, so if something goes wrong you will see it
upon launching qemu-system-aarch64.
What version is required?
On my stock ubuntu 22.04 system, I get
/usr/bin/bindgen aarch64-softmmu_wrapper.h ...
error: Found argument '--formatter' which wasn't expected, or isn't valid in
this context
USAGE:
bindgen [FLAGS] [OPTIONS] <header> -- <clang-args>...
$ bindgen --version
bindgen 0.59.1
I added version checks in the (yet unpublished) next version:
(Which we will also need to match with distro ones whenever possible)
+# FIXME: Latest stable versions, refine to actual minimum ones.
+msrv = {
+ 'rustc': '1.79.0',
+ 'cargo': '1.79.0',
+ 'bindgen': '0.69.4',
+}
+
+# rustup = find_program('rustup', required: false)
+foreach bin_dep: msrv.keys()
+ bin = find_program(bin_dep, required: true)
+ if bin.version() < msrv[bin_dep]
+ # TODO verify behavior
+ if bin == 'bindgen' and get_option('wrap_mode') != 'nodownload'
+ run_command(cargo, 'install', 'bindgen', capture: true, check: true)
+ bin = find_program(bin_dep, required: true)
+ if bin.version() >= msrv[bin_dep]
+ continue
+ endif
+ endif
+ message()
+ error(bin_dep + ' version ' + bin.version() + ' is unsupported: Please
upgrade to at least ' + msrv[bin_dep])
+ endif
+endforeach