diff options
| author | Franz Schnyder <franz.schnyder@toradex.com> | 2026-06-03 10:04:40 +0200 |
|---|---|---|
| committer | Franz Schnyder <franz.schnyder@toradex.com> | 2026-06-03 11:38:52 +0200 |
| commit | dd5b0a72993c9f48427345a6f5e66594a6aad903 (patch) | |
| tree | 5b4eb0cd900fd8a6c87c3ef136bf4bfcca93307c /recipes-graphics | |
| parent | c147d1ee25d10ffbfabcb96faf7cc94adf41f834 (diff) | |
| download | meta-freescale-dd5b0a72993c9f48427345a6f5e66594a6aad903.tar.gz | |
vulkan-wsi-layer: Fix build issue with GCC 16
'__STDC_VERSION__' is predefined by the compiler in C++ mode. Redefining
it triggers '-Wbuiltin-macro-redefined', which with '-Werror' fails the
build with GCC 16.
error: '__STDC_VERSION__' defined [-Werror]
As suggested in the Vulkan WSI Layer issue tracker, add a C++ guard
before the __STDC_VERSION__ define.
Signed-off-by: Franz Schnyder <franz.schnyder@toradex.com>
Diffstat (limited to 'recipes-graphics')
| -rw-r--r-- | recipes-graphics/vulkan/vulkan-wsi-layer/0001-wayland-Add-C-guard-before-__STDC_VERSION__-define.patch | 106 | ||||
| -rw-r--r-- | recipes-graphics/vulkan/vulkan-wsi-layer_git.bb | 3 |
2 files changed, 108 insertions, 1 deletions
diff --git a/recipes-graphics/vulkan/vulkan-wsi-layer/0001-wayland-Add-C-guard-before-__STDC_VERSION__-define.patch b/recipes-graphics/vulkan/vulkan-wsi-layer/0001-wayland-Add-C-guard-before-__STDC_VERSION__-define.patch new file mode 100644 index 000000000..ca76a1231 --- /dev/null +++ b/recipes-graphics/vulkan/vulkan-wsi-layer/0001-wayland-Add-C-guard-before-__STDC_VERSION__-define.patch | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | From aa5d634a607d58f45cc9ccbdc1f80c94685a45a2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Franz Schnyder <franz.schnyder@toradex.com> | ||
| 3 | Date: Wed, 3 Jun 2026 10:00:55 +0200 | ||
| 4 | Subject: [PATCH] wayland: Add C++ guard before __STDC_VERSION__ define | ||
| 5 | |||
| 6 | '__STDC_VERSION__' is predefined by the compiler in C++ mode. Redefining | ||
| 7 | it triggers '-Wbuiltin-macro-redefined', which with '-Werror' fails the | ||
| 8 | build under GCC 16. | ||
| 9 | |||
| 10 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer/-/work_items/33] | ||
| 11 | Signed-off-by: Franz Schnyder <franz.schnyder@toradex.com> | ||
| 12 | --- | ||
| 13 | wsi/wayland/surface.hpp | 3 +++ | ||
| 14 | wsi/wayland/surface_properties.cpp | 2 ++ | ||
| 15 | wsi/wayland/swapchain.hpp | 3 +++ | ||
| 16 | wsi/wayland/wl_helpers.hpp | 3 +++ | ||
| 17 | wsi/wayland/wl_object_owner.hpp | 3 +++ | ||
| 18 | 5 files changed, 14 insertions(+) | ||
| 19 | |||
| 20 | diff --git a/wsi/wayland/surface.hpp b/wsi/wayland/surface.hpp | ||
| 21 | index f060f00..92aa598 100644 | ||
| 22 | --- a/wsi/wayland/surface.hpp | ||
| 23 | +++ b/wsi/wayland/surface.hpp | ||
| 24 | @@ -28,9 +28,12 @@ | ||
| 25 | |||
| 26 | #pragma once | ||
| 27 | |||
| 28 | +#ifndef __cplusplus | ||
| 29 | #ifndef __STDC_VERSION__ | ||
| 30 | #define __STDC_VERSION__ 0 | ||
| 31 | #endif | ||
| 32 | +#endif | ||
| 33 | + | ||
| 34 | #include <wayland-client.h> | ||
| 35 | |||
| 36 | #include "wsi/surface.hpp" | ||
| 37 | diff --git a/wsi/wayland/surface_properties.cpp b/wsi/wayland/surface_properties.cpp | ||
| 38 | index e6435b9..caf840d 100644 | ||
| 39 | --- a/wsi/wayland/surface_properties.cpp | ||
| 40 | +++ b/wsi/wayland/surface_properties.cpp | ||
| 41 | @@ -24,9 +24,11 @@ | ||
| 42 | |||
| 43 | #define VK_USE_PLATFORM_WAYLAND_KHR 1 | ||
| 44 | |||
| 45 | +#ifndef __cplusplus | ||
| 46 | #ifndef __STDC_VERSION__ | ||
| 47 | #define __STDC_VERSION__ 0 | ||
| 48 | #endif | ||
| 49 | +#endif | ||
| 50 | |||
| 51 | #include <wayland-client.h> | ||
| 52 | #include <linux-dmabuf-unstable-v1-client-protocol.h> | ||
| 53 | diff --git a/wsi/wayland/swapchain.hpp b/wsi/wayland/swapchain.hpp | ||
| 54 | index 7667324..95096f8 100644 | ||
| 55 | --- a/wsi/wayland/swapchain.hpp | ||
| 56 | +++ b/wsi/wayland/swapchain.hpp | ||
| 57 | @@ -31,9 +31,12 @@ extern "C" { | ||
| 58 | #include <vulkan/vk_icd.h> | ||
| 59 | } | ||
| 60 | |||
| 61 | +#ifndef __cplusplus | ||
| 62 | #ifndef __STDC_VERSION__ | ||
| 63 | #define __STDC_VERSION__ 0 | ||
| 64 | #endif | ||
| 65 | +#endif | ||
| 66 | + | ||
| 67 | #include <wayland-client.h> | ||
| 68 | #include <linux-dmabuf-unstable-v1-client-protocol.h> | ||
| 69 | #include "util/wsialloc/wsialloc.h" | ||
| 70 | diff --git a/wsi/wayland/wl_helpers.hpp b/wsi/wayland/wl_helpers.hpp | ||
| 71 | index 1f6bad6..2ca131b 100644 | ||
| 72 | --- a/wsi/wayland/wl_helpers.hpp | ||
| 73 | +++ b/wsi/wayland/wl_helpers.hpp | ||
| 74 | @@ -26,9 +26,12 @@ | ||
| 75 | |||
| 76 | #include <stdint.h> | ||
| 77 | |||
| 78 | +#ifndef __cplusplus | ||
| 79 | #ifndef __STDC_VERSION__ | ||
| 80 | #define __STDC_VERSION__ 0 | ||
| 81 | #endif | ||
| 82 | +#endif | ||
| 83 | + | ||
| 84 | #include <wayland-client.h> | ||
| 85 | |||
| 86 | #include "util/custom_allocator.hpp" | ||
| 87 | diff --git a/wsi/wayland/wl_object_owner.hpp b/wsi/wayland/wl_object_owner.hpp | ||
| 88 | index d317e28..564fd5a 100644 | ||
| 89 | --- a/wsi/wayland/wl_object_owner.hpp | ||
| 90 | +++ b/wsi/wayland/wl_object_owner.hpp | ||
| 91 | @@ -24,9 +24,12 @@ | ||
| 92 | |||
| 93 | #pragma once | ||
| 94 | |||
| 95 | +#ifndef __cplusplus | ||
| 96 | #ifndef __STDC_VERSION__ | ||
| 97 | #define __STDC_VERSION__ 0 | ||
| 98 | #endif | ||
| 99 | +#endif | ||
| 100 | + | ||
| 101 | #include <wayland-client.h> | ||
| 102 | #include <linux-dmabuf-unstable-v1-client-protocol.h> | ||
| 103 | #include <linux-explicit-synchronization-unstable-v1-protocol.h> | ||
| 104 | -- | ||
| 105 | 2.43.0 | ||
| 106 | |||
diff --git a/recipes-graphics/vulkan/vulkan-wsi-layer_git.bb b/recipes-graphics/vulkan/vulkan-wsi-layer_git.bb index efa6accb3..4abe7db50 100644 --- a/recipes-graphics/vulkan/vulkan-wsi-layer_git.bb +++ b/recipes-graphics/vulkan/vulkan-wsi-layer_git.bb | |||
| @@ -8,7 +8,8 @@ PV = "0.0+git${SRCPV}" | |||
| 8 | SRC_URI = "git://gitlab.freedesktop.org/mesa/vulkan-wsi-layer.git;protocol=https;branch=main \ | 8 | SRC_URI = "git://gitlab.freedesktop.org/mesa/vulkan-wsi-layer.git;protocol=https;branch=main \ |
| 9 | file://0001-MGS-6801-ccc-vkmark-on-wayland.patch \ | 9 | file://0001-MGS-6801-ccc-vkmark-on-wayland.patch \ |
| 10 | file://0002-MGS-6823-nxp-Add-support-of-VK_COMPOSITE_ALPHA_OPAQU.patch \ | 10 | file://0002-MGS-6823-nxp-Add-support-of-VK_COMPOSITE_ALPHA_OPAQU.patch \ |
| 11 | file://0003-Update-minimum-version-of-CMake.patch" | 11 | file://0003-Update-minimum-version-of-CMake.patch \ |
| 12 | file://0001-wayland-Add-C-guard-before-__STDC_VERSION__-define.patch" | ||
| 12 | SRCREV = "cb1a50cf7e640ad7306e673131ded98c0f133628" | 13 | SRCREV = "cb1a50cf7e640ad7306e673131ded98c0f133628" |
| 13 | 14 | ||
| 14 | inherit cmake pkgconfig | 15 | inherit cmake pkgconfig |
