Skip to content

vulkan/wsi: Add dep_libudev to idep dependencies

Ryan Houdek requested to merge sonicadvance1/mesa:fix_udev_dependency into main

Otherwise users of idep_vulkan_wsi won't pull in the udev dependency, which will cause the linker to fail later on in compiling.

The user of this dependency is lavapipe which would fail to link if this isn't provided.

Linking failure without this dependency:

FAILED: src/gallium/targets/lavapipe/libvulkan_lvp.so
c++  -o src/gallium/targets/lavapipe/libvulkan_lvp.so src/gallium/targets/lavapipe/libvulkan_lvp.so.p/target.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-soname,libvulkan_lvp.so -Wl,--whole-archive src/gallium/frontends/lavapipe/liblavapipe_st.a -Wl,--no-whole-archive src/gallium/auxiliary/pipe-loader/libpipe_loader_static.a src/loader/libloader.a src/util/libxmlconfig.a src/util/libmesa_util.a src/util/format/libmesa_format.a src/util/libmesa_util_sse41.a src/c11/impl/libmesa_util_c11.a src/gallium/auxiliary/libgallium.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/gallium/winsys/sw/wrapper/libwsw.a src/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/null/libws_null.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/drivers/llvmpipe/libllvmpipe.a src/gallium/drivers/softpipe/libsoftpipe.a src/vulkan/util/libvulkan_util.a -Wl,-Bsymbolic -Wl,--gc-sections -L/usr/lib/llvm-14/lib -lLLVM-14 -pthread /usr/lib/x86_64-linux-gnu/libz.so -lm /usr/lib/x86_64-linux-gnu/libdrm.so /usr/lib/x86_64-linux-gnu/libexpat.so /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libzstd.so /usr/lib/x86_64-linux-gnu/libunwind.so -L/usr/lib/llvm-14/lib -lLLVM-14 -lsensors -L/usr/lib/llvm-14/lib -lLLVM-14 -L/usr/lib/llvm-14/lib -lLLVM-14 /usr/lib/x86_64-linux-gnu/libxcb-dri3.so /usr/lib/x86_64-linux-gnu/libwayland-client.so /usr/lib/x86_64-linux-gnu/libxcb.so /usr/lib/x86_64-linux-gnu/libX11-xcb.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libxcb-present.so /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so /usr/lib/x86_64-linux-gnu/libxcb-sync.so /usr/lib/x86_64-linux-gnu/libxcb-randr.so /usr/lib/x86_64-linux-gnu/libxcb-shm.so /usr/lib/x86_64-linux-gnu/libxshmfence.so /usr/lib/x86_64-linux-gnu/libXrandr.so -Wl,--end-group
/usr/bin/ld: src/gallium/frontends/lavapipe/../../../vulkan/wsi/libvulkan_wsi.a.p/wsi_common_display.c.o: in function `udev_event_listener_thread':
wsi_common_display.c:(.text.udev_event_listener_thread+0x2d): undefined reference to `udev_new'
/usr/bin/ld: wsi_common_display.c:(.text.udev_event_listener_thread+0x44): undefined reference to `udev_monitor_new_from_netlink'
/usr/bin/ld: wsi_common_display.c:(.text.udev_event_listener_thread+0x62): undefined reference to `udev_monitor_filter_add_match_subsystem_devtype'
/usr/bin/ld: wsi_common_display.c:(.text.udev_event_listener_thread+0x6e): undefined reference to `udev_monitor_enable_receiving'
/usr/bin/ld: wsi_common_display.c:(.text.udev_event_listener_thread+0x7a): undefined reference to `udev_monitor_unref'
/usr/bin/ld: wsi_common_display.c:(.text.udev_event_listener_thread+0x82): undefined reference to `udev_unref'
/usr/bin/ld: wsi_common_display.c:(.text.udev_event_listener_thread+0xb9): undefined reference to `udev_monitor_get_fd'
/usr/bin/ld: wsi_common_display.c:(.text.udev_event_listener_thread+0x102): undefined reference to `udev_monitor_receive_device'
/usr/bin/ld: wsi_common_display.c:(.text.udev_event_listener_thread+0x114): undefined reference to `udev_device_get_property_value'
/usr/bin/ld: wsi_common_display.c:(.text.udev_event_listener_thread+0x182): undefined reference to `udev_device_unref'
collect2: error: ld returned 1 exit status

You can see in the dependencies that it is missing libudev. As far as I can tell previously this was getting saved by a different library pulling in a libudev dependency, but that has changed in recent distributions.

Merge request reports