From 25ea6f4163e6529820d23fb5fcb31d8ed497afb3 Mon Sep 17 00:00:00 2001 From: Redbeanw44602 Date: Wed, 1 Jan 2025 21:38:34 +0800 Subject: [PATCH 1/8] snappy: update to 1.2.1 --- packages/s/snappy/xmake.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index 6f2b8be4ba4..aef39eb90c6 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -8,6 +8,8 @@ package("snappy") add_versions("1.1.8", "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f") add_versions("1.1.9", "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7") add_versions("1.1.10", "49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90") + add_versions("1.2.0", "9b8f10fbb5e3bc112f2e5e64f813cb73faea42ec9c533a5023b5ae08aedef42e") + add_versions("1.2.1", "736aeb64d86566d2236ddffa2865ee5d7a82d26c9016b36218fcc27ea4f09f86") add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb") From f98a7ac3c8dff96c4f546c8ca5b85791f34bfe38 Mon Sep 17 00:00:00 2001 From: Redbeanw44602 Date: Wed, 1 Jan 2025 21:59:13 +0800 Subject: [PATCH 2/8] snappy: switch the language standard for testing under windows to c++14 *MSVC does not support c++11, and an error will occur if clang is used to test. --- packages/s/snappy/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index aef39eb90c6..f5e118deb27 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -43,5 +43,5 @@ package("snappy") void test(int args, char** argv) { snappy::Compress(nullptr, nullptr); } - ]]}, {configs = {languages = "c++11"}, includes = "snappy.h"})) + ]]}, {configs = {languages = package:is_plat("windows") and "c++14" or "c++11"}, includes = "snappy.h"})) end) From e99bdc39f7ee990fdb2a16f853d185ae99948834 Mon Sep 17 00:00:00 2001 From: Redbeanw44602 Date: Fri, 3 Jan 2025 00:35:03 +0800 Subject: [PATCH 3/8] snappy: fix build under arm-gnueabihf --- ...error-raised-by-vqtbl1q_u8-instructi.patch | 52 +++++++++++++++++++ packages/s/snappy/xmake.lua | 1 + 2 files changed, 53 insertions(+) create mode 100644 packages/s/snappy/patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch diff --git a/packages/s/snappy/patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch b/packages/s/snappy/patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch new file mode 100644 index 00000000000..b10ea7ecdfb --- /dev/null +++ b/packages/s/snappy/patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch @@ -0,0 +1,52 @@ +From 284d5a6f267d4962b2b88540f218c10740a6c053 Mon Sep 17 00:00:00 2001 +From: Dario Binacchi +Date: Sat, 8 Jun 2024 18:42:16 +0200 +Subject: [PATCH] Fix compilation error raised by vqtbl1q_u8 instruction +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The compilation in Buildroot for the raspberrypi3_qt5we_defconfig +configuration: + +make raspberrypi3_qt5we_defconfig +make + +raises the following error: + +In file included from buildroot/output/build/snappy-1.2.1/snappy.cc:29: +buildroot/output/build/snappy-1.2.1/snappy-internal.h: In function ‘snappy::internal::V128 snappy::internal::V128_Shuffle(V128, V128)’: +buildroot/output/build/snappy-1.2.1/snappy-internal.h:109:10: error: ‘vqtbl1q_u8’ was not declared in this scope; did you mean ‘vtbl1_u8’? + 109 | return vqtbl1q_u8(input, shuffle_mask); + | ^~~~~~~~~~ + | vtbl1_u8 +make[4]: *** [CMakeFiles/snappy.dir/build.make:118: CMakeFiles/snappy.dir/snappy.cc.o] Error 1 + +As reported by [1], the vqtbl1q_u8 instruction is supported by A64 +architectures. For this reason, the patch enables the use of the +instruction only for NEON of such architecture. + +[1] https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbl1q_u8 + +Signed-off-by: Dario Binacchi +Upstream: https://github.com/google/snappy/pull/185 +--- + snappy-internal.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/snappy-internal.h b/snappy-internal.h +index ae78247dbbc9..256d32344d1a 100644 +--- a/snappy-internal.h ++++ b/snappy-internal.h +@@ -46,7 +46,7 @@ + #include + #endif + +-#if SNAPPY_HAVE_SSSE3 || SNAPPY_HAVE_NEON ++#if SNAPPY_HAVE_SSSE3 || (SNAPPY_HAVE_NEON && defined(__aarch64__)) + #define SNAPPY_HAVE_VECTOR_BYTE_SHUFFLE 1 + #else + #define SNAPPY_HAVE_VECTOR_BYTE_SHUFFLE 0 +-- +2.43.0 + diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index f5e118deb27..3d9ec889853 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -13,6 +13,7 @@ package("snappy") add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb") + add_patches("1.2.1", "patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch", "bac4e4ba7f5503c13968d18d86634715244ca278497a6916185bc432e91d2220") add_deps("cmake") From f2afd0459ead90d5ea5f1cf05bbdf7ff8fb2f690 Mon Sep 17 00:00:00 2001 From: Redbeanw44602 Date: Fri, 3 Jan 2025 11:52:42 +0800 Subject: [PATCH 4/8] snappy: update patch. --- ...error-raised-by-vqtbl1q_u8-instructi.patch | 52 ------------------- ...s-NEON-flag-to-reflect-only-AArch64-.patch | 33 ++++++++++++ packages/s/snappy/xmake.lua | 2 +- 3 files changed, 34 insertions(+), 53 deletions(-) delete mode 100644 packages/s/snappy/patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch create mode 100644 packages/s/snappy/patches/1.2.1/0001-Update-CMakeLists-NEON-flag-to-reflect-only-AArch64-.patch diff --git a/packages/s/snappy/patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch b/packages/s/snappy/patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch deleted file mode 100644 index b10ea7ecdfb..00000000000 --- a/packages/s/snappy/patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 284d5a6f267d4962b2b88540f218c10740a6c053 Mon Sep 17 00:00:00 2001 -From: Dario Binacchi -Date: Sat, 8 Jun 2024 18:42:16 +0200 -Subject: [PATCH] Fix compilation error raised by vqtbl1q_u8 instruction -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The compilation in Buildroot for the raspberrypi3_qt5we_defconfig -configuration: - -make raspberrypi3_qt5we_defconfig -make - -raises the following error: - -In file included from buildroot/output/build/snappy-1.2.1/snappy.cc:29: -buildroot/output/build/snappy-1.2.1/snappy-internal.h: In function ‘snappy::internal::V128 snappy::internal::V128_Shuffle(V128, V128)’: -buildroot/output/build/snappy-1.2.1/snappy-internal.h:109:10: error: ‘vqtbl1q_u8’ was not declared in this scope; did you mean ‘vtbl1_u8’? - 109 | return vqtbl1q_u8(input, shuffle_mask); - | ^~~~~~~~~~ - | vtbl1_u8 -make[4]: *** [CMakeFiles/snappy.dir/build.make:118: CMakeFiles/snappy.dir/snappy.cc.o] Error 1 - -As reported by [1], the vqtbl1q_u8 instruction is supported by A64 -architectures. For this reason, the patch enables the use of the -instruction only for NEON of such architecture. - -[1] https://developer.arm.com/architectures/instruction-sets/intrinsics/vqtbl1q_u8 - -Signed-off-by: Dario Binacchi -Upstream: https://github.com/google/snappy/pull/185 ---- - snappy-internal.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/snappy-internal.h b/snappy-internal.h -index ae78247dbbc9..256d32344d1a 100644 ---- a/snappy-internal.h -+++ b/snappy-internal.h -@@ -46,7 +46,7 @@ - #include - #endif - --#if SNAPPY_HAVE_SSSE3 || SNAPPY_HAVE_NEON -+#if SNAPPY_HAVE_SSSE3 || (SNAPPY_HAVE_NEON && defined(__aarch64__)) - #define SNAPPY_HAVE_VECTOR_BYTE_SHUFFLE 1 - #else - #define SNAPPY_HAVE_VECTOR_BYTE_SHUFFLE 0 --- -2.43.0 - diff --git a/packages/s/snappy/patches/1.2.1/0001-Update-CMakeLists-NEON-flag-to-reflect-only-AArch64-.patch b/packages/s/snappy/patches/1.2.1/0001-Update-CMakeLists-NEON-flag-to-reflect-only-AArch64-.patch new file mode 100644 index 00000000000..2389c4085ce --- /dev/null +++ b/packages/s/snappy/patches/1.2.1/0001-Update-CMakeLists-NEON-flag-to-reflect-only-AArch64-.patch @@ -0,0 +1,33 @@ +From 32ded457c0b1fe78ceb8397632c416568d6714a0 Mon Sep 17 00:00:00 2001 +From: Danila Kutenin +Date: Sat, 17 Aug 2024 19:03:10 -0700 +Subject: [PATCH] Update CMakeLists NEON flag to reflect only AArch64 NEON + optimizations + +--- + CMakeLists.txt | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 644df24..b1d072c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -206,10 +206,13 @@ int main() { + + check_cxx_source_compiles(" + #include ++#include + int main() { + uint8_t val = 3, dup[8]; +- uint8x16_t v = vld1q_dup_u8(&val); +- vst1q_u8(dup, v); ++ uint8x16_t v1 = vld1q_dup_u8(&val); ++ uint8x16_t v2 = vqtbl1q_u8(v1, v1); ++ vst1q_u8(dup, v1); ++ vst1q_u8(dup, v2); + return 0; + }" SNAPPY_HAVE_NEON) + +-- +2.47.1 + diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index 3d9ec889853..a0c41c783e5 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -13,7 +13,7 @@ package("snappy") add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb") - add_patches("1.2.1", "patches/1.2.1/0001-Fix-compilation-error-raised-by-vqtbl1q_u8-instructi.patch", "bac4e4ba7f5503c13968d18d86634715244ca278497a6916185bc432e91d2220") + add_patches("1.2.1", "patches/1.2.1/0001-Update-CMakeLists-NEON-flag-to-reflect-only-AArch64-.patch", "13100aa56de71a11bb3704bd7507613fd53caa3ab6e7dbec3de74875deb46ba5") add_deps("cmake") From a76ab0422366887980a8a119cffd2c65c699d8ab Mon Sep 17 00:00:00 2001 From: Redbeanw44602 Date: Fri, 3 Jan 2025 11:57:20 +0800 Subject: [PATCH 5/8] snappy: update patch. --- ...sts-NEON-flag-to-reflect-only-AArch64-.patch => cmake.patch} | 0 packages/s/snappy/xmake.lua | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/s/snappy/patches/1.2.1/{0001-Update-CMakeLists-NEON-flag-to-reflect-only-AArch64-.patch => cmake.patch} (100%) diff --git a/packages/s/snappy/patches/1.2.1/0001-Update-CMakeLists-NEON-flag-to-reflect-only-AArch64-.patch b/packages/s/snappy/patches/1.2.1/cmake.patch similarity index 100% rename from packages/s/snappy/patches/1.2.1/0001-Update-CMakeLists-NEON-flag-to-reflect-only-AArch64-.patch rename to packages/s/snappy/patches/1.2.1/cmake.patch diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index a0c41c783e5..6757810fd0f 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -13,7 +13,7 @@ package("snappy") add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb") - add_patches("1.2.1", "patches/1.2.1/0001-Update-CMakeLists-NEON-flag-to-reflect-only-AArch64-.patch", "13100aa56de71a11bb3704bd7507613fd53caa3ab6e7dbec3de74875deb46ba5") + add_patches("1.2.1", "patches/1.2.1/cmake.patch", "13100aa56de71a11bb3704bd7507613fd53caa3ab6e7dbec3de74875deb46ba5") add_deps("cmake") From 97dba76d7529b27feec4a2ceb2c4f08d066f5a2b Mon Sep 17 00:00:00 2001 From: Redbeanw44602 Date: Fri, 3 Jan 2025 12:01:38 +0800 Subject: [PATCH 6/8] snappy: apply patch to 1.2.0 --- packages/s/snappy/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index 6757810fd0f..80ad51540b4 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -13,7 +13,7 @@ package("snappy") add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb") - add_patches("1.2.1", "patches/1.2.1/cmake.patch", "13100aa56de71a11bb3704bd7507613fd53caa3ab6e7dbec3de74875deb46ba5") + add_patches(">=1.2.0 <=1.2.1", "patches/1.2.1/cmake.patch", "13100aa56de71a11bb3704bd7507613fd53caa3ab6e7dbec3de74875deb46ba5") add_deps("cmake") From a67c168014166ebb444c9acf5cd1aba91a2900ac Mon Sep 17 00:00:00 2001 From: Redbeanw44602 Date: Fri, 3 Jan 2025 12:15:13 +0800 Subject: [PATCH 7/8] snappy: fix build under android ndk r27. --- ...e.patch => update-neon-flag-aarch64.patch} | 0 .../fix-build-under-android-ndk-r27.patch | 25 +++++++++++++++++++ packages/s/snappy/xmake.lua | 3 ++- 3 files changed, 27 insertions(+), 1 deletion(-) rename packages/s/snappy/patches/1.2.1/{cmake.patch => update-neon-flag-aarch64.patch} (100%) create mode 100644 packages/s/snappy/patches/fix-build-under-android-ndk-r27.patch diff --git a/packages/s/snappy/patches/1.2.1/cmake.patch b/packages/s/snappy/patches/1.2.1/update-neon-flag-aarch64.patch similarity index 100% rename from packages/s/snappy/patches/1.2.1/cmake.patch rename to packages/s/snappy/patches/1.2.1/update-neon-flag-aarch64.patch diff --git a/packages/s/snappy/patches/fix-build-under-android-ndk-r27.patch b/packages/s/snappy/patches/fix-build-under-android-ndk-r27.patch new file mode 100644 index 00000000000..bb4f3c5109c --- /dev/null +++ b/packages/s/snappy/patches/fix-build-under-android-ndk-r27.patch @@ -0,0 +1,25 @@ +From 3adc68d24e6d9546d871e7e57615a0fb30d92af3 Mon Sep 17 00:00:00 2001 +From: Redbeanw44602 +Date: Fri, 3 Jan 2025 12:11:56 +0800 +Subject: [PATCH] fix build under android ndk-r27 + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b1d072c..89b5509 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,7 +26,7 @@ + # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.3) + project(Snappy VERSION 1.2.1 LANGUAGES C CXX) + + # C++ standard can be overridden when this is used as a sub-project. +-- +2.47.1 + diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index 80ad51540b4..81af21a3bbc 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -13,7 +13,8 @@ package("snappy") add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb") - add_patches(">=1.2.0 <=1.2.1", "patches/1.2.1/cmake.patch", "13100aa56de71a11bb3704bd7507613fd53caa3ab6e7dbec3de74875deb46ba5") + add_patches(">=1.2.0 <=1.2.1", "patches/1.2.1/update-neon-flag-aarch64.patch", "13100aa56de71a11bb3704bd7507613fd53caa3ab6e7dbec3de74875deb46ba5") + add_patches("*", "patches/fix-build-under-android-ndk-r27.patch", "f3dcfd51072957c68ca9c404fe1f13a773ab76a187eeb2f73c2958c942d80a90") add_deps("cmake") From cacc0af5d9d6853018275b07605c30b112324d84 Mon Sep 17 00:00:00 2001 From: Redbeanw44602 Date: Fri, 3 Jan 2025 12:51:47 +0800 Subject: [PATCH 8/8] snappy: fix build. --- .../fix-build-under-android-ndk-r27.patch | 25 ------------------- packages/s/snappy/xmake.lua | 2 +- 2 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 packages/s/snappy/patches/fix-build-under-android-ndk-r27.patch diff --git a/packages/s/snappy/patches/fix-build-under-android-ndk-r27.patch b/packages/s/snappy/patches/fix-build-under-android-ndk-r27.patch deleted file mode 100644 index bb4f3c5109c..00000000000 --- a/packages/s/snappy/patches/fix-build-under-android-ndk-r27.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 3adc68d24e6d9546d871e7e57615a0fb30d92af3 Mon Sep 17 00:00:00 2001 -From: Redbeanw44602 -Date: Fri, 3 Jan 2025 12:11:56 +0800 -Subject: [PATCH] fix build under android ndk-r27 - ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b1d072c..89b5509 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -26,7 +26,7 @@ - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --cmake_minimum_required(VERSION 3.1) -+cmake_minimum_required(VERSION 3.3) - project(Snappy VERSION 1.2.1 LANGUAGES C CXX) - - # C++ standard can be overridden when this is used as a sub-project. --- -2.47.1 - diff --git a/packages/s/snappy/xmake.lua b/packages/s/snappy/xmake.lua index 81af21a3bbc..84d96cd42e0 100644 --- a/packages/s/snappy/xmake.lua +++ b/packages/s/snappy/xmake.lua @@ -14,7 +14,6 @@ package("snappy") add_patches("1.1.9", "patches/1.1.9/inline.patch", "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b") add_patches("1.1.10", "patches/1.1.10/cmake.patch", "d4883111dcfab81ea35ac1e4e157e55105cec02a0ba804458405be25cbf7b6bb") add_patches(">=1.2.0 <=1.2.1", "patches/1.2.1/update-neon-flag-aarch64.patch", "13100aa56de71a11bb3704bd7507613fd53caa3ab6e7dbec3de74875deb46ba5") - add_patches("*", "patches/fix-build-under-android-ndk-r27.patch", "f3dcfd51072957c68ca9c404fe1f13a773ab76a187eeb2f73c2958c942d80a90") add_deps("cmake") @@ -23,6 +22,7 @@ package("snappy") add_configs("bmi2", {description = "Use the BMI2 instruction set", default = false, type = "boolean"}) on_install(function (package) + io.replace("CMakeLists.txt", "cmake_minimum_required(VERSION 3.1)", "cmake_minimum_required(VERSION 3.3)", {plain = true}) io.replace("CMakeLists.txt", "-Werror", "", {plain = true}) if package:version():eq("1.1.10") then