From 441ccd8dab358a725bbf3b70e8e698314f71edb4 Mon Sep 17 00:00:00 2001 From: Yegor Yefremov Date: Mon, 28 Sep 2026 00:19:58 +0200 Subject: [PATCH] package/libsoup3: fix static build Since the bump to 3.7.3, libsoup unconditionally includes 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 Fixes: 55cec1d01307f8e93c6ce61c95c22c863fc1ce28 ("package/libsoup3: bump to 3.7.3") Signed-off-by: Yegor Yefremov Assisted-by: Claude:claude-opus-5 Signed-off-by: Thomas Petazzoni --- ...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 +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 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 +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 + + HMODULE soup_dll; +-#else ++#elif defined (HAVE_DLFCN_H) + #include + #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 ', args : default_source_flag) + cdata.set('HAVE_GMTIME_R', '1') + endif