Vulkan WSI flags leak into NIR, breaking build on BSDs
Regressed by b39958a3. -DVK_USE_PLATFORM_XCB_KHR
requires adding dep_xcb
and similar to dependencies
. CC @apinheiro
$ cc --version
FreeBSD clang version 15.0.7 (https://github.com/llvm/llvm-project.git llvmorg-15.0.7-0-g8dfdcc7b7bf6)
Target: x86_64-unknown-freebsd14.0
Thread model: posix
InstalledDir: /usr/bin
$ meson setup --auto-features=disabled -Dgallium-drivers='' -Dplatforms=x11,wayland -Ddri3=enabled -Dshared-glapi=enabled -Dvulkan-drivers=intel /tmp/mesa_build
$ meson compile -C /tmp/mesa_build
[...]
FAILED: src/compiler/nir/libnir.a.p/nir_convert_ycbcr.c.o
cc -Isrc/compiler/nir/libnir.a.p -Isrc/compiler/nir -I../../git/mesa/src/compiler/nir -Iinclude -I../../git/mesa/include -Isrc -I../../git/mesa/src -Isrc/mapi -I../../git/mesa/src/mapi -I../../git/mesa/src/mesa -I../../git/mesa/src/gallium/include -I../../git/mesa/src/gallium/auxiliary -Isrc/compiler -I../../git/mesa/src/compiler -Isrc/compiler/spirv -I../../git/mesa/src/compiler/spirv -fvisibility=hidden -fcolor-diagnostics -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"' -DVIDEO_CODEC_VC1DEC=0 -DVIDEO_CODEC_H264DEC=0 -DVIDEO_CODEC_H264ENC=0 -DVIDEO_CODEC_H265DEC=0 -DVIDEO_CODEC_H265ENC=0 -DHAVE_X11_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_XCB_PLATFORM -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DETIME=ETIMEDOUT -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_UINT128 -DHAVE_REALLOCARRAY -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_SYS_SYSCTL_H -DHAVE_XLOCALE_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_PTHREAD_NP_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_QSORT_S -DHAVE_GNU_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DSUPPORT_INTEL_INTEGRATED_GPUS -DHAVE_ZLIB -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_LIBDRM -DHAVE_LIBUDEV -DUSE_LIBELF -DMESA_EXECMEM -DWL_HIDE_DEPRECATED -DHAVE_DRI2 -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DVK_USE_PLATFORM_WAYLAND_KHR -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -DVK_USE_PLATFORM_DISPLAY_KHR -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 -fno-math-errno -fno-trapping-math -Qunused-arguments -fno-common -Wno-microsoft-enum-value -Wno-unused-function -Werror=format -Wformat-security -ffunction-sections -fdata-sections -fPIC -Werror=pointer-arith -Werror=vla -Werror=gnu-empty-initializer -Wno-override-init -Wno-initializer-overrides -MD -MQ src/compiler/nir/libnir.a.p/nir_convert_ycbcr.c.o -MF src/compiler/nir/libnir.a.p/nir_convert_ycbcr.c.o.d -o src/compiler/nir/libnir.a.p/nir_convert_ycbcr.c.o -c ../../git/mesa/src/compiler/nir/nir_convert_ycbcr.c
In file included from ../../git/mesa/src/compiler/nir/nir_convert_ycbcr.c:26:
In file included from ../../git/mesa/src/vulkan/runtime/vk_ycbcr_conversion.h:26:
In file included from ../../git/mesa/src/vulkan/runtime/vk_object.h:26:
../../git/mesa/include/vulkan/vulkan.h:52:10: fatal error: 'xcb/xcb.h' file not found
#include <xcb/xcb.h>
^~~~~~~~~~~
1 error generated.
Workaround:
diff --git a/src/compiler/nir/nir_convert_ycbcr.c b/src/compiler/nir/nir_convert_ycbcr.c
index 60027b4f1c7..7fd006623a8 100644
--- a/src/compiler/nir/nir_convert_ycbcr.c
+++ b/src/compiler/nir/nir_convert_ycbcr.c
@@ -21,6 +21,17 @@
* IN THE SOFTWARE.
*/
+/* Disable all WSI flags defined project-wide in meson.build */
+#undef VK_USE_PLATFORM_ANDROID_KHR
+#undef VK_USE_PLATFORM_DISPLAY_KHR
+#undef VK_USE_PLATFORM_MACOS_MVK
+#undef VK_USE_PLATFORM_METAL_EXT
+#undef VK_USE_PLATFORM_WAYLAND_KHR
+#undef VK_USE_PLATFORM_WIN32_KHR
+#undef VK_USE_PLATFORM_XCB_KHR
+#undef VK_USE_PLATFORM_XLIB_KHR
+#undef VK_USE_PLATFORM_XLIB_XRANDR_EXT
+
#include "nir_vulkan.h"
#include "vulkan/util/vk_format.h"
#include "vulkan/runtime/vk_ycbcr_conversion.h"
Edited by Jan Beich