Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 1 | From d998c753254649c7cf7c64e3fed78e41c11ad7ed Mon Sep 17 00:00:00 2001 |
| 2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 3 | Date: Wed, 23 Aug 2023 09:38:37 +0200 |
| 4 | Subject: [PATCH] vulkan-samples: Fix reproducibility issue |
| 5 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 6 | There is code to remove the prefix CMAKE_SOURCE_DIR from __FILENAME__ paths |
| 7 | used for logging with LOGE() in the code. We need to make this match the value we use |
| 8 | in the debug source remapping from CFLAGS |
| 9 | |
| 10 | We export the right path to use in the recipe with: |
| 11 | |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 12 | EXTRA_OECMAKE = "-DCMAKE_DEBUG_SRCDIR=${TARGET_DBGSRC_DIR}/" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 13 | |
| 14 | and we then patch this into the code instead of the broken use |
| 15 | of CMAKE_SOURCE_DIR since __FILENAME__ will match our path prefix |
| 16 | changes. |
| 17 | |
| 18 | This also breaks reproducibility since the path length of the build directory |
| 19 | will currently change the output! |
| 20 | |
| 21 | Upstream-Status: Pending [needs to be discussed upstream] |
| 22 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 23 | |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 24 | Signed-off-by: Julien Stephan <jstephan@baylibre.com> |
| 25 | --- |
| 26 | bldsys/cmake/global_options.cmake | 2 +- |
| 27 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 28 | |
| 29 | diff --git a/bldsys/cmake/global_options.cmake b/bldsys/cmake/global_options.cmake |
| 30 | index b15c2da..d8952e5 100644 |
| 31 | --- a/bldsys/cmake/global_options.cmake |
| 32 | +++ b/bldsys/cmake/global_options.cmake |
| 33 | @@ -62,7 +62,7 @@ set(CMAKE_CXX_STANDARD 14) |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 34 | set(CMAKE_DISABLE_SOURCE_CHANGES ON) |
| 35 | set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) |
| 36 | |
| 37 | -string(LENGTH "${CMAKE_SOURCE_DIR}/" ROOT_PATH_SIZE) |
| 38 | +string(LENGTH "${CMAKE_DEBUG_SRCDIR}/" ROOT_PATH_SIZE) |
| 39 | add_definitions(-DROOT_PATH_SIZE=${ROOT_PATH_SIZE}) |
| 40 | |
| 41 | set(CMAKE_C_FLAGS_DEBUG "-DDEBUG=0 ${CMAKE_C_FLAGS_DEBUG}") |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 42 | -- |
| 43 | 2.41.0 |