lz4: upgrade 1.10.0 -> 1.11.1
PATCH 1/1 lz4: upgrade 1.10.0 -> 1.11.1
Drop reproducibility.patch and fix-null-error-handling.patch, both are part of this release.
The unit tests moved out of frametest into a new unittest program, so install and run it in the ptest too. run-ptest is now plain sh, so drop the bash dependency.
Signed-off-by Prasanth R <[email protected]>
---
.../lz4/lz4/fix-null-error-handling.patch | 68 -------------------
.../lz4/lz4/reproducibility.patch | 33 ---------
meta/recipes-support/lz4/lz4/run-ptest | 27 ++++----
.../lz4/{lz4_1.10.0.bb => lz4_1.11.1.bb} | 10 +--
4 files changed, 15 insertions(+), 123 deletions(-)
delete mode 100644 meta/recipes-support/lz4/lz4/fix-null-error-handling.patch
delete mode 100644 meta/recipes-support/lz4/lz4/reproducibility.patch
rename meta/recipes-support/lz4/{lz4_1.10.0.bb => lz4_1.11.1.bb} (88%)meta/recipes-support/lz4/lz4/fix-null-error-handling.patch deleted +0 -68
@@ -1,68 +0,0 @@ -From f64efec011c058bd70348576438abac222fe6c82 Mon Sep 17 00:00:00 2001 -From: louislafosse <[email protected]> -Date: Mon, 31 Mar 2025 20:48:52 +0200 -Subject: [PATCH] fix(null) : improve error handlings when passing a null - pointer to some functions from lz4frame - -Upstream-Status: Backport [https://github.com/lz4/lz4/commit/f64efec011c058bd70348576438abac222fe6c82] -Signed-off-by: Peter Marko <[email protected]> ---- - lib/lz4frame.c | 15 +++++++++++++-- - tests/frametest.c | 9 ++++++--- - 2 files changed, 19 insertions(+), 5 deletions(-) - -diff --git a/lib/lz4frame.c b/lib/lz4frame.c -index 85daca7b..c9e4a3cf 100644 ---- a/lib/lz4frame.c -+++ b/lib/lz4frame.c -@@ -539,9 +539,16 @@ LZ4F_CDict* - LZ4F_createCDict_advanced(LZ4F_CustomMem cmem, const void* dictBuffer, size_t dictSize) - { - const char* dictStart = (const char*)dictBuffer; -- LZ4F_CDict* const cdict = (LZ4F_CDict*)LZ4F_malloc(sizeof(*cdict), cmem); -+ LZ4F_CDict* cdict = NULL; -+ - DEBUGLOG(4, "LZ4F_createCDict_advanced"); -- if (!cdict) return NULL; -+ -+ if (!dictStart) -+ return NULL; -+ cdict = (LZ4F_CDict*)LZ4F_malloc(sizeof(*cdict), cmem); -+ if (!cdict) -+ return NULL; -+ - cdict->cmem = cmem; - if (dictSize > 64 KB) { - dictStart += dictSize - 64 KB; -@@ -1486,6 +1493,10 @@ LZ4F_errorCode_t LZ4F_getFrameInfo(LZ4F_dctx* dctx, - LZ4F_frameInfo_t* frameInfoPtr, - const void* srcBuffer, size_t* srcSizePtr) - { -+ assert(dctx != NULL); -+ RETURN_ERROR_IF(frameInfoPtr == NULL, parameter_null); -+ RETURN_ERROR_IF(srcSizePtr == NULL, parameter_null); -+ - LZ4F_STATIC_ASSERT(dstage_getFrameHeader < dstage_storeFrameHeader); - if (dctx->dStage > dstage_storeFrameHeader) { - /* frameInfo already decoded */ -diff --git a/tests/frametest.c b/tests/frametest.c -index de0fe643..90247547 100644 ---- a/tests/frametest.c -+++ b/tests/frametest.c -@@ -714,10 +714,13 @@ static int unitTests(U32 seed, double compressibility) - size_t const srcSize = 65 KB; /* must be > 64 KB to avoid short-size optimizations */ - size_t const dstCapacity = LZ4F_compressFrameBound(srcSize, NULL); - size_t cSizeNoDict, cSizeWithDict; -- LZ4F_CDict* const cdict = LZ4F_createCDict(CNBuffer, dictSize); -- if (cdict == NULL) goto _output_error; -- CHECK( LZ4F_createCompressionContext(&cctx, LZ4F_VERSION) ); -+ LZ4F_CDict* cdict = NULL; - -+ CHECK( LZ4F_createCompressionContext(&cctx, LZ4F_VERSION) ); -+ cdict = LZ4F_createCDict(CNBuffer, dictSize); -+ if (cdict == NULL) -+ goto _output_error; -+ - DISPLAYLEVEL(3, "Testing LZ4F_createCDict_advanced : "); - { LZ4F_CDict* const cda = LZ4F_createCDict_advanced(lz4f_cmem_test, CNBuffer, dictSize); - if (cda == NULL) goto _output_error;
meta/recipes-support/lz4/lz4/reproducibility.patch deleted +0 -33
@@ -1,33 +0,0 @@ -lib/Makefile: Fix static library reproducibility - -The static library contents varies depending of the order of the object files on disk meaning -it isn't reproducible. - -To avoid this, use the SRCFILES values which are already sorted, mapped to the object names -instead. - - -Upstream-Status: Submitted [https://github.com/lz4/lz4/pull/1497] -Signed-off-by: Richard Purdie <[email protected]> - -Index: git/lib/Makefile -=================================================================== ---- git.orig/lib/Makefile -+++ git/lib/Makefile -@@ -55,6 +55,7 @@ CFLAGS = $(DEBUGFLAGS) $(USERCFLAGS) - ALLFLAGS = $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) - - SRCFILES := $(sort $(wildcard *.c)) -+OBJFILES = $(SRCFILES:.c=.o) - - include ../Makefile.inc - -@@ -102,7 +103,7 @@ liblz4.a: $(SRCFILES) - ifeq ($(BUILD_STATIC),yes) # can be disabled on command line - @echo compiling static library - $(COMPILE.c) $^ -- $(AR) rcs $@ *.o -+ $(AR) rcs $@ $(OBJFILES) - endif - - ifeq ($(WINBASED),yes)
meta/recipes-support/lz4/lz4/run-ptest +12 -15
@@ -1,17 +1,14 @@ #!/bin/sh -# Define test work dir -WORKDIR=@PTEST_PATH@/tests/ - -# Run test -cd ${WORKDIR} - -case_name="test_frame" -./frametest -ret=$? -if [[ ${ret} == "0" ]]; then - echo "PASS: lz4/$case_name" -else - echo "FAIL: lz4/$case_name" -fi - +cd @PTEST_PATH@/tests/ || exit 1 + +run() { + if "./$1"; then + echo "PASS: lz4/$2" + else + echo "FAIL: lz4/$2" + fi +} + +run frametest test_frame +run unittest test_unit
meta/recipes-support/lz4/lz4_1.11.1.bb renamed from meta/recipes-support/lz4/lz4_1.10.0.bb +3 -7
@@ -10,13 +10,11 @@ LIC_FILES_CHKSUM = "file://lib/LICENSE;md5=5cd5f851b52ec832b10eedb3f01f885a \ PE = "1" -SRCREV = "ebb370ca83af193212df4dcbadcc5d87bc0de2f0" +SRCREV = "aa4647fad575d01a874aaaadcdbe8e6a40e072f5" SRC_URI = "git://github.com/lz4/lz4.git;branch=release;protocol=https;tag=v${PV} \ - file://reproducibility.patch \ file://run-ptest \ - file://fix-null-error-handling.patch \ -" + " UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)" inherit ptest
@@ -31,8 +29,6 @@ do_install() { BBCLASSEXTEND = "native nativesdk" -RDEPENDS:${PN}-ptest += "bash" - do_compile_ptest() { oe_runmake -C ${B}/tests/ }
@@ -40,7 +36,7 @@ do_compile_ptest() { do_install_ptest() { install -d ${D}${PTEST_PATH}/tests/ install --mode=755 ${B}/tests/frametest ${D}${PTEST_PATH}/tests/ + install --mode=755 ${B}/tests/unittest ${D}${PTEST_PATH}/tests/ sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/run-ptest - }
Signature · 1 line
2.34.1