tu: compilation failing when compiling turnip with only kgsl and X11 enabled
Same set up as in #8634 just different meson config. In this case it's just -Ddri3=enabled -Dplatforms=x11 -Dgallium-drivers= -Dvulkan-drivers=freedreno -Dfreedreno-kmds=kgsl
Compilation first stops with error below:
FAILED: src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_knl.c.o
cc -Isrc/freedreno/vulkan/libvulkan_freedreno.so.p -Isrc/freedreno/vulkan -I../src/freedreno/vulkan -Iinclude -I../include -Isrc -I../src -I../src/mapi -I../src/mesa -I../src/gallium/include -I../src/gallium/auxiliary -Isrc/compiler -I../src/compiler -Isrc/freedreno -I../src/freedreno -Isrc/freedreno/registers -I../src/freedreno/registers -Isrc/freedreno/registers/adreno -I../src/freedreno/registers/adreno -Isrc/freedreno/common -I../src/freedreno/common -Isrc/compiler/nir -I../src/compiler/nir -Isrc/vulkan/util -I../src/vulkan/util -Isrc/vulkan/runtime -I../src/vulkan/runtime -Isrc/vulkan/wsi -I../src/vulkan/wsi -Isrc/util/format -I/usr/include/valgrind -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="23.1.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_OPENGL=1 -DHAVE_OPENGL_ES_1=1 -DHAVE_OPENGL_ES_2=1 -DVIDEO_CODEC_VC1DEC=0 -DVIDEO_CODEC_H264DEC=0 -DVIDEO_CODEC_H264ENC=0 -DVIDEO_CODEC_H265DEC=0 -DVIDEO_CODEC_H265ENC=0 -DHAVE_X11_PLATFORM -DHAVE_XCB_PLATFORM -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DALLOW_KCMP -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_REALLOCARRAY -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DMAJOR_IN_SYSMACROS -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_SYS_INOTIFY_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_GNU_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_ISSIGNALING -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="15.0.7"' -DLLVM_IS_SHARED=1 -DDRAW_LLVM_AVAILABLE -DUSE_LIBELF -DHAVE_VALGRIND -DMESA_EXECMEM -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_LIBSENSORS=1 -mtls-dialect=gnu2 -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Wmisleading-indentation -Wno-missing-field-initializers -Wno-format-truncation -Wno-nonnull-compare -fno-math-errno -fno-trapping-math -fno-common -Wno-unused-function -Werror=format -Wformat-security -ffunction-sections -fdata-sections -fPIC -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -pthread -Wno-override-init -DTU_HAS_KGSL -Wno-array-bounds -MD -MQ src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_knl.c.o -MF src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_knl.c.o.d -o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_knl.c.o -c ../src/freedreno/vulkan/tu_knl.c
In file included from ../src/freedreno/vulkan/tu_knl.c:19:
../src/util/libdrm.h:54:16: error: unknown type name ‘uint32_t’
54 | drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices)
| ^~~~~~~~
../src/util/libdrm.h:35:1: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
34 | #include <errno.h>
+++ |+#include <stdint.h>
35 |
../src/util/libdrm.h: In function ‘drmGetVersion’:
../src/util/libdrm.h:75:32: error: ‘NULL’ undeclared (first use in this function)
75 | drmGetVersion(int fd) { return NULL; }
| ^~~~
../src/util/libdrm.h:35:1: note: ‘NULL’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?
34 | #include <errno.h>
+++ |+#include <stddef.h>
35 |
../src/util/libdrm.h:75:32: note: each undeclared identifier is reported only once for each function it appears in
75 | drmGetVersion(int fd) { return NULL; }
| ^~~~
../src/util/libdrm.h:75:38: error: control reaches end of non-void function [-Werror=return-type]
75 | drmGetVersion(int fd) { return NULL; }
| ^
cc1: some warnings being treated as errors
[7/8] Compiling C object src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_util.c.o
ninja: build stopped: subcommand failed.
With two headers provided by compiler it failed further.
FAILED: src/freedreno/vulkan/libvulkan_freedreno.so
c++ -o src/freedreno/vulkan/libvulkan_freedreno.so src/freedreno/vulkan/libvulkan_freedreno.so.p/meson-generated_.._tu_entrypoints.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/meson-generated_.._tu_tracepoints.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_autotune.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_clear_blit.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_cmd_buffer.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_cs_breadcrumbs.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_cs.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_device.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_descriptor_set.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_dynamic_rendering.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_formats.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_image.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_knl.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_lrz.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_nir_lower_multiview.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_pass.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_pipeline.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_query.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_shader.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_suballoc.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_util.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_wsi.c.o src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_knl_kgsl.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libvulkan_freedreno.so -Wl,--whole-archive src/vulkan/runtime/libvulkan_runtime.a src/vulkan/wsi/libvulkan_wsi.a -Wl,--no-whole-archive src/freedreno/ir3/libfreedreno_ir3.a src/freedreno/isa/libir3decode.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/freedreno/isa/libir3encode.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/freedreno/common/libfreedreno_common.a src/freedreno/fdl/libfreedreno_layout.a src/freedreno/perfcntrs/libfreedreno_perfcntrs.a src/vulkan/util/libvulkan_util.a src/util/libxmlconfig.a -Wl,--version-script /root/mesa/src/vulkan/vulkan.sym -Wl,-Bsymbolic -Wl,--gc-sections -Wl,--build-id=sha1 /usr/lib/arm-linux-gnueabihf/libelf.so -lm -pthread /usr/lib/arm-linux-gnueabihf/libz.so /usr/lib/gcc/arm-linux-gnueabihf/12/../../../arm-linux-gnueabihf/libzstd.so /usr/lib/arm-linux-gnueabihf/libxcb-dri3.so /usr/lib/arm-linux-gnueabihf/libxcb.so /usr/lib/arm-linux-gnueabihf/libX11-xcb.so /usr/lib/arm-linux-gnueabihf/libX11.so /usr/lib/arm-linux-gnueabihf/libxcb-present.so /usr/lib/arm-linux-gnueabihf/libxcb-xfixes.so /usr/lib/arm-linux-gnueabihf/libxcb-sync.so /usr/lib/arm-linux-gnueabihf/libxcb-randr.so /usr/lib/arm-linux-gnueabihf/libxcb-shm.so /usr/lib/arm-linux-gnueabihf/libxshmfence.so /usr/lib/arm-linux-gnueabihf/libexpat.so -Wl,--end-group
/usr/bin/ld: src/freedreno/vulkan/libvulkan_freedreno.so.p/tu_wsi.c.o: in function `tu_wsi_can_present_on_device':
/root/mesa/build/../src/freedreno/vulkan/tu_wsi.c:29: undefined reference to `wsi_common_drm_devices_equal'
/usr/bin/ld: src/vulkan/wsi/libvulkan_wsi.a.p/wsi_common_x11.c.o: in function `wsi_x11_check_dri3_compatible':
/root/mesa/build/../src/vulkan/wsi/wsi_common_x11.c:138: undefined reference to `wsi_device_matches_drm_fd'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Taging #8460 for visibility.