Add sorting to wildcard expansion in the makefile to make builds
reproducible.

Signed-off-by: Richard Purdie <[email protected]>
---
 meta/lib/oeqa/selftest/cases/reproducible.py  |  1 -
 .../syslinux/syslinux/determinism.patch       | 22 +++++++++++++++++++
 .../syslinux/syslinux_6.04-pre2.bb            |  5 +++++
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/determinism.patch

diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py 
b/meta/lib/oeqa/selftest/cases/reproducible.py
index 3f99359bdbe..a15601e5e5d 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -45,7 +45,6 @@ exclude_packages = [
        'qemu',
        'ruby-ri-docs',
        'swig',
-       'syslinux-misc',
        'systemd-bootchart'
        ]
 
diff --git a/meta/recipes-devtools/syslinux/syslinux/determinism.patch 
b/meta/recipes-devtools/syslinux/syslinux/determinism.patch
new file mode 100644
index 00000000000..2fb8c64df37
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/determinism.patch
@@ -0,0 +1,22 @@
+In order to build deterministic binaries, we need to sort the wildcard 
expansion
+so the libraries are linked in the same order each time. This fixes 
reproducibility
+issues within syslinux builds.
+
+Upstream-Status: Pending
+RP 2021/3/1
+
+Index: syslinux-6.04-pre2/mk/lib.mk
+===================================================================
+--- syslinux-6.04-pre2.orig/mk/lib.mk
++++ syslinux-6.04-pre2/mk/lib.mk
+@@ -130,8 +130,8 @@ LIBENTRY_OBJS = \
+       exit.o
+ 
+ LIBGCC_OBJS = \
+-        $(patsubst $(com32)/lib/%.c,%.o,$(wildcard 
$(com32)/lib/$(ARCH)/libgcc/*.c)) \
+-        $(patsubst $(com32)/lib/%.S,%.o,$(wildcard 
$(com32)/lib/$(ARCH)/libgcc/*.S))
++        $(sort $(patsubst $(com32)/lib/%.c,%.o,$(wildcard 
$(com32)/lib/$(ARCH)/libgcc/*.c))) \
++        $(sort $(patsubst $(com32)/lib/%.S,%.o,$(wildcard 
$(com32)/lib/$(ARCH)/libgcc/*.S)))
+ 
+ LIBCONSOLE_OBJS = \
+       \
diff --git a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb 
b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
index 8d78f62efa0..dadba9eca9a 100644
--- a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
+++ b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
@@ -20,11 +20,16 @@ SRC_URI = 
"https://www.zytor.com/pub/syslinux/Testing/6.04/syslinux-${PV}.tar.xz
            file://0009-linux-syslinux-implement-install_bootblock.patch \
            file://0010-Workaround-multiple-definition-of-symbol-errors.patch \
            file://0001-install-don-t-install-obsolete-file-com32.ld.patch \
+           file://determinism.patch \
            "
 
 SRC_URI[md5sum] = "2b31c78f087f99179feb357da312d7ec"
 SRC_URI[sha256sum] = 
"4441a5d593f85bb6e8d578cf6653fb4ec30f9e8f4a2315a3d8f2d0a8b3fadf94"
 
+# remove at next version upgrade or when output changes
+PR = "r1"
+HASHEQUIV_HASH_VERSION .= ".1"
+
 RECIPE_NO_UPDATE_REASON = "6.04-pre3 is broken"
 UPSTREAM_CHECK_URI = "https://www.zytor.com/pub/syslinux/";
 UPSTREAM_CHECK_REGEX = "syslinux-(?P<pver>.+)\.tar"
-- 
2.27.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#148787): 
https://lists.openembedded.org/g/openembedded-core/message/148787
Mute This Topic: https://lists.openembedded.org/mt/80993932/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to