[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v6 5/5] rust: add PL011 device model
|
From: |
Paolo Bonzini |
|
Subject: |
Re: [RFC PATCH v6 5/5] rust: add PL011 device model |
|
Date: |
Thu, 8 Aug 2024 10:31:48 +0200 |
|
User-agent: |
Mozilla Thunderbird |
On 8/4/24 23:04, Manos Pitsidianakis wrote:
diff --git a/rust/hw/char/pl011/meson.build b/rust/hw/char/pl011/meson.build
new file mode 100644
index 0000000000..a17a823cf5
--- /dev/null
+++ b/rust/hw/char/pl011/meson.build
@@ -0,0 +1,28 @@
+if not config_host_data.get('CONFIG_HAVE_RUST')
+ subdir_done()
+endif
+
+add_languages('rust', required: true)
These five lines are not necessary.
+arbitrary_int_dep =
subproject('arbitrary-int').get_variable('arbitrary_int_dep')
+bilge_dep = subproject('bilge').get_variable('bilge_dep')
+bilge_impl_dep = subproject('bilge-impl').get_variable('bilge_impl_dep')
The subprojects also need to be added to scripts/archive-source.sh and
scripts/make-release.
In order to simplify a future switch to Cargo projects, this should be
something like:
subproject('bilge-0.2-rs', required: true)
subproject('bilge-impl-0.2-rs', required: true)
bilge_dep = dependency('bilge-0.2-rs')
bilge_impl_dep = dependency('bilge-impl-0.2-rs')
with a corresponding
meson.override_dependency('bilge-0.2-rs', bilge_dep)
in subprojects/packagefiles/bilge-0.2-rs/meson.build.
Also in bilge's meson.build:
+arbitrary_int_dep =
subproject('arbitrary-int').get_variable('arbitrary_int_dep')
+bilge_impl_dep = subproject('bilge-impl').get_variable('bilge_impl_dep')
+
+lib = static_library(
+ 'bilge',
+ 'src/lib.rs',
+ override_options : ['rust_std=2021', 'build.rust_std=2021'],
+ rust_abi : 'rust',
+ native : true,
+ dependencies: [
native should not be true here (but it should be true for the
dependencies of bilge-impl: either, itertools, proc-macro-error,
proc-macro-error-attr, proc-macro2, quote, syn, unicode-ident).
I've placed my updates at a branch "rust-for-manos" of
https://gitlab.com/bonzini/qemu/. I left the fixes unsquashed for your
review, but feel free to merge them and post the result as part of v7.
Paolo
- [RFC PATCH v6 0/5] rust-pl011-rfc-v6, Manos Pitsidianakis, 2024/08/04
- [RFC PATCH v6 1/5] build-sys: Add rust feature option, Manos Pitsidianakis, 2024/08/04
- [RFC PATCH v6 3/5] .gitattributes: add Rust diff and merge attributes, Manos Pitsidianakis, 2024/08/04
- [RFC PATCH v6 2/5] rust: add bindgen step as a meson dependency, Manos Pitsidianakis, 2024/08/04
- [RFC PATCH v6 4/5] rust: add crate to expose bindings and interfaces, Manos Pitsidianakis, 2024/08/04
- [RFC PATCH v6 5/5] rust: add PL011 device model, Manos Pitsidianakis, 2024/08/04
- Re: [RFC PATCH v6 5/5] rust: add PL011 device model,
Paolo Bonzini <=
- Re: [RFC PATCH v6 0/5] rust-pl011-rfc-v6, Paolo Bonzini, 2024/08/08