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

Signed-off-by: Richard Purdie <[email protected]>
---
 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

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

Reply via email to