diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-05-12 22:28:23 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-05-13 11:34:14 +0100 |
commit | 8e19e48f1b7d406268893fee5bde3b8012308e91 (patch) | |
tree | d0cd38cbfebdc8521261cc99eb47f1edfd554f20 /meta | |
parent | d4a82b30b7d3622d5e3101aeb333bbdb31622176 (diff) | |
download | poky-8e19e48f1b7d406268893fee5bde3b8012308e91.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.
(From OE-Core rev: 627b6ed763eca90192203932784872b60a65fcaa)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-core/ovmf/ovmf_git.bb | 9 |
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() { | |||
102 | # to make ovmf-native reusable across distros. | 102 | # to make ovmf-native reusable across distros. |
103 | sed -i \ | 103 | sed -i \ |
104 | -e 's#^\(DEFINE GCC.*DLINK.*FLAGS *=\)#\1 -fuse-ld=bfd#' \ | 104 | -e 's#^\(DEFINE GCC.*DLINK.*FLAGS *=\)#\1 -fuse-ld=bfd#' \ |
105 | -e 's#-flto#-fno-lto#g' \ | ||
106 | -e 's#-DUSING_LTO##g' \ | ||
105 | ${S}/BaseTools/Conf/tools_def.template | 107 | ${S}/BaseTools/Conf/tools_def.template |
106 | } | 108 | } |
107 | 109 | ||
110 | # We disable lto above since the results are not reproducible and make it hard to compare | ||
111 | # binary build aretfacts to debug reproducibility problems. | ||
112 | # Surprisingly, if you disable lto, you see compiler warnings which are fatal. We therefore | ||
113 | # have to hack warnings overrides into GCC_PREFIX_MAP to allow it to build. | ||
114 | |||
108 | # We want to pass ${DEBUG_PREFIX_MAP} to gcc commands and also pass in | 115 | # We want to pass ${DEBUG_PREFIX_MAP} to gcc commands and also pass in |
109 | # --debug-prefix-map to nasm (we carry a patch to nasm for this). The | 116 | # --debug-prefix-map to nasm (we carry a patch to nasm for this). The |
110 | # tools definitions are built by ovmf-native so we need to pass this in | 117 | # tools definitions are built by ovmf-native so we need to pass this in |
111 | # at target build time when we know the right values. | 118 | # at target build time when we know the right values. |
112 | export NASM_PREFIX_MAP = "--debug-prefix-map=${WORKDIR}=/usr/src/debug/ovmf/${EXTENDPE}${PV}-${PR}" | 119 | export NASM_PREFIX_MAP = "--debug-prefix-map=${WORKDIR}=/usr/src/debug/ovmf/${EXTENDPE}${PV}-${PR}" |
113 | export GCC_PREFIX_MAP = "${DEBUG_PREFIX_MAP}" | 120 | export GCC_PREFIX_MAP = "${DEBUG_PREFIX_MAP} -Wno-stringop-overflow -Wno-maybe-uninitialized" |
114 | 121 | ||
115 | GCC_VER="$(${CC} -v 2>&1 | tail -n1 | awk '{print $3}')" | 122 | GCC_VER="$(${CC} -v 2>&1 | tail -n1 | awk '{print $3}')" |
116 | 123 | ||