linking fails without gbm
- debian bullseye, gbm present: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/37817538/raw
- debian bookworm, gbm not detected: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/38340665#L11733
I would propose to make it build option, so it can be easily on/off.
[85/89] Linking target src/libvirglrenderer.so.1.7.7
FAILED: src/libvirglrenderer.so.1.7.7
/usr/lib/ccache/gcc -o src/libvirglrenderer.so.1.7.7 src/libvirglrenderer.so.1.7.7.p/virglrenderer.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-soname,libvirglrenderer.so.1 src/gallium/libgallium.a src/mesa/libmesa.a src/libvirgl.a -lm -pthread /usr/lib/x86_64-linux-gnu/libepoxy.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libvulkan.so -Wl,--end-group
src/libvirgl.a(src/libvirgl.a.p/venus_vkr_device_memory.c.o):vkr_device_memory.c:function vkr_dispatch_vkFreeMemory: error: undefined reference to 'gbm_bo_destroy'
src/libvirgl.a(src/libvirgl.a.p/venus_vkr_device_memory.c.o):vkr_device_memory.c:function vkr_dispatch_vkAllocateMemory: error: undefined reference to 'gbm_bo_destroy'
src/libvirgl.a(src/libvirgl.a.p/venus_vkr_device_memory.c.o):vkr_device_memory.c:function vkr_dispatch_vkAllocateMemory: error: undefined reference to 'gbm_bo_create'
src/libvirgl.a(src/libvirgl.a.p/venus_vkr_device_memory.c.o):vkr_device_memory.c:function vkr_dispatch_vkAllocateMemory: error: undefined reference to 'gbm_bo_get_fd'
src/libvirgl.a(src/libvirgl.a.p/venus_vkr_device_memory.c.o):vkr_device_memory.c:function vkr_dispatch_vkAllocateMemory: error: undefined reference to 'gbm_bo_destroy'
src/libvirgl.a(src/libvirgl.a.p/venus_vkr_device_memory.c.o):vkr_device_memory.c:function vkr_device_memory_export_blob: error: undefined reference to 'gbm_bo_get_fd'
src/libvirgl.a(src/libvirgl.a.p/venus_vkr_device_memory.c.o):vkr_device_memory.c:function vkr_device_memory_release: error: undefined reference to 'gbm_bo_destroy'
src/libvirgl.a(src/libvirgl.a.p/venus_vkr_physical_device.c.o):vkr_physical_device.c:function vkr_gbm_device_init_once: error: undefined reference to 'virgl_gbm_init'
collect2: error: ld returned 1 exit status