Re: [oe] [meta-oe][wrynose][PATCH] redis: avoid LTO for clang builds

"Deepak Rathore -X (deeratho - E INFOCHIPS PRIVATE LIMITED at Cisco)" <[email protected]>
Newsgroups org.openembedded.lists.openembedded-devel
Message-ID <DM4PR11MB618981747B3E856C580BE876C4A42@DM4PR11MB6189.namprd11.prod.outlook.com>
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.

Signed-off-by: Himanshu Jadon <[email protected]>
---
 meta-oe/recipes-extended/redis/redis_8.0.6.bb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta-oe/recipes-extended/redis/redis_8.0.6.bb b/meta-oe/recipes-extended/redis/redis_8.0.6.bb
index f6866747eb..fe31033328 100644
--- a/meta-oe/recipes-extended/redis/redis_8.0.6.bb
+++ b/meta-oe/recipes-extended/redis/redis_8.0.6.bb
@@ -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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.