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
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);
16 Upstream-Status: Inappropriate [ Latest upstream ktx don't have this part code ]
18 Has report this issue to upstream Vulkan-Samples, refer [2]
20 [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107931
21 [2] https://github.com/KhronosGroup/Vulkan-Samples/issues/1089
23 Signed-off-by: Changqing Li <changqing.li@windriver.com>
25 lib/basisu/zstd/zstd.c | 4 ++--
26 1 file changed, 2 insertions(+), 2 deletions(-)
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 (
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,
41 @@ -21596,7 +21596,7 @@ static size_t ZSTD_HcFindBestMatch_dedicatedDictSearch_selectMLS (
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,