diff options
| author | Changqing Li <changqing.li@windriver.com> | 2024-07-09 15:31:58 +0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-07-23 06:05:47 -0700 |
| commit | eb7fde3372ace65b78809668b95022dfa6f07684 (patch) | |
| tree | 6d7cd72fa53b80f12f4fa4c048ec984cc40972b7 | |
| parent | 45080a022efdaa0b003609c182c241bbf558d7aa (diff) | |
| download | poky-eb7fde3372ace65b78809668b95022dfa6f07684.tar.gz | |
vulkan-samples: fix do_compile error when -Og enabled
When debug build is enabled(-Og is used), vulkan-samples do_compile
failed with error:
In function 'ZSTD_compressBlock_lazy_generic',
inlined from 'ZSTD_compressBlock_greedy' at TOPDIR/tmp-glibc/work/core2-32-wrs-linux/vulkan-samples/git/git/third_party/ktx/lib/basisu/zstd/zstd.c:21914:12:
TOPDIR/tmp-glibc/work/core2-32-wrs-linux/vulkan-samples/git/git/third_party/ktx/lib/basisu/zstd/zstd.c:21551:30: error: inlining failed in call to 'always_inline' 'ZSTD_HcFindBestMatch_selectMLS': function not considered for inlining
| FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_selectMLS (
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TOPDIR/tmp-glibc/work/core2-32-wrs-linux/vulkan-samples/git/git/third_party/ktx/lib/basisu/zstd/zstd.c:21736:32: note: called from here
| size_t const ml2 = searchMax(ms, ip, iend, &offsetFound);
Refer [1], always_inline is not suggested to use with indirect function
call, replace always_inline with inline to fix the issue
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107931
(From OE-Core rev: cfff19bb3fae45e62f77e860a4413669a6dc0e81)
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 246de52fe59de0612d1145357c5e904a51363c8c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-graphics/vulkan/vulkan-samples/0001-zstd.c-replace-FORCE_INLINE_TEMPLATE-with-inline.patch | 52 | ||||
| -rw-r--r-- | meta/recipes-graphics/vulkan/vulkan-samples_git.bb | 1 |
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-graphics/vulkan/vulkan-samples/0001-zstd.c-replace-FORCE_INLINE_TEMPLATE-with-inline.patch b/meta/recipes-graphics/vulkan/vulkan-samples/0001-zstd.c-replace-FORCE_INLINE_TEMPLATE-with-inline.patch new file mode 100644 index 0000000000..22538d4119 --- /dev/null +++ b/meta/recipes-graphics/vulkan/vulkan-samples/0001-zstd.c-replace-FORCE_INLINE_TEMPLATE-with-inline.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | From a7bfe82a311c713b12bb83b8488574ad5c784f89 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Changqing Li <changqing.li@windriver.com> | ||
| 3 | Date: Tue, 9 Jul 2024 04:29:11 +0000 | ||
| 4 | Subject: [PATCH] zstd.c: replace FORCE_INLINE_TEMPLATE with inline | ||
| 5 | |||
| 6 | Refer [1], always-inline is not suggested to be used if you have indirect | ||
| 7 | +calls. so replace FORCE_INLINE_TEMPLATE with inline to fix error: | ||
| 8 | In function 'ZSTD_compressBlock_lazy_generic', | ||
| 9 | inlined from 'ZSTD_compressBlock_greedy' at TOPDIR/tmp-glibc/work/core2-32-wrs-linux/vulkan-samples/git/git/third_party/ktx/lib/basisu/zstd/zstd.c:21914:12: | ||
| 10 | TOPDIR/tmp-glibc/work/core2-32-wrs-linux/vulkan-samples/git/git/third_party/ktx/lib/basisu/zstd/zstd.c:21551:30: error: inlining failed in call to 'always_inline' 'ZSTD_HcFindBestMatch_selectMLS': function not considered for inlining | ||
| 11 | | FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_selectMLS ( | ||
| 12 | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 13 | TOPDIR/tmp-glibc/work/core2-32-wrs-linux/vulkan-samples/git/git/third_party/ktx/lib/basisu/zstd/zstd.c:21736:32: note: called from here | ||
| 14 | | size_t const ml2 = searchMax(ms, ip, iend, &offsetFound); | ||
| 15 | |||
| 16 | Upstream-Status: Inappropriate [ Latest upstream ktx don't have this part code ] | ||
| 17 | |||
| 18 | Has report this issue to upstream Vulkan-Samples, refer [2] | ||
| 19 | |||
| 20 | [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107931 | ||
| 21 | [2] https://github.com/KhronosGroup/Vulkan-Samples/issues/1089 | ||
| 22 | |||
| 23 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 24 | --- | ||
| 25 | lib/basisu/zstd/zstd.c | 4 ++-- | ||
| 26 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 27 | |||
| 28 | diff --git a/lib/basisu/zstd/zstd.c b/lib/basisu/zstd/zstd.c | ||
| 29 | index eaf13738..423f149e 100644 | ||
| 30 | --- a/lib/basisu/zstd/zstd.c | ||
| 31 | +++ b/lib/basisu/zstd/zstd.c | ||
| 32 | @@ -21548,7 +21548,7 @@ size_t ZSTD_HcFindBestMatch_generic ( | ||
| 33 | } | ||
| 34 | |||
| 35 | |||
| 36 | -FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_selectMLS ( | ||
| 37 | +static inline size_t ZSTD_HcFindBestMatch_selectMLS ( | ||
| 38 | ZSTD_matchState_t* ms, | ||
| 39 | const BYTE* ip, const BYTE* const iLimit, | ||
| 40 | size_t* offsetPtr) | ||
| 41 | @@ -21596,7 +21596,7 @@ static size_t ZSTD_HcFindBestMatch_dedicatedDictSearch_selectMLS ( | ||
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | -FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_extDict_selectMLS ( | ||
| 46 | +static inline size_t ZSTD_HcFindBestMatch_extDict_selectMLS ( | ||
| 47 | ZSTD_matchState_t* ms, | ||
| 48 | const BYTE* ip, const BYTE* const iLimit, | ||
| 49 | size_t* offsetPtr) | ||
| 50 | -- | ||
| 51 | 2.44.0 | ||
| 52 | |||
diff --git a/meta/recipes-graphics/vulkan/vulkan-samples_git.bb b/meta/recipes-graphics/vulkan/vulkan-samples_git.bb index d60c0f3190..4e688e44a7 100644 --- a/meta/recipes-graphics/vulkan/vulkan-samples_git.bb +++ b/meta/recipes-graphics/vulkan/vulkan-samples_git.bb | |||
| @@ -10,6 +10,7 @@ SRC_URI = "gitsm://github.com/KhronosGroup/Vulkan-Samples.git;branch=main;protoc | |||
| 10 | file://0001-Do-not-use-LFS64-functions-on-linux-musl.patch;patchdir=third_party/spdlog \ | 10 | file://0001-Do-not-use-LFS64-functions-on-linux-musl.patch;patchdir=third_party/spdlog \ |
| 11 | file://0001-Deprecate-u8string_view.patch;patchdir=third_party/spdlog \ | 11 | file://0001-Deprecate-u8string_view.patch;patchdir=third_party/spdlog \ |
| 12 | file://32bit.patch \ | 12 | file://32bit.patch \ |
| 13 | file://0001-zstd.c-replace-FORCE_INLINE_TEMPLATE-with-inline.patch;patchdir=third_party/ktx \ | ||
| 13 | " | 14 | " |
| 14 | 15 | ||
| 15 | UPSTREAM_CHECK_COMMITS = "1" | 16 | UPSTREAM_CHECK_COMMITS = "1" |
