On a Debian 12/bookworm build machine that happened to have libsndio-dev installed, a Yocto build of qemu-system-native fails with | ../qemu-7.2.0/audio/sndioaudio.c:18:10: fatal error: sndio.h: No such file or directory | 18 | #include <sndio.h> It seems this happens due to poky/meta/recipes-devtools/qemu/qemu.inc setting BHOST_PKGCONFIG_PATH and thereby including the host pkg-config path. pkg-config thus finds the host sndio (as can be verified in log.do_configure), but pkg-config --cflags sndio returns an empty line because sndio.h is located in the standard path /usr/include. This path is then not searched during the build, causing the error. The same problem would probably happen for other qemu dependencies that have headers directly in /usr/include, not in a subdirectory. Possible solutions: - If BHOST_PKGCONFIG_PATH is really only for finding sdl, we could implement a way to limit the search in the host path to only that package. - If it is intended that pkg-config should also find other dependencies in the host path, pkg-config could be called with the --keep-system-cflags option so it emits a -I/usr/include (but that may lead to more headers being taken from there than we intended...) - If we now always build libsdl2-native instead of using the host library, the whole mechanism might also be removed. - If we keep everything as it is, the documentation could also be extended to list "negative system requirements", i.e. removing all libraries qemu might depend on.
qemu-system-native is special in that its one of the few packages allowed to look on the build host for libraries. I'm guessing we don't want to enable sndio by default, so the easiest thing would be to explicitly add -Dsndio=disabled to EXTRA_OECMAKE. Would you be able to test that and send a patch?
Patch on the list.
Merged in e746182638aeb9bdd1bbb7430de214d8d847a8b6.