]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lto.inc: add DEBUG_PREFIX_MAP back to TARGET_LDFLAGS
authorChangqing Li <changqing.li@windriver.com>
Wed, 4 Feb 2026 05:26:38 +0000 (13:26 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 30 Mar 2026 19:17:55 +0000 (20:17 +0100)
DEBUG_PREFIX_MAP is appended to TARGET_LDFLAGS in commit [1] for fixing
reproducible issue when LTO is enabled. It is removed in comit [2] since
this commit causes cgo binary not reproducible. But actually, we still
need this DEBUG_PREFIX_MAP in LDFLAGS when LTO enabled. So, only appened
it when LTO is enabled. Refer [3] for the history, with this patch,
patch [4] is also needed for cgo + lto enabled.

[1] https://git.openembedded.org/openembedded-core/commit/?id=fddaecc88979967d0e00e2fafdbaaabec030da9f
[2] https://git.openembedded.org/openembedded-core/commit/?id=1797741aad02b8bf429fac4b81e30cdda64b5448
[3] https://lists.openembedded.org/g/openembedded-core/topic/patch_bitbake_conf_remove/117408334
[4] https://lists.openembedded.org/g/openembedded-core/message/230059

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/lto.inc

index b4f823681af0925060ededb97504fb313459485b..54983412bc140821adc78d3ad9aa7b1c56dd68eb 100644 (file)
@@ -53,5 +53,6 @@ LTO ?= "${LTO_DEFAULT}"
 
 SELECTED_OPTIMIZATION:append = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}"
 TARGET_LDFLAGS:append:class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${LTO}', '', d)}"
+TARGET_LDFLAGS:append:class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'lto', ' ${DEBUG_PREFIX_MAP}', '', d)}"
 
 SELECTED_OPTIMIZATION[vardeps] += "LTO LTOEXTRA"