All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] syslinux: Fix reproducibility issues
@ 2021-03-01 10:55 Richard Purdie
  2021-03-01 10:55 ` [PATCH 2/4] swig: Fix reproducibility issue Richard Purdie
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Richard Purdie @ 2021-03-01 10:55 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/4] swig: Fix reproducibility issue
  2021-03-01 10:55 [PATCH 1/4] syslinux: Fix reproducibility issues Richard Purdie
@ 2021-03-01 10:55 ` Richard Purdie
  2021-03-01 10:55 ` [PATCH 3/4] efivar: " Richard Purdie
  2021-03-01 10:55 ` [PATCH 4/4] systemd-bootchart: Disable LTO to fix reproducibility Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2021-03-01 10:55 UTC (permalink / raw)
  To: openembedded-core

Remove hardcoding the build configuration into the help/version output
from swig to make the binaries reproducible.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/reproducible.py  |  1 -
 .../swig/swig/determinism.patch               | 19 +++++++++++++++++++
 meta/recipes-devtools/swig/swig_3.0.12.bb     |  1 +
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/swig/swig/determinism.patch

diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index a15601e5e5d..dd2230c149c 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -44,7 +44,6 @@ exclude_packages = [
 	'python3-cython',
 	'qemu',
 	'ruby-ri-docs',
-	'swig',
 	'systemd-bootchart'
 	]
 
diff --git a/meta/recipes-devtools/swig/swig/determinism.patch b/meta/recipes-devtools/swig/swig/determinism.patch
new file mode 100644
index 00000000000..8ffb4bce8ed
--- /dev/null
+++ b/meta/recipes-devtools/swig/swig/determinism.patch
@@ -0,0 +1,19 @@
+Remove the compiler commandline/platform from the compiled binary as this
+breaks reproducibilty.
+
+Upstream-Status: Inappropriate [OE reproducibiity fix upstream unlikely to take]
+RP 2021/3/1
+
+
+Index: swig-3.0.12/Source/Modules/main.cxx
+===================================================================
+--- swig-3.0.12.orig/Source/Modules/main.cxx
++++ swig-3.0.12/Source/Modules/main.cxx
+@@ -636,7 +636,6 @@ void SWIG_getoptions(int argc, char *arg
+ 	}
+       } else if (strcmp(argv[i], "-version") == 0) {
+ 	fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version());
+-	fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM);
+ 	fprintf(stdout, "\nConfigured options: %cpcre\n",
+ #ifdef HAVE_PCRE
+ 		'+'
diff --git a/meta/recipes-devtools/swig/swig_3.0.12.bb b/meta/recipes-devtools/swig/swig_3.0.12.bb
index 45026c9700b..090aaa81127 100644
--- a/meta/recipes-devtools/swig/swig_3.0.12.bb
+++ b/meta/recipes-devtools/swig/swig_3.0.12.bb
@@ -6,6 +6,7 @@ SRC_URI += "file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.pat
             file://swig-3.0.12-Coverity-fix-issue-reported-for-SWIG_Python_FixMetho.patch \
             file://Python-Fix-new-GCC8-warnings-in-generated-code.patch \
             file://0001-Fix-generated-code-for-constant-expressions-containi.patch \
+            file://determinism.patch \
            "
 SRC_URI[md5sum] = "82133dfa7bba75ff9ad98a7046be687c"
 SRC_URI[sha256sum] = "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d"
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/4] efivar: Fix reproducibility issue
  2021-03-01 10:55 [PATCH 1/4] syslinux: Fix reproducibility issues Richard Purdie
  2021-03-01 10:55 ` [PATCH 2/4] swig: Fix reproducibility issue Richard Purdie
@ 2021-03-01 10:55 ` Richard Purdie
  2021-03-01 10:55 ` [PATCH 4/4] systemd-bootchart: Disable LTO to fix reproducibility Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2021-03-01 10:55 UTC (permalink / raw)
  To: openembedded-core

Add sorting to the globbing within the Makefile to make the output
reproducible.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/reproducible.py   |  1 -
 .../efivar/efivar/determinism.patch            | 18 ++++++++++++++++++
 meta/recipes-bsp/efivar/efivar_37.bb           |  1 +
 3 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-bsp/efivar/efivar/determinism.patch

diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index dd2230c149c..d6c38cc7dea 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -28,7 +28,6 @@ import datetime
 # ruby-ri-docs, meson:
 #https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20210215-0_td9la2/packages/diff-html/
 exclude_packages = [
-	'efivar',
 	'glide',
 	'go-dep',
 	'go-helloworld',
diff --git a/meta/recipes-bsp/efivar/efivar/determinism.patch b/meta/recipes-bsp/efivar/efivar/determinism.patch
new file mode 100644
index 00000000000..bdf6bfc4a8f
--- /dev/null
+++ b/meta/recipes-bsp/efivar/efivar/determinism.patch
@@ -0,0 +1,18 @@
+Fix reproducibility issue caused by unsorted wildcard expansion.
+
+Upstream-Status: Pending
+RP 2021/3/1
+
+Index: git/src/Makefile
+===================================================================
+--- git.orig/src/Makefile
++++ git/src/Makefile
+@@ -15,7 +15,7 @@ TARGETS=$(LIBTARGETS) $(BINTARGETS) $(PC
+ STATICTARGETS=$(STATICLIBTARGETS) $(STATICBINTARGETS)
+ 
+ LIBEFIBOOT_SOURCES = crc32.c creator.c disk.c gpt.c loadopt.c path-helpers.c \
+-		     linux.c $(wildcard linux-*.c)
++		     linux.c $(sort $(wildcard linux-*.c))
+ LIBEFIBOOT_OBJECTS = $(patsubst %.c,%.o,$(LIBEFIBOOT_SOURCES))
+ LIBEFIVAR_SOURCES = dp.c dp-acpi.c dp-hw.c dp-media.c dp-message.c \
+ 	efivarfs.c error.c export.c guid.c guids.S guid-symbols.c \
diff --git a/meta/recipes-bsp/efivar/efivar_37.bb b/meta/recipes-bsp/efivar/efivar_37.bb
index 9b95721a4ec..5bf121ff6e1 100644
--- a/meta/recipes-bsp/efivar/efivar_37.bb
+++ b/meta/recipes-bsp/efivar/efivar_37.bb
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393"
 COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
 
 SRC_URI = "git://github.com/rhinstaller/efivar.git \
+           file://determinism.patch \
            file://no-werror.patch"
 SRCREV = "c1d6b10e1ed4ba2be07f385eae5bceb694478a10"
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 4/4] systemd-bootchart: Disable LTO to fix reproducibility
  2021-03-01 10:55 [PATCH 1/4] syslinux: Fix reproducibility issues Richard Purdie
  2021-03-01 10:55 ` [PATCH 2/4] swig: Fix reproducibility issue Richard Purdie
  2021-03-01 10:55 ` [PATCH 3/4] efivar: " Richard Purdie
@ 2021-03-01 10:55 ` Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2021-03-01 10:55 UTC (permalink / raw)
  To: openembedded-core

LTO likely doesn't buy us much here, disable it to allow the binaries
to be reproducible.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/reproducible.py  |  3 +--
 .../systemd-bootchart/no_lto.patch            | 19 +++++++++++++++++++
 .../systemd-bootchart_234.bb                  |  1 +
 3 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/systemd-bootchart/systemd-bootchart/no_lto.patch

diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index d6c38cc7dea..bbc5c0d8a4f 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -42,8 +42,7 @@ exclude_packages = [
 	'perf',
 	'python3-cython',
 	'qemu',
-	'ruby-ri-docs',
-	'systemd-bootchart'
+	'ruby-ri-docs'
 	]
 
 def is_excluded(package):
diff --git a/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/no_lto.patch b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/no_lto.patch
new file mode 100644
index 00000000000..1fdf8dbcc25
--- /dev/null
+++ b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/no_lto.patch
@@ -0,0 +1,19 @@
+LTO output is not reproducible. Until it is, disable this. Sadly
+there is no configuration option to do so at this time.
+
+Upstream-Status: Pending [may be accept addition of configuration option?]
+RP 2021/3/1
+
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -124,7 +124,7 @@ AS_CASE([$CC], [*clang*],
+ 
+ AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
+         [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
+-               -flto -ffat-lto-objects])],
++               ])],
+         [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
+ AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
+ 
diff --git a/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_234.bb b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_234.bb
index 58dd5995c85..905a0cbb72e 100644
--- a/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_234.bb
+++ b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_234.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c
 SRC_URI = "git://github.com/systemd/systemd-bootchart.git;protocol=https \
            file://0001-architecture-Recognise-RISCV-32-RISCV-64.patch \
            file://mips64.patch \
+           file://no_lto.patch \
 "
 
 SRC_URI_append_libc-musl = " \
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-01 10:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 10:55 [PATCH 1/4] syslinux: Fix reproducibility issues Richard Purdie
2021-03-01 10:55 ` [PATCH 2/4] swig: Fix reproducibility issue Richard Purdie
2021-03-01 10:55 ` [PATCH 3/4] efivar: " Richard Purdie
2021-03-01 10:55 ` [PATCH 4/4] systemd-bootchart: Disable LTO to fix reproducibility Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.