summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-12 22:28:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-13 11:33:47 +0100
commit627b6ed763eca90192203932784872b60a65fcaa (patch)
tree899a253645a8a6b4388694c87a37e34964d256d7
parentb254db634fc888ae75e843c8a9108e71ffff3f77 (diff)
downloadopenembedded-core-627b6ed763eca90192203932784872b60a65fcaa.tar.gz
ovmf: Disable lto to aid reproducibility
lto tends to break reproducibility and makes ovmf near impossible to debug reproducibility issues in. Disable it and supress the warnings that then generates from Werror. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/ovmf/ovmf_git.bb9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
index 1fe01146d6..ef5545bf70 100644
--- a/meta/recipes-core/ovmf/ovmf_git.bb
+++ b/meta/recipes-core/ovmf/ovmf_git.bb
@@ -102,15 +102,22 @@ fix_toolchain_append_class-native() {
# to make ovmf-native reusable across distros.
sed -i \
-e 's#^\(DEFINE GCC.*DLINK.*FLAGS *=\)#\1 -fuse-ld=bfd#' \
+ -e 's#-flto#-fno-lto#g' \
+ -e 's#-DUSING_LTO##g' \
${S}/BaseTools/Conf/tools_def.template
}
+# We disable lto above since the results are not reproducible and make it hard to compare
+# binary build aretfacts to debug reproducibility problems.
+# Surprisingly, if you disable lto, you see compiler warnings which are fatal. We therefore
+# have to hack warnings overrides into GCC_PREFIX_MAP to allow it to build.
+
# We want to pass ${DEBUG_PREFIX_MAP} to gcc commands and also pass in
# --debug-prefix-map to nasm (we carry a patch to nasm for this). The
# tools definitions are built by ovmf-native so we need to pass this in
# at target build time when we know the right values.
export NASM_PREFIX_MAP = "--debug-prefix-map=${WORKDIR}=/usr/src/debug/ovmf/${EXTENDPE}${PV}-${PR}"
-export GCC_PREFIX_MAP = "${DEBUG_PREFIX_MAP}"
+export GCC_PREFIX_MAP = "${DEBUG_PREFIX_MAP} -Wno-stringop-overflow -Wno-maybe-uninitialized"
GCC_VER="$(${CC} -v 2>&1 | tail -n1 | awk '{print $3}')"