From c7094cd77bedd4b013be777346778c2cb1dbe04d Mon Sep 17 00:00:00 2001
From: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
Date: Sat, 16 Jan 2021 10:43:22 +0300
Subject: [PATCH] build: bump zstd submodule
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Updated third_party/zstd submodule from v1.3.3 to v1.4.8 version.

Found issue building on Fedora 33:

  third_party/zstd/lib/decompress/zstd_decompress.c: In function ‘ZSTD_findFrameCompressedSize’:
  third_party/zstd/lib/decompress/zstd_decompress.c:1502:18: error: ‘zfh.headerSize’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   1502 |         ip += zfh.headerSize;
        |                  ^

Also found that later releases of third_party/zstd submodule already
fixed it. Decided to bump third_party/zstd submodule from v1.3.3 to
v1.4.8. Added to zstd cmake build rules new files appeared on bumping.

Found that some checking in static-build test exporting symbols like:

  ZSTD_free
  ZSTD_malloc

never were public symbols and should not be tested for presence in the
Tarantool executable, but also these symbols currently outdated and
broke the testing. To avoid of it these symbols removed from test.

Needed for #5502
Closes #5697
---
 cmake/BuildZSTD.cmake                           | 7 +++++++
 static-build/test/static-build/exports.test.lua | 2 --
 third_party/zstd                                | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/cmake/BuildZSTD.cmake b/cmake/BuildZSTD.cmake
index 3b622c5e7d..a011e09db3 100644
--- a/cmake/BuildZSTD.cmake
+++ b/cmake/BuildZSTD.cmake
@@ -6,8 +6,11 @@ macro(zstd_build)
         third_party/zstd/lib/common/pool.c
         third_party/zstd/lib/common/xxhash.c
         third_party/zstd/lib/common/fse_decompress.c
+        third_party/zstd/lib/common/debug.c
         third_party/zstd/lib/decompress/zstd_decompress.c
         third_party/zstd/lib/decompress/huf_decompress.c
+        third_party/zstd/lib/decompress/zstd_ddict.c
+        third_party/zstd/lib/decompress/zstd_decompress_block.c
         third_party/zstd/lib/compress/zstd_double_fast.c
         third_party/zstd/lib/compress/zstd_fast.c
         third_party/zstd/lib/compress/zstd_lazy.c
@@ -17,6 +20,10 @@ macro(zstd_build)
         third_party/zstd/lib/compress/zstdmt_compress.c
         third_party/zstd/lib/compress/huf_compress.c
         third_party/zstd/lib/compress/fse_compress.c
+        third_party/zstd/lib/compress/hist.c
+        third_party/zstd/lib/compress/zstd_compress_superblock.c
+        third_party/zstd/lib/compress/zstd_compress_sequences.c
+        third_party/zstd/lib/compress/zstd_compress_literals.c
     )
 
     if (CC_HAS_WNO_IMPLICIT_FALLTHROUGH)
diff --git a/static-build/test/static-build/exports.test.lua b/static-build/test/static-build/exports.test.lua
index de54973d8d..9b9eaa471f 100755
--- a/static-build/test/static-build/exports.test.lua
+++ b/static-build/test/static-build/exports.test.lua
@@ -129,8 +129,6 @@ local check_symbols = {
 
     'ZSTD_compress',
     'ZSTD_decompress',
-    'ZSTD_free',
-    'ZSTD_malloc',
     'ZSTD_versionString',
 }
 
diff --git a/third_party/zstd b/third_party/zstd
index f3a8bd553a..97a3da1df0 160000
--- a/third_party/zstd
+++ b/third_party/zstd
@@ -1 +1 @@
-Subproject commit f3a8bd553a865c59f1bd6e1f68bf182cf75a8f00
+Subproject commit 97a3da1df009d4dc67251de0c4b1c9d7fe286fc1
-- 
GitLab