* [Buildroot] [git commit] package/mosquitto: fix build failure with recent glibc
@ 2025-09-01 11:16 Peter Korsgaard
0 siblings, 0 replies; only message in thread
From: Peter Korsgaard @ 2025-09-01 11:16 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=a49354e46fcde6884703438089cb878966036763
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
Fix link-time build failures because glibc>=2.34 no longer ships libanl.so
as it has been consolidated into libc.
See the inner patch message for more details.
Fixes: https://autobuild.buildroot.org/results/16223cd838876abc9b6f941f7dc20d23afa32c3b/
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
.../0002-Add-configure-time-check-for-lanl.patch | 47 ++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/package/mosquitto/0002-Add-configure-time-check-for-lanl.patch b/package/mosquitto/0002-Add-configure-time-check-for-lanl.patch
new file mode 100644
index 0000000000..b67164123a
--- /dev/null
+++ b/package/mosquitto/0002-Add-configure-time-check-for-lanl.patch
@@ -0,0 +1,47 @@
+From 447a6aa8df882a67ca3df6f5e95be42e1463eaf0 Mon Sep 17 00:00:00 2001
+From: Titouan Christophe <titouan.christophe@mind.be>
+Date: Fri, 29 Aug 2025 19:47:34 +0200
+Subject: [PATCH] Add configure-time check for -lanl
+
+Since glibc 2.34, libanl features have been integrated directly into libc [1].
+For backward compatibility, some toolchains still provide a shim for
+libanl as a separate .so, but new toolchains (for example for new archs
+like loongarch) do not provide it anymore.
+
+In such a case, building mosquitto fails at link time with (see [2])
+ > cannot find -lanl: No such file or directory
+
+To fix this problem while maintaining compatibility with older toolchains,
+check if a simple program that uses libanl can be compiled without -lanl,
+and only add the linker flag otherwise.
+
+[1] https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html
+[2] https://autobuild.buildroot.org/results/16223cd838876abc9b6f941f7dc20d23afa32c3b/build-end.log
+
+Upstream: https://github.com/eclipse-mosquitto/mosquitto/pull/3358
+
+Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
+---
+ config.mk | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/config.mk b/config.mk
+index 34d5163f..cc7987c4 100644
+--- a/config.mk
++++ b/config.mk
+@@ -318,8 +318,11 @@ ifeq ($(WITH_EC),yes)
+ endif
+
+ ifeq ($(WITH_ADNS),yes)
+- BROKER_LDADD:=$(BROKER_LDADD) -lanl
+ BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_ADNS
++ NEED_LIBANL := $(shell printf '#include <stdlib.h>\n#include <netdb.h>\nint main(){return getaddrinfo_a(0, NULL, 0, NULL);}'| $(CC) -D_GNU_SOURCE -o /dev/null -x c - 2>/dev/null || echo YES)
++ ifeq ($(NEED_LIBANL),YES)
++ BROKER_LDADD:=$(BROKER_LDADD) -lanl
++ endif
+ endif
+
+ ifeq ($(WITH_CONTROL),yes)
+--
+2.50.1
+
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-01 12:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 11:16 [Buildroot] [git commit] package/mosquitto: fix build failure with recent glibc Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).