diff options
-rw-r--r-- | meta-oe/recipes-extended/snappy/snappy/0001-Add-inline-with-SNAPPY_ATTRIBUTE_ALWAYS_INLINE.patch | 71 | ||||
-rw-r--r-- | meta-oe/recipes-extended/snappy/snappy_1.1.9.bb | 4 |
2 files changed, 74 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/snappy/snappy/0001-Add-inline-with-SNAPPY_ATTRIBUTE_ALWAYS_INLINE.patch b/meta-oe/recipes-extended/snappy/snappy/0001-Add-inline-with-SNAPPY_ATTRIBUTE_ALWAYS_INLINE.patch new file mode 100644 index 0000000000..27357d88aa --- /dev/null +++ b/meta-oe/recipes-extended/snappy/snappy/0001-Add-inline-with-SNAPPY_ATTRIBUTE_ALWAYS_INLINE.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | From 4728803cc8687431449c8c9fbfabb1da04943400 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Georgi D. Sotirov" <gdsotirov@gmail.com> | ||
3 | Date: Wed, 5 May 2021 14:16:46 +0300 | ||
4 | Subject: [PATCH] Add inline with SNAPPY_ATTRIBUTE_ALWAYS_INLINE | ||
5 | |||
6 | Add inline with SNAPPY_ATTRIBUTE_ALWAYS_INLINE on AdvanceToNextTag to | ||
7 | fix the following compilation errors and a warning with GCC: | ||
8 | |||
9 | [ 2%] Building CXX object CMakeFiles/snappy.dir/snappy.cc.o | ||
10 | /usr/bin/c++ -DHAVE_CONFIG_H -Dsnappy_EXPORTS | ||
11 | -I/tmp/snappy-1.1.9/build -I/tmp/snappy-1.1.9 -O3 | ||
12 | -march=i586 -mtune=i686 -Wall -Wextra -fno-exceptions -fno-rtti -O3 | ||
13 | -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/snappy.dir/snappy.cc.o -c | ||
14 | /tmp/snappy-1.1.9/snappy.cc | ||
15 | /tmp/snappy-1.1.9/snappy.cc:1017:8: warning: always_inline | ||
16 | function might not be inlinable [-Wattributes] | ||
17 | size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { | ||
18 | ^ | ||
19 | /tmp/snappy-1.1.9/snappy.cc: In function 'std::pair<const | ||
20 | unsigned char*, int> snappy::DecompressBranchless(const uint8_t*, const | ||
21 | uint8_t*, ptrdiff_t, T, ptrdiff_t) [with T = char*; uint8_t = unsigned | ||
22 | char; ptrdiff_t = int]': | ||
23 | /tmp/snappy-1.1.9/snappy.cc:1017:8: error: inlining failed in | ||
24 | call to always_inline 'size_t snappy::AdvanceToNextTag(const uint8_t**, | ||
25 | size_t*)': function body can be overwritten at link time | ||
26 | /tmp/snappy-1.1.9/snappy.cc:1097:53: error: called from here | ||
27 | size_t tag_type = AdvanceToNextTag(&ip, &tag); | ||
28 | ^ | ||
29 | /tmp/snappy-1.1.9/snappy.cc:1017:8: error: inlining failed in | ||
30 | call to always_inline 'size_t snappy::AdvanceToNextTag(const uint8_t**, | ||
31 | size_t*)': function body can be overwritten at link time | ||
32 | size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { | ||
33 | ^ | ||
34 | /tmp/snappy-1.1.9/snappy.cc:1097:53: error: called from here | ||
35 | size_t tag_type = AdvanceToNextTag(&ip, &tag); | ||
36 | ^ | ||
37 | /tmp/snappy-1.1.9/snappy.cc:1017:8: error: inlining failed in | ||
38 | call to always_inline 'size_t snappy::AdvanceToNextTag(const uint8_t**, | ||
39 | size_t*)': function body can be overwritten at link time | ||
40 | size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { | ||
41 | ^ | ||
42 | /tmp/snappy-1.1.9/snappy.cc:1097:53: error: called from here | ||
43 | size_t tag_type = AdvanceToNextTag(&ip, &tag); | ||
44 | ^ | ||
45 | CMakeFiles/snappy.dir/build.make:137: recipe for target | ||
46 | 'CMakeFiles/snappy.dir/snappy.cc.o' failed | ||
47 | |||
48 | Just like with other functions using SNAPPY_ATTRIBUTE_ALWAYS_INLINE | ||
49 | macro (i.e. __attribute__((always_inline)) ) it is necessary to use C++ | ||
50 | inline specifier. | ||
51 | |||
52 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
53 | |||
54 | Upstream-Status: Submitted [https://github.com/google/snappy/pull/128] | ||
55 | --- | ||
56 | snappy.cc | 2 +- | ||
57 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
58 | |||
59 | diff --git a/snappy.cc b/snappy.cc | ||
60 | index 79dc0e8..51157be 100644 | ||
61 | --- a/snappy.cc | ||
62 | +++ b/snappy.cc | ||
63 | @@ -1014,7 +1014,7 @@ void MemMove(ptrdiff_t dst, const void* src, size_t size) { | ||
64 | } | ||
65 | |||
66 | SNAPPY_ATTRIBUTE_ALWAYS_INLINE | ||
67 | -size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { | ||
68 | +inline size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { | ||
69 | const uint8_t*& ip = *ip_p; | ||
70 | // This section is crucial for the throughput of the decompression loop. | ||
71 | // The latency of an iteration is fundamentally constrained by the | ||
diff --git a/meta-oe/recipes-extended/snappy/snappy_1.1.9.bb b/meta-oe/recipes-extended/snappy/snappy_1.1.9.bb index 151c4ddc38..5c786d8913 100644 --- a/meta-oe/recipes-extended/snappy/snappy_1.1.9.bb +++ b/meta-oe/recipes-extended/snappy/snappy_1.1.9.bb | |||
@@ -10,7 +10,9 @@ compression ratio." | |||
10 | LICENSE = "BSD-3-Clause" | 10 | LICENSE = "BSD-3-Clause" |
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=f62f3080324a97b3159a7a7e61812d0c" | 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=f62f3080324a97b3159a7a7e61812d0c" |
12 | 12 | ||
13 | SRC_URI = "gitsm://github.com/google/snappy.git;protocol=https" | 13 | SRC_URI = "gitsm://github.com/google/snappy.git;protocol=https \ |
14 | file://0001-Add-inline-with-SNAPPY_ATTRIBUTE_ALWAYS_INLINE.patch \ | ||
15 | " | ||
14 | SRCREV = "2b63814b15a2aaae54b7943f0cd935892fae628f" | 16 | SRCREV = "2b63814b15a2aaae54b7943f0cd935892fae628f" |
15 | S = "${WORKDIR}/git" | 17 | S = "${WORKDIR}/git" |
16 | 18 | ||