Skip to contentSkip to conversation

vk-gl-cts: Fix O_TRUNC conflict with fcntl.h

PATCH New Khem Raj 1 participant 1 message Jun 1, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 vk-gl-cts: Fix O_TRUNC conflict with fcntl.h

---
 .../vk-gl-cts/files/0001-vulkancts.patch      | 40 +++++++++++++++++++
 .../vk-gl-cts/khronos-cts.inc                 |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkancts.patch
meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkancts.patch new file +40 -0
new file mode 100644
index 0000000000..2fd1d7123a
@@ -0,0 +1,40 @@
+From 273df2423d9226093310cbcaa8b924bb6b5d6586 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 31 May 2021 17:31:33 -0700
+Subject: [PATCH] vulkancts:
+
+O_TRUNC value in OperationId enum collides with the macro O_TRUNC
+defined in the POSIX header fnctl.h. To avoid the collision undefine
+O_TRUNC in this particular sourcefile before its is used in enums
+down below.
+
+This is fixed upstream differently
+https://github.com/KhronosGroup/VK-GL-CTS/commit/564c6062f72fe7ecd92b4aea1558c441e651c76b
+
+But until we get this module uprev'ed to that, lets use a simpler
+workaround
+
+Upstream-Status: Inappropriate [Fixed Differently]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ .../vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp     | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp
+index 22e6c75fa..db7f4b54a 100644
+--- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp
++++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp
+@@ -38,6 +38,10 @@
+ #include <limits>
+ #include <fenv.h>
+ 
++#ifdef O_TRUNC
++#undef O_TRUNC
++#endif
++
+ namespace vkt
+ {
+ namespace SpirVAssembly
+-- 
+2.31.1
+
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +1 -0
index d0f0e23429..dc38bd1697 100644
@@ -24,6 +24,7 @@ DEPENDS += "libpng zlib virtual/libgles2 virtual/egl"
 
 SRC_URI += "file://0001-Workaround-for-GCC-11-uninit-variable-warnings-946.patch;patchdir=external/amber/src \
             file://0001-Include-limits-header-for-numeric_limits.patch;patchdir=external/vulkancts \
+            file://0001-vulkancts.patch \
 "
 
 SRC_URI_append_libc-musl = "\
Signature · 1 line
2.31.1