]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lz4: Fix static library reproducibility issue
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 29 Aug 2024 10:05:48 +0000 (11:05 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 29 Aug 2024 20:57:36 +0000 (21:57 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-support/lz4/lz4/reproducibility.patch [new file with mode: 0644]
meta/recipes-support/lz4/lz4/run-ptest [moved from meta/recipes-support/lz4/files/run-ptest with 100% similarity]
meta/recipes-support/lz4/lz4_1.10.0.bb

diff --git a/meta/recipes-support/lz4/lz4/reproducibility.patch b/meta/recipes-support/lz4/lz4/reproducibility.patch
new file mode 100644 (file)
index 0000000..c138986
--- /dev/null
@@ -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 <richard.purdie@linuxfoundation.org>
+
+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)
index 40768fb292514f9f467694bc3144684e9f125086..3b98adf42e55a3201b22755178f96cd325ef6cb6 100644 (file)
@@ -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<pver>.*)"
 
 S = "${WORKDIR}/git"