redis: avoid LTO for clang builds
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Team,
Kindly ignore the patch below. I noticed that it was sent with incorrect author details/sign-off. I will send a revised version with the correct author's name and Signed-off-by information. Regards,
Deepak
________________________________
From: [email protected] <[email protected]> on behalf of Deepak Rathore via lists.openembedded.org <[email protected]>
Sent: Wednesday, August 19, 2026 4:49 PM
To: [email protected] <[email protected]>
Subject: [oe] [meta-oe][wrynose][PATCH] redis: avoid LTO for clang builds
From: Himanshu Jadon <[email protected]>
In Redis 8.0.x, the build system adds -flto by itself when clang is used with the default optimization setting. In OE clang builds, the final link still goes through the cross binutils linker path. That path does not stage LLVMgold.so, so redis-benchmark link fails with:
x86_64-oe-linux-ld: ../lib/LLVMgold.so: error loading plugin
The failure is not seen with gcc because Redis does not add clang LTO in that path. Also, changing OPTIMIZATION from the recipe is not a good fit because it replaces Redis defaults and drops -fno-omit-frame-pointer.
Use Redis documented OPT variable only for clang builds. This avoids the clang LTO path and keeps the frame-pointer flag. The gcc/default build is left unchanged.
This local workaround can be removed later if LLVMgold/binutils-plugin support is available in the toolchain path used by clang LTO builds.
--- meta-oe/recipes-extended/redis/redis_8.0.6.bb | 4 ++++ 1 file changed, 4 insertions(+)
meta-oe/recipes-extended/redis/redis_8.0.6.bb +4 -0
@@ -40,6 +40,10 @@ PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" PACKAGECONFIG[systemd] = "USE_SYSTEMD=yes,USE_SYSTEMD=no,systemd" EXTRA_OEMAKE += "${PACKAGECONFIG_CONFARGS}" +# Redis adds -flto automatically to OPTIMIZATION when clang is used. +# Pass OPT instead, which is the documented way to provide explicit flags +# without Redis adding its own optimization defaults. +EXTRA_OEMAKE:append:toolchain-clang = " OPT='-fno-omit-frame-pointer'" TARGET_LDFLAGS:append = " ${DEBUG_PREFIX_MAP}"
--
2.35.6