On Wed, 04 Sep 2024 14:01, Paolo Bonzini <pbonz...@redhat.com> wrote:
On Wed, Aug 28, 2024 at 6:12 AM Manos Pitsidianakis
<manos.pitsidiana...@linaro.org> wrote:

Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and
provides some declaration macros for symbols visible to the rest of
QEMU.

The only comment I have is that I would drop the allocator support
completely. It adds complications and, at least initially, we can
plan/hope that all cross-language allocations go through a constructor
function like error_setg() or object_new().

In the case of QOM, if we wanted to allocate objects in a Box rather
than malloc-ed memory, we could also put in the object a free function
that calls

  mem::drop(Box::from_raw(p))

Fixing rust.bindgen() to use the right CLANG_PATH/LIBCLANG_PATH should
probably be done in meson itself. The (not too hard) alternative is to
just use a custom_target.

Can we get the include directories of common_ss.all_dependencies() for a custom_target? Meson does this:

 for de in kwargs['dependencies']:
     for i in de.get_include_dirs():
         clang_args.extend([f'-I{x}' for x in i.to_string_list(
             state.environment.get_source_dir(), 
state.environment.get_build_dir())])
     clang_args.extend(de.get_all_compile_args())
     for s in de.get_sources():
         if isinstance(s, File):
             depend_files.append(s)
         elif isinstance(s, CustomTarget):
             depends.append(s)

But I think the functionality to extract this info from dep objects is not exposed to meson.build files.

Reply via email to