qemu-system-native fails to build with buildtools and certain host packages installed
Hi everyone,
I have stumbled upon a build error when trying to build qemu-system-native when using buildtools.
I first saw it on an Arch Linux (I know, not supported architecture), but I have also been able to reproduce it on Debian Bookworm, but only if the following packages have been installed on Debian
- pkg-config
- libkeyutils-dev
# . buildtools/environment-setup-x86_64-pokysdk-linux [..] # bitbake qemu-system-native [..] cryptodev-lkcf.c.o -MF libcommon.fa.p/backends_cryptodev-lkcf.c.o.d -o libcommon.fa.p/backends_cryptodev-lkcf.c.o -c ../qemu-9.0.2/backends/cryptodev-lkcf.c | ../qemu-9.0.2/backends/cryptodev-lkcf.c:36:10: fatal error: keyutils.h: No such file or directory | 36 | #include <keyutils.h> | | ^~~~~~~~~~~~ | compilation terminated.
# $ ls /usr/include/keyutils.h/usr/include/keyutils.h
If I build qemu-system-native without use of the buildtools, qemu-system-native builds. By the looks of it, it will also include keyutils, but will happily take it from /usr/include.
From all that I could find, it is "normal" that qemu-system-native is a bit special as it "needs to interface with host graphics".
For me the question is how to fix that:
Should the buildtools behave the same way as when using the normal GCC?
Should the recipe for qemu-system-native be adapted to include the system include path? If you look at the recipe at qemu.inc, then the native pkg-config will be used if it exists. Should the recipe for qemu-system-native be adapted to filter out libkeyutils? This doesn't seem to be straightforward as it is not an existing configure switch. Any other thoughts on that?
Thanks
Matthias
Quoted 36 lines · email via lists.yoctoproject.org
Hi everyone,
I have stumbled upon a build error when trying to build qemu-system- native when using buildtools.
I first saw it on an Arch Linux (I know, not supported architecture), but I have also been able to reproduce it on Debian Bookworm, but only if the following packages have been installed on Debian- pkg-config
- libkeyutils-dev# . buildtools/environment-setup-x86_64-pokysdk-linux [..] # bitbake qemu-system-native [..] cryptodev-lkcf.c.o -MF libcommon.fa.p/backends_cryptodev-lkcf.c.o.d - o libcommon.fa.p/backends_cryptodev-lkcf.c.o -c ../qemu- 9.0.2/backends/cryptodev-lkcf.cQuoted 5 lines
../qemu-9.0.2/backends/cryptodev-lkcf.c:36:10: fatal error:keyutils.h: No such file or directory
36 | #include <keyutils.h>
| ^~~~~~~~~~~~
compilation terminated.# $ ls
/usr/include/keyutils.h/usr/include/keyutils.hIf I build qemu-system-native without use of the buildtools, qemu- system-native builds. By the looks of it, it will also include keyutils, but will happily take it from
/usr/include.From all that I could find, it is "normal" that qemu-system-native is a bit special as it "needs to interface with host graphics".
For me the question is how to fix that:
Quoted 9 lines
Should the buildtools behave the same way as when using the normal GCC?
Should the recipe for qemu-system-native be adapted to include the system include path? If you look at the recipe at qemu.inc, then the native pkg-config will be used if it exists.
Should the recipe for qemu-system-native be adapted to filter out libkeyutils? This doesn't seem to be straightforward as it is not an existing configure switch.
Any other thoughts on that?
It shouldn't be finding keyutils and ideally that should have a configure option. If it doesn't, we'd need to add one and disable it. Hopefully upstream would take such a patch too.
Cheers,
Richard
Quoted 8 lines · Richard Purdie
Quoted 4 lines · email via lists.yoctoproject.org
Should the recipe for qemu-system-native be adapted to filter out libkeyutils? This doesn't seem to be straightforward as it is not an existing configure switch.
Any other thoughts on that?
Quoted 8 lines
It shouldn't be finding keyutils and ideally that should have a configure option. If it doesn't, we'd need to add one and disable it. Hopefully upstream would take such a patch too.
Cheers,
Richard
Thanks for the quick reply.
There is a config switch for libkeyutils and it works for me - don't know why I missed it before. I'll prepare a patch, but I guess that should go to the openembedded-core mailing list.
Quoted 18 lines · email via lists.yoctoproject.org
Quoted 16 lines · Richard Purdie
Quoted 5 lines · email via lists.yoctoproject.org
Should the recipe for qemu-system-native be adapted to filter out libkeyutils? This doesn't seem to be straightforward as it is not an
existing configure switch.
Any other thoughts on that?It shouldn't be finding keyutils and ideally that should have a configure option. If it doesn't, we'd need to add one and disable it.
Hopefully upstream would take such a patch too.Cheers,
Quoted 8 lines
Quoted 2 lines
Richard
Thanks for the quick reply.
There is a config switch for libkeyutils and it works for me - don't know why I missed it before.
I'll prepare a patch, but I guess that should go to the openembedded- core mailing list.
A patch sounds good, yes please. It should go to the openembedded-core list.
Cheers,
Richard