]> git.ipfire.org Git - thirdparty/qemu.git/commit
qdev: add hw/core/gpio.c to libhwcore
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 14 Jan 2026 16:34:10 +0000 (17:34 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 27 Jan 2026 07:57:52 +0000 (08:57 +0100)
commitfe367cbe398a526fc70693fe8bebee1ead325deb
treec6f95cfee62753c111b100546032ef2bfab1f5e1
parent1713498c0d7f41ce81387e47d60db0d8420f6233
qdev: add hw/core/gpio.c to libhwcore

While GPIO functionality is not used by user-mode emulation, it is
conceptually part of qdev - GPIO pins are included in DeviceState
independent of whether this is system or user-mode emulation.

For the Rust bindings, having GPIO functionality in system_ss causes
a problem because, for simplicity, all methods of DeviceState are
included in the Rust hwcore crate.  On Windows, rustc is not able
to do dead code elimination as well as on other OSes and this causes
an undefined symbol error, because gpio.c is not linked into the
rust/hw/core/rust-hwcore-rs-integration test binary.

To fix it, move gpio.c out of system_ss and into libhwcore.
Alternatively, it would be possible to define some DeviceState
methods also in the system crate, using for example a separate trace
SystemDeviceMethods.  For now, keep all the methods in one crate and
link 200 unused lines of code into user-mode emulators.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/core/meson.build