diff --git a/pp/third_party/deps.bzl b/pp/third_party/deps.bzl index 37adb37253..72e8d5fc72 100644 --- a/pp/third_party/deps.bzl +++ b/pp/third_party/deps.bzl @@ -98,9 +98,9 @@ def _third_party_deps_impl(_ctx): Label("//third_party/patches/lz4:0003-fix_offsetof_calculation.patch"), Label("//third_party/patches/lz4:0004-svacer_fixes.patch"), ], - sha256 = "658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc", - strip_prefix = "lz4-1.9.2", - url = "https://github.com/lz4/lz4/archive/v1.9.2.tar.gz", + sha256 = "537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b", + strip_prefix = "lz4-1.10.0", + url = "https://github.com/lz4/lz4/archive/v1.10.0.tar.gz", ) http_archive( diff --git a/pp/third_party/patches/lz4/0001-remove_visibility_attribute.patch b/pp/third_party/patches/lz4/0001-remove_visibility_attribute.patch index 48bf9fa66f..306a78b706 100644 --- a/pp/third_party/patches/lz4/0001-remove_visibility_attribute.patch +++ b/pp/third_party/patches/lz4/0001-remove_visibility_attribute.patch @@ -1,11 +1,11 @@ --- lib/lz4frame.h +++ lib/lz4frame_patched.h -@@ -74,7 +74,7 @@ extern "C" { - #elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) - # define LZ4FLIB_API __declspec(dllimport) - #elif defined(__GNUC__) && (__GNUC__ >= 4) --# define LZ4FLIB_API __attribute__ ((__visibility__ ("default"))) -+# define LZ4FLIB_API - #else - # define LZ4FLIB_API - #endif +@@ -71,7 +71,7 @@ extern "C" { + */ + #ifndef LZ4FLIB_VISIBILITY + # if defined(__GNUC__) && (__GNUC__ >= 4) +-# define LZ4FLIB_VISIBILITY __attribute__ ((visibility ("default"))) ++# define LZ4FLIB_VISIBILITY + # else + # define LZ4FLIB_VISIBILITY + # endif diff --git a/pp/third_party/patches/lz4/0002-add_allocated_memory.patch b/pp/third_party/patches/lz4/0002-add_allocated_memory.patch index ce85bdcaf7..2423f90582 100644 --- a/pp/third_party/patches/lz4/0002-add_allocated_memory.patch +++ b/pp/third_party/patches/lz4/0002-add_allocated_memory.patch @@ -1,26 +1,25 @@ --- lib/lz4frame.h +++ lib/lz4frame.h -@@ -467,7 +467,7 @@ LZ4FLIB_API size_t LZ4F_decompress(LZ4F_dctx* dctx, +@@ -512,6 +512,7 @@ LZ4FLIB_API size_t LZ4F_decompress(LZ4F_dctx* dctx, * and start a new one using same context resources. */ LZ4FLIB_API void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx); /* always successful */ - -- + +size_t LZ4F_allocated_memory(LZ4F_dctx* dctx); - - #if defined (__cplusplus) - } + + /********************************** + * Dictionary compression API --- lib/lz4frame.c +++ lib/lz4frame.c -@@ -1097,6 +1097,11 @@ void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx) - dctx->dictSize = 0; +@@ -1334,6 +1334,11 @@ void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx) + dctx->frameRemainingSize = 0; } - + +size_t LZ4F_allocated_memory(LZ4F_dctx* dctx) +{ + return sizeof(*dctx) + dctx->tmpInSize + dctx->tmpOutSize; +} + - + /*! LZ4F_decodeHeader() : * input : `src` points at the **beginning of the frame** diff --git a/pp/third_party/patches/lz4/0003-fix_offsetof_calculation.patch b/pp/third_party/patches/lz4/0003-fix_offsetof_calculation.patch index 28cee378a8..e70b9367ad 100644 --- a/pp/third_party/patches/lz4/0003-fix_offsetof_calculation.patch +++ b/pp/third_party/patches/lz4/0003-fix_offsetof_calculation.patch @@ -1,13 +1,13 @@ --- lib/lz4hc.c +++ lib/lz4hc_patched.c -@@ -886,8 +886,8 @@ int LZ4_sizeofStateHC(void) { return (int)sizeof(LZ4_streamHC_t); } - * while actually aligning LZ4_streamHC_t on 4 bytes. */ +@@ -1488,8 +1488,8 @@ int LZ4_sizeofStateHC(void) { return (int)sizeof(LZ4_streamHC_t); } static size_t LZ4_streamHC_t_alignment(void) { -- struct { char c; LZ4_streamHC_t t; } t_a; -- return sizeof(t_a) - sizeof(t_a.t); + #if LZ4_ALIGN_TEST +- typedef struct { char c; LZ4_streamHC_t t; } t_a; +- return sizeof(t_a) - sizeof(LZ4_streamHC_t); + struct alignment_check_struct { char c; LZ4_streamHC_t t; }; + return offsetof(struct alignment_check_struct, t); - } + #else + return 1; /* effectively disabled */ #endif -