From 63d77ef8935444dbfd62d2b38ca82ebbf5d8cc0e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 29 Aug 2024 11:05:48 +0100 Subject: lz4: Fix static library reproducibility issue The autobuilder was seeing an intermittent reproducbility issue in lz4 with regard to symbol ordering in the static library. Add a patch to fix this which has been submitted upstream. Fix the SRC_URI whitespace and cleanup the patch directory naming whilst here. (From OE-Core rev: 79d6d0fa239ab0cf271c01d8169a7d41811f8b4e) Signed-off-by: Richard Purdie --- meta/recipes-support/lz4/files/run-ptest | 17 ----------- meta/recipes-support/lz4/lz4/reproducibility.patch | 33 ++++++++++++++++++++++ meta/recipes-support/lz4/lz4/run-ptest | 17 +++++++++++ meta/recipes-support/lz4/lz4_1.10.0.bb | 4 +-- 4 files changed, 52 insertions(+), 19 deletions(-) delete mode 100644 meta/recipes-support/lz4/files/run-ptest create mode 100644 meta/recipes-support/lz4/lz4/reproducibility.patch create mode 100644 meta/recipes-support/lz4/lz4/run-ptest diff --git a/meta/recipes-support/lz4/files/run-ptest b/meta/recipes-support/lz4/files/run-ptest deleted file mode 100644 index f4a46a4f2c..0000000000 --- a/meta/recipes-support/lz4/files/run-ptest +++ /dev/null @@ -1,17 +0,0 @@ -#!/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 - diff --git a/meta/recipes-support/lz4/lz4/reproducibility.patch b/meta/recipes-support/lz4/lz4/reproducibility.patch new file mode 100644 index 0000000000..c138986da8 --- /dev/null +++ b/meta/recipes-support/lz4/lz4/reproducibility.patch @@ -0,0 +1,33 @@ +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 + +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) diff --git a/meta/recipes-support/lz4/lz4/run-ptest b/meta/recipes-support/lz4/lz4/run-ptest new file mode 100644 index 0000000000..f4a46a4f2c --- /dev/null +++ b/meta/recipes-support/lz4/lz4/run-ptest @@ -0,0 +1,17 @@ +#!/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 + diff --git a/meta/recipes-support/lz4/lz4_1.10.0.bb b/meta/recipes-support/lz4/lz4_1.10.0.bb index 40768fb292..3b98adf42e 100644 --- a/meta/recipes-support/lz4/lz4_1.10.0.bb +++ b/meta/recipes-support/lz4/lz4_1.10.0.bb @@ -13,8 +13,8 @@ PE = "1" SRCREV = "ebb370ca83af193212df4dcbadcc5d87bc0de2f0" SRC_URI = "git://github.com/lz4/lz4.git;branch=release;protocol=https \ - file://run-ptest \ - " + file://reproducibility.patch \ + file://run-ptest" UPSTREAM_CHECK_GITTAGREGEX = "v(?P.*)" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf