Re: [OE-core] [master][PATCH 0/4] Reproducible LTO builds
From: Randy MacLeod <hidden>
Date: 2021-08-05 00:13:40
Also in:
openembedded-devel
On 2021-07-27 9:34 a.m., Tony Battersby wrote:
Currently, enabling Link Time Optimization via: require conf/distro/include/lto.inc DISTRO_FEATURES_append = " lto" makes the build non-reproducible (as in https://reproducible-builds.org/). This patch set fixes some of the problems, but is not yet a complete solution. This patch set addresses the following bugs: https://bugzilla.yoctoproject.org/show_bug.cgi?id=14481 https://bugzilla.yoctoproject.org/show_bug.cgi?id=14490 openembedded-core patches 1/4: lto.inc: disable LTO for grub 2/4: gcc: Backport patch to make LTO builds more reproducible 3/4: bitbake.conf: add DEBUG_PREFIX_MAP to TARGET_LDFLAGS openembedded-devel patches 4/4: net-snmp: fix QA Issue after LDFLAGS change Patch 3 adds DEBUG_PREFIX_MAP to TARGET_LDFLAGS (it was already in TARGET_CFLAGS). This could possibly be done differently, such as by removing it from TARGET_CFLAGS and adding it to TOOLCHAIN_OPTIONS, TARGET_CC_ARCH, or TUNE_CCARGS, but I haven't tested those. Let me know if there is a better/preferred way to do it. The TARGET_LDFLAGS change broke net-snmp from meta-networking, so I have included a patch to fix that. Other packages might have been broken as well, although I haven't found any others. With all these patches, there are still many shared libraries in /lib and /usr/lib that are still not reproducible with LTO enabled because x86_64-poky-linux-libtool filters out the -f*-prefix-map flags added by patch 3 when linking shared libraries. /usr/lib/libbz2.so.1.0.6 from the libbz2 package from the bzip2 recipe is a good example. I do not have a patch for that problem. I will leave that to someone else. So this is what we need to achieve reproducible LTO builds: *) This patch set *) A fix for libtool *) Add LTO to reproducible builds testing if appropriate (e.g. meta/lib/oeqa/selftest/cases/reproducible.py, CI on Autobuilder) *) Fixes for individual packages, if needed *) Once everything works, update the documentation again (I previously requested a documentation change for this bug, which will eventually show up at http://docs.yoctoproject.org/test-manual/reproducible-builds.html).
This is certainly a few steps in the right direction with a good outline of what's next. I suspect that Richard has been busy with other things like overrides and the update to glibc-2.34. Do you have any suggestions or questions about what we should do with this patch series Richard? ../Randy
Tony Battersby Cybernetics
-- # Randy MacLeod # Wind River Linux