* [Buildroot] [PATCH] package/libsoup3: fix static build
@ 2026-09-27 22:19 Yegor Yefremov via buildroot
2026-09-28 11:08 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Yegor Yefremov via buildroot @ 2026-09-27 22:19 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Devoogdt
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH] package/libsoup3: fix static build
2026-09-27 22:19 [Buildroot] [PATCH] package/libsoup3: fix static build Yegor Yefremov via buildroot
@ 2026-09-28 11:08 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-09-28 11:08 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: buildroot, Thomas Devoogdt
On Mon, Sep 28, 2026 at 12:19:58AM +0200, Yegor Yefremov via buildroot wrote:
> 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
It would be even better to explicitly mention the commit that
introduced the regression, so I've added a Fixes: tag with this
information.
Applied to master, thanks!
Best regards,
Thomas Petazzoni
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-28 11:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-27 22:19 [Buildroot] [PATCH] package/libsoup3: fix static build Yegor Yefremov via buildroot
2026-09-28 11:08 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox