From c53a56a8f734da5caabb0b24b8907aee2f2ac510 Mon Sep 17 00:00:00 2001 From: Alwalid Salama Date: Fri, 19 Jun 2026 10:29:58 +0200 Subject: [PATCH 1/2] glib_shim: add opaque GLib type declarations - Add a small glib.h shim under qemu-components/common/include/glib_shim with opaque forward-decls of GArray and GByteArray. libqemu's typedefs.h is wrapped in extern "C" and pulls in qemu-plugin.h, which itself includes . Signed-off-by: Alwalid Salama --- CMakeLists.txt | 10 ++++++++ .../common/include/glib_shim/glib.h | 24 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 qemu-components/common/include/glib_shim/glib.h diff --git a/CMakeLists.txt b/CMakeLists.txt index eb48055c..bb31e600 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -362,6 +362,16 @@ if (NOT WITHOUT_QEMU) $ ) + # Glib shim path (BUILD_INTERFACE only): shadows system glib for any + # in-tree TU that transitively includes qemu-plugin.h via libqemu's + # generated typedefs.h (which sits inside an extern "C" block in + # libqemu.h). Forward-decls of GArray/GByteArray are sufficient + # because qbox C++ never accesses glib internals. + target_include_directories( + ${PROJECT_NAME} BEFORE PUBLIC + $ + ) + target_link_libraries(${PROJECT_NAME} PUBLIC libqemu) set(LIBQEMU_CXX_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qemu-components/common/include/libqemu-cxx) diff --git a/qemu-components/common/include/glib_shim/glib.h b/qemu-components/common/include/glib_shim/glib.h new file mode 100644 index 00000000..b58d8005 --- /dev/null +++ b/qemu-components/common/include/glib_shim/glib.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. All Rights Reserved. + * + * SPDX-License-Identifier: BSD-3-Clause-Clear + * + * Forward-decl-only glib.h shim, on libqemu-cxx's PRIVATE include path + * BEFORE the system glib path. + * + * Why: libqemu's generated typedefs.h is wrapped in extern "C" by + * libqemu/libqemu.h, and qemu-plugin.h does `#include `. Modern + * glib.h has C++ template inline functions (g_steal_pointer, ...) that + * fail with "template with C linkage" inside extern "C". qbox's plugin + * API surface only references @c GArray and @c GByteArray as opaque + * pointers, so opaque forward-decls are sufficient — and shadowing real + * glib for the libqemu-cxx target only is safe because nothing in qbox + * C++ uses real glib internals. + */ +#ifndef GLIB_QBOX_SHIM_H +#define GLIB_QBOX_SHIM_H + +typedef struct _GArray GArray; +typedef struct _GByteArray GByteArray; + +#endif From 51b5c16a09e0f8e10efae8e989305eb6ec26695a Mon Sep 17 00:00:00 2001 From: Alwalid Salama Date: Mon, 1 Jun 2026 18:07:51 +0200 Subject: [PATCH 2/2] Package-lock: update libqemu to libqemu-v11.0-v0.8 -libqemu: expose TCG plugin API through LibQemuExports -contrib/plugins: install idlinker on Windows and stage it for the loader -target/riscv: handle platform-defined local interrupts (IRQ >= 12) -target/riscv: add vendor CSR 0x7c1 as no-op -virtio-gpu: Fix vircl OpenCL device (capsets, QOM type, timers) Signed-off-by: Alwalid Salama --- package-lock.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.cmake b/package-lock.cmake index 205c1955..91e38158 100644 --- a/package-lock.cmake +++ b/package-lock.cmake @@ -27,7 +27,7 @@ CPMDeclarePackage(SCP CPMDeclarePackage(qemu NAME libqemu GIT_REPOSITORY ${LIBQEMU_GIT} - GIT_TAG libqemu-v11.0-v0.6 + GIT_TAG libqemu-v11.0-v0.8 GIT_SUBMODULES CMakeLists.txt GIT_SHALLOW ON )