Skip to contentSkip to conversation

Building SDK fails after update to scarthgap

DISCUSSION [email protected] 2 participants 11 messages Oct 29, 2024 – Oct 31, 2024

lore
Share & tools
lore
#0 lore raw

Hello everyone.
After updating our internal distro to scarthgap I am encountering the following when trying to build the sdk.

nativesdk-qemu-8.2.2.imx-r0 do_compile: oe_runmake failed
.
.
[87/4472] Compiling C object libcommon.fa.p/hw_display_virtio-gpu.c.o
| FAILED: libcommon.fa.p/hw_display_virtio-gpu.c.o
.
.
../hw/display/virtio-gpu.c:36:10: fatal error: virglrenderer.h: No such file or directory

|    36 | #include <virglrenderer.h>
|       |          ^~~~~~~~~~~~~~~~~
| compilation terminated.

Building the image as normal (not populate_sdk) works fine. Tried adding libvirglrenderer-dev on host but that made no difference. Building on jammy.

I have no actual need for virgl so removing that from qemu would be a simple solution. So if anyone knows how to either fix the problem och get rid of virgl totally I would be most grateful.

/Freddy

#1 lore raw

You first need to find out why it is enabled in qemu build config, as it's an option that can be switched on or off.

Alex

Quoted 34 lines · freddy.boman via lists.yoctoproject.org

Hello everyone.
After updating our internal distro to scarthgap I am encountering the following when trying to build the sdk.

nativesdk-qemu-8.2.2.imx-r0 do_compile: oe_runmake failed
.
.
[87/4472] Compiling C object libcommon.fa.p/hw_display_virtio-gpu.c.o
| FAILED: libcommon.fa.p/hw_display_virtio-gpu.c.o
.
.
../hw/display/virtio-gpu.c:36:10: fatal error: virglrenderer.h: No such file or directory

|    36 | #include <virglrenderer.h>
|       |          ^~~~~~~~~~~~~~~~~
| compilation terminated.

Building the image as normal (not populate_sdk) works fine. Tried adding libvirglrenderer-dev on host but that made no difference. Building on jammy.

I have no actual need for virgl so removing that from qemu would be a simple solution. So if anyone knows how to either fix the problem och get rid of virgl totally I would be most grateful.

/Freddy

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64166): https://lists.yoctoproject.org/g/yocto/message/64166
Mute This Topic: https://lists.yoctoproject.org/mt/109275322/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

Hello.
I've found where the config option comes from (it's in qemu.inc).
But I can't seem to find a way to add a :remove for the option that works.
I created a normal .bbappend for qemu but this does not seem to be applied when making nativesdk-qemu.
Is the only option to clone the full qemu-recipe into our own distro and make the changes there or is there some magic that can be done elsewehere?

/Freddy

Quoted 3 lines · Alexander Kanavin

You first need to find out why it is enabled in qemu build config, as it's an option that can be switched on or off.

#3 lore raw
Quoted 4 lines · freddy.boman via Lists.Yoctoproject.Org

I've found where the config option comes from (it's in qemu.inc).
But I can't seem to find a way to add a :remove for the option that works.
I created a normal .bbappend for qemu but this does not seem to be applied when making nativesdk-qemu.
Is the only option to clone the full qemu-recipe into our own distro and make the changes there or is there some magic that can be done elsewehere?

There's some other issue there that you need to look into, and disabling the option would only cover it up instead of fixing it.

If the option is enabled, then the needed pieces should be in the sysroot and qemu build shouldn't be failing with a missing header error. Is the header in the sysroot? Are you doing other tweaks to qemu recipe that break something? Does the issue occur if you try building nativesdk-qemu in plain poky?

Alex

#4 lore raw
Quoted 2 lines · Alexander Kanavin

Is the header in the sysroot?

Nope, seems to be totally missing.

Quoted 3 lines

Are you doing other tweaks to
qemu recipe that break something?

No, and from what I can tell the only changes to qemu thats made is meta-virtualization/recipes-devtools/qemu/qemu_%.bbappend Which looks like a standard yocto-thing?

Quoted 3 lines

Does the issue occur if you try
building nativesdk-qemu in plain poky?

If you mean a completely clean with no layers then I have not tested that. I will setup a new environment with nothing added at all. Might take a while though.

I tried building nativesdk-qemu directly without doing the whole populate_sdk based on our distro.
Same result. Looks like nativesdk-virglrenderer is not built or installed. Looking in the recipe for qemu I can not find virglrenderer explicitly set as a dependency anywhere. Not really any other dependencies set there either. Assuming its done somewhere else.
There is however a part that makes sure to remove virglrenderer (and some other bits) if the system cannot support it.

From https://git.yoctoproject.org/poky/plain/meta/recipes-devtools/qemu/qemu.inc
# Disable kvm/virgl/mesa on targets that do not support it PACKAGECONFIG:remove:darwin = "kvm virglrenderer epoxy gtk+" PACKAGECONFIG:remove:mingw32 = "kvm virglrenderer epoxy gtk+ pie"

/Freddy

#5 lore raw
Quoted 4 lines · freddy.boman via Lists.Yoctoproject.Org

I tried building nativesdk-qemu directly without doing the whole populate_sdk based on our distro.
Same result. Looks like nativesdk-virglrenderer is not built or installed. Looking in the recipe for qemu I can not find virglrenderer explicitly set as a dependency anywhere. Not really any other dependencies set there either. Assuming its done somewhere else.
There is however a part that makes sure to remove virglrenderer (and some other bits) if the system cannot support it.

virglrenderer is pulled into qemu's sysroot via PACKAGECONFIG settings. The last field is what gets appended to DEPENDS if virglrenderer is in PACKAGECONFIG:
meta/recipes-devtools/qemu/qemu.inc:PACKAGECONFIG[virglrenderer] = "--enable-virglrenderer,--disable-virglrenderer,virglrenderer"

Let's inspect the output of 'bitbake -e nativesdk-qemu'. This is how it looks for me:

- DEPENDS should include nativesdk-virglrenderer, something like this:
DEPENDS="bison-native chrpath-replacement-native nativesdk-glib-2.0 meson-native nativesdk-dtc nativesdk-libepoxy nativesdk-libsdl2 nativesdk-libslirp nativesdk-virglrenderer ninja-native nativesdk-pixman pkgconfig-native python3-native virtual/nativesdk-libc virtual/nativesdk-x86_64-pokysdk-linux-compilerlibs virtual/x86_64-pokysdk-linux-gcc nativesdk-zlib"

- EXTRA_OECONF should include --enable-viglrenderer (too long to copy paste)

- PACKAGECONFIG should include virglrenderer:
PACKAGECONFIG="fdt sdl kvm pie slirp virglrenderer epoxy "

Do all three conditions hold true for your side? If they do, then content of nativesdk-virglrenderer's ${WORKDIR}/sysroot-destdir/ should be in nativesdk-qemu's sysroot, so you can inspect what that content is, and does it arrive to qemu's ${WORKDIR}/recipe-sysroot/.

Alex

#6 lore raw

This is just weird.
Plain poky, works fine.

Copy entire qemu recipe from poky into our top layer, now it works.

I checked with -e for both recipe in our layer and in standard location.

In both cases virglrenderer is disabled (depends,extra_oeconf,packageconfig). But a few other things do change.
Working
PACKAGECONFIG="fdt sdl kvm pie slirp      "
Not working
PACKAGECONFIG="fdt sdl kvm pie slirp       pipewire aio vhost" Those settings are reflected in oeconf.
Can only assume that one of those three have a dependency on virglrenderer.

Tried adding all three of those to distro_feature:remove but that made no difference.

/Freddy

#7 lore raw
Quoted 10 lines · freddy.boman via Lists.Yoctoproject.Org

In both cases virglrenderer is disabled (depends,extra_oeconf,packageconfig). But a few other things do change.
Working
PACKAGECONFIG="fdt sdl kvm pie slirp "
Not working
PACKAGECONFIG="fdt sdl kvm pie slirp pipewire aio vhost"
Those settings are reflected in oeconf.
Can only assume that one of those three have a dependency on virglrenderer.

Tried adding all three of those to distro_feature:remove but that made no difference.

You can check ${T}/log.do_configure and ${T}/run.do_configure to see the actual options passed in, and the output of qemu's configure.

It's possible that one of the three extra options re-enables virgl without bringing in virglrenderer into the sysroot. 'vhost' is particularly suspicious.

Alex

#8 lore raw

Doesn't actually look like it.
But i just realized that the version being built when it failed is NXPs version of qemu which apparently is almost but not entirely the same. I think it is easiest to simply ignore the problem for now and chalk it up to NXPs QA.
Thank you so much for the assistance.

/Freddy

#10 lore raw

For anyone with the same problem.
Make sure DISTRO_FEATURES contains opengl
Then add a bbappend recipes-devtools/qemu/qemu_8.2.2.imx.bbappend (or current version) Put one line in the file
DEPENDS += "virglrenderer"

Qemu (and sdk) should now properly build.