From: Yegor Yefremov via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Thomas Devoogdt <thomas@devoogdt.com>
Subject: [Buildroot] [PATCH] package/libsoup3: fix static build
Date: Mon, 28 Sep 2026 00:19:58 +0200 [thread overview]
Message-ID: <20260927221958.864086-1-yegorslists@gmail.com> (raw)
From: Yegor Yefremov <yegorslists@googlemail.com>
Since the bump to 3.7.3, libsoup unconditionally includes <dlfcn.h>
in soup-init.c to detect whether libsoup2 is loaded in the same
process. Static-only toolchains such as uClibc-ng without shared
library support don't provide this header, so the build fails:
../libsoup/soup-init.c:21:10: fatal error: dlfcn.h: No such file or directory
Add a patch, submitted upstream, that checks for dlfcn.h at configure
time and skips the libsoup2 detection when it is not available.
Fixes:
https://autobuild.buildroot.org/results/4effebe5fc12146749e704dd56f695363cc8fbc3
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Assisted-by: Claude:claude-opus-5
---
...use-dlopen-when-dlfcn.h-is-available.patch | 67 +++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100644 package/libsoup3/0001-soup-init-only-use-dlopen-when-dlfcn.h-is-available.patch
diff --git a/package/libsoup3/0001-soup-init-only-use-dlopen-when-dlfcn.h-is-available.patch b/package/libsoup3/0001-soup-init-only-use-dlopen-when-dlfcn.h-is-available.patch
new file mode 100644
index 0000000000..e2caa3c52b
--- /dev/null
+++ b/package/libsoup3/0001-soup-init-only-use-dlopen-when-dlfcn.h-is-available.patch
@@ -0,0 +1,67 @@
+From 9dae8238db84a1ce2aeb61cce41af4718157172b Mon Sep 17 00:00:00 2001
+From: Yegor Yefremov <yegorslists@googlemail.com>
+Date: Sun, 27 Sep 2026 12:03:53 +0200
+Subject: [PATCH] soup-init: only use dlopen() when dlfcn.h is available
+
+Commit 1296cbf983f0 ("soup-init: Use libdl instead of gmodule in
+`soup2_is_loaded` check") unconditionally includes <dlfcn.h> on
+non-Windows platforms. Static-only toolchains (e.g. uClibc-ng built
+without shared library support) don't provide this header, so the
+build fails:
+
+../libsoup/soup-init.c:21:10: fatal error: dlfcn.h: No such file or directory
+
+Check for dlfcn.h at configure time and skip the libsoup2 detection
+when it is not available. Without dynamic loading, libsoup2 cannot be
+loaded into the process at runtime anyway.
+
+Upstream: https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/571
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+Assisted-by: Claude:claude-opus-5
+---
+ libsoup/soup-init.c | 9 ++++++---
+ meson.build | 4 ++++
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/libsoup/soup-init.c b/libsoup/soup-init.c
+index 3392e8e..a57db6e 100644
+--- a/libsoup/soup-init.c
++++ b/libsoup/soup-init.c
+@@ -17,7 +17,7 @@
+ #include <windows.h>
+
+ HMODULE soup_dll;
+-#else
++#elif defined (HAVE_DLFCN_H)
+ #include <dlfcn.h>
+ #endif
+
+@@ -26,8 +26,11 @@ soup2_is_loaded (void)
+ {
+ gboolean result = FALSE;
+
+- /* Skip on PE/COFF, as it doesn't have a flat symbol namespace */
+-#ifndef G_OS_WIN32
++ /* Skip on PE/COFF, as it doesn't have a flat symbol namespace,
++ * and on platforms without dlopen() support (e.g. static-only
++ * toolchains).
++ */
++#if !defined (G_OS_WIN32) && defined (HAVE_DLFCN_H)
+ gpointer handle;
+ gpointer func;
+
+diff --git a/meson.build b/meson.build
+index 4422215..3140ceb 100644
+--- a/meson.build
++++ b/meson.build
+@@ -167,6 +167,10 @@ libpsl_required_version = '>= 0.20'
+ libpsl_dep = dependency('libpsl', version : libpsl_required_version,
+ fallback : ['libpsl', 'libpsl_dep'])
+
++if cc.has_header('dlfcn.h')
++ cdata.set('HAVE_DLFCN_H', '1')
++endif
++
+ if cc.has_function('gmtime_r', prefix : '#include <time.h>', args : default_source_flag)
+ cdata.set('HAVE_GMTIME_R', '1')
+ endif
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2026-09-27 22:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-27 22:19 Yegor Yefremov via buildroot [this message]
2026-09-28 11:08 ` [Buildroot] [PATCH] package/libsoup3: fix static build Thomas Petazzoni via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260927221958.864086-1-yegorslists@gmail.com \
--to=buildroot@buildroot.org \
--cc=thomas@devoogdt.com \
--cc=yegorslists@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox