summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-13 23:07:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-15 13:39:25 +0000
commit49c12484ebb80d72cc84aaba8dc3fc9f2954b4db (patch)
tree281d7a9031d60698c9f16f8d7f2ea3a0e213d50c /meta/recipes-graphics
parent09c7fc6e5341bfadb0f6037e7294aee2454eedef (diff)
downloadpoky-49c12484ebb80d72cc84aaba8dc3fc9f2954b4db.tar.gz
vulkan-samples: Fix reproducibility issue
There is code to remove the prefix CMAKE_SOURCE_DIR from __FILENAME__ paths used for logging with LOGE() in the code. We need to make this match the value we use in the debug source remapping from CFLAGS. If we don't, the code is firstly removing the incorrect prefix and possibly moving outside the string, secondly, it causes a reproducibility issue depending on the length of path the build happens in. Add a small patch and configuration to avoid the issue. (From OE-Core rev: 410dbfd1f82b4862ced6fca88789edf0fd9d65df) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r--meta/recipes-graphics/vulkan/vulkan-samples/debugfix.patch31
-rw-r--r--meta/recipes-graphics/vulkan/vulkan-samples_git.bb8
2 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-graphics/vulkan/vulkan-samples/debugfix.patch b/meta/recipes-graphics/vulkan/vulkan-samples/debugfix.patch
new file mode 100644
index 0000000000..d723fcc19a
--- /dev/null
+++ b/meta/recipes-graphics/vulkan/vulkan-samples/debugfix.patch
@@ -0,0 +1,31 @@
1There is code to remove the prefix CMAKE_SOURCE_DIR from __FILENAME__ paths
2used for logging with LOGE() in the code. We need to make this match the value we use
3in the debug source remapping from CFLAGS
4
5We export the right path to use in the recipe with:
6
7EXTRA_OECMAKE = "-DCMAKE_DEBUG_SRCDIR=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/"
8
9and we then patch this into the code instead of the broken use
10of CMAKE_SOURCE_DIR since __FILENAME__ will match our path prefix
11changes.
12
13This also breaks reproducibility since the path length of the build directory
14will currently change the output!
15
16Upstream-Status: Pending [needs to be discussed upstream]
17Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
18
19Index: git/bldsys/cmake/global_options.cmake
20===================================================================
21--- git.orig/bldsys/cmake/global_options.cmake
22+++ git/bldsys/cmake/global_options.cmake
23@@ -47,7 +47,7 @@ set(CMAKE_CXX_STANDARD 14)
24 set(CMAKE_DISABLE_SOURCE_CHANGES ON)
25 set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
26
27-string(LENGTH "${CMAKE_SOURCE_DIR}/" ROOT_PATH_SIZE)
28+string(LENGTH "${CMAKE_DEBUG_SRCDIR}/" ROOT_PATH_SIZE)
29 add_definitions(-DROOT_PATH_SIZE=${ROOT_PATH_SIZE})
30
31 set(CMAKE_C_FLAGS_DEBUG "-DDEBUG=0 ${CMAKE_C_FLAGS_DEBUG}")
diff --git a/meta/recipes-graphics/vulkan/vulkan-samples_git.bb b/meta/recipes-graphics/vulkan/vulkan-samples_git.bb
index 896b248327..447d498fb3 100644
--- a/meta/recipes-graphics/vulkan/vulkan-samples_git.bb
+++ b/meta/recipes-graphics/vulkan/vulkan-samples_git.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=48aa35cefb768436223a6e7f18dc2a2a"
6SRC_URI = "gitsm://github.com/KhronosGroup/Vulkan-Samples.git \ 6SRC_URI = "gitsm://github.com/KhronosGroup/Vulkan-Samples.git \
7 file://0001-CMakeLists.txt-do-not-hardcode-lib-as-installation-t.patch \ 7 file://0001-CMakeLists.txt-do-not-hardcode-lib-as-installation-t.patch \
8 file://0001-support-link-against-libatomic-if-no-built-in-atomic.patch \ 8 file://0001-support-link-against-libatomic-if-no-built-in-atomic.patch \
9 file://debugfix.patch \
9 " 10 "
10 11
11UPSTREAM_CHECK_COMMITS = "1" 12UPSTREAM_CHECK_COMMITS = "1"
@@ -19,3 +20,10 @@ REQUIRED_DISTRO_FEATURES = 'vulkan'
19inherit cmake features_check 20inherit cmake features_check
20 21
21FILES_${PN} += "${datadir}" 22FILES_${PN} += "${datadir}"
23
24#
25# There is code to remove the prefix CMAKE_SOURCE_DIR from __FILENAME__ paths
26# used for logging with LOGE in the code. We need to make this match the value we use
27# in the debug source remapping from CFLAGS
28#
29EXTRA_OECMAKE = "-DCMAKE_DEBUG_SRCDIR=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/" \ No newline at end of file