diff mbox series

[meta-networking,1/2] lftp: backport fix for duplicate OpenSSL symbols

Message ID 20260626114133.3486742-1-Hemanth.KumarMD@windriver.com
State New
Headers show
Series [meta-networking,1/2] lftp: backport fix for duplicate OpenSSL symbols | expand

Commit Message

Hemanth Kumar M D June 26, 2026, 11:41 a.m. UTC
From: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>

Backport an upstream gnulib fix to avoid duplicate md5_* and sha1_*
symbol definitions when building with OpenSSL enabled.

Without this fix, lftp fails to link with errors such as:

  multiple definition of `md5_init_ctx'
  multiple definition of `sha1_init_ctx'

Link: https://github.com/lavv17/lftp/issues/743
Link: https://www.mail-archive.com/bug-gnulib@gnu.org/msg48445.html

Signed-off-by: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>
---
 .../lftp/files/gnulib-duplicate-symbols.patch | 40 +++++++++++++++++++
 .../recipes-connectivity/lftp/lftp_4.9.3.bb   |  5 ++-
 2 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-connectivity/lftp/files/gnulib-duplicate-symbols.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-connectivity/lftp/files/gnulib-duplicate-symbols.patch b/meta-networking/recipes-connectivity/lftp/files/gnulib-duplicate-symbols.patch
new file mode 100644
index 0000000000..220a095ff8
--- /dev/null
+++ b/meta-networking/recipes-connectivity/lftp/files/gnulib-duplicate-symbols.patch
@@ -0,0 +1,40 @@ 
+From: Jan Palus <jpalus@fastmail.com>
+Date: Sun, 17 Nov 2024 06:52:48 -0800
+Subject: [PATCH] {md5,sha1}-stream: avoid duplicate symbols
+
+When building with OpenSSL, *_init_ctx and other inline symbols are
+supposed to be provided by non *-stream compilation units. Drop the
+GL_OPENSSL_INLINE _GL_EXTERN_INLINE override from *-stream.c files so
+they don't re-emit those symbols as extern, causing duplicate symbol
+errors at link time when --whole-archive is used (as lftp does).
+
+Link: https://www.mail-archive.com/bug-gnulib@gnu.org/msg48445.html
+Upstream-Status: Backport [https://github.com/coreutils/gnulib/commit/353a3236d9328349c18ce2e4e984755cb4a76ea7]
+
+Signed-off-by: Jan Palus <jpalus@fastmail.com>
+Signed-off-by: Hemanth Kumar M D <Hemanth.KumarMD@windriver.com>
+
+--- a/lib/md5-stream.c
++++ b/lib/md5-stream.c
+@@ -22,9 +22,6 @@
+ #include <config.h>
+ 
+ /* Specification.  */
+-#if HAVE_OPENSSL_MD5
+-# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
+-#endif
+ #include "md5.h"
+ 
+ #include <stdlib.h>
+--- a/lib/sha1-stream.c
++++ b/lib/sha1-stream.c
+@@ -24,9 +24,6 @@
+ #include <config.h>
+ 
+ /* Specification.  */
+-#if HAVE_OPENSSL_SHA1
+-# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
+-#endif
+ #include "sha1.h"
+ 
+ #include <stdlib.h>
diff --git a/meta-networking/recipes-connectivity/lftp/lftp_4.9.3.bb b/meta-networking/recipes-connectivity/lftp/lftp_4.9.3.bb
index 38bfa86751..3d838e6c42 100644
--- a/meta-networking/recipes-connectivity/lftp/lftp_4.9.3.bb
+++ b/meta-networking/recipes-connectivity/lftp/lftp_4.9.3.bb
@@ -6,7 +6,10 @@  SECTION = "console/network"
 LICENSE = "GPL-3.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
-SRC_URI = "http://lftp.yar.ru/ftp/lftp-${PV}.tar.bz2"
+SRC_URI = "http://lftp.yar.ru/ftp/lftp-${PV}.tar.bz2 \
+           file://gnulib-duplicate-symbols.patch \
+"
+
 SRC_URI[md5sum] = "c32e15b96c08f7f0b2d17efbceb00db8"
 SRC_URI[sha256sum] = "adceaef1bd21a38d07c973233fab603813c431f0a8dcbd23239fa9a41ae17b6e"