Skip to contentSkip to conversation

package/gdk-pixbuf: fix static build with libpng or jpeg

PATCH New Yegor Yefremov via buildroot 1 participant 1 message Nov 12

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gdk-pixbuf: fix static build with libpng or jpeg

With BR2_STATIC_LIBS=y, gdk-pixbuf is built with -Dbuiltin_loaders=all, so the png and jpeg loaders end up in libgdk_pixbuf-2.0.a. Their external dependencies are however only attached to the internal loader libraries, not to the gdk-pixbuf dependency object used to link the gdk-pixbuf-csource, gdk-pixbuf-pixdata and gdk-pixbuf-query-loaders tools, so linking them fails:

ld: gdk-pixbuf/libgdk_pixbuf-2.0.a(io-png.c.o): in function `setup_png_transformations':
io-png.c:(.text+0x4c): undefined reference to `png_get_bit_depth'
ld: io-png.c:(.text+0xf4): undefined reference to `png_get_IHDR'

Backport upstream commit d1a187d41975 ("build: Include dependencies for builtin loaders"), released in 2.43.4, which adds the builtin loaders' dependencies to the gdk-pixbuf dependency object and links the tools against it. It supersedes the local fixes proposed earlier in [1] and [2], which were waiting for upstream feedback.

The relevant upstream build code is unchanged throughout 2.42.x, and -Dbuiltin_loaders=all has been used since commit 7ecf22a2fe01 ("package/gdk-pixbuf: fix static build") in 2021, so the failure could not be traced to a single Buildroot commit. The autobuilders have hit it since at least 2024, and all maintenance branches (2025.02.x, 2025.11.x, 2026.02.x, 2026.05.x and 2026.08.x) ship the same gdk-pixbuf 2.42.12 package and are affected.

[1] https://patchwork.buildroot.org/project/buildroot/patch/[email protected]/
[2] https://patchwork.buildroot.org/project/buildroot/patch/[email protected]/

Fixes:
https://autobuild.buildroot.org/results/858f7a4943b52d2470a49c979ba3ce24282e1d56

Assisted-by Claude:claude-opus-5-5
---
 ...ude-dependencies-for-builtin-loaders.patch | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/gdk-pixbuf/0001-build-Include-dependencies-for-builtin-loaders.patch
package/gdk-pixbuf/0001-build-Include-dependencies-for-builtin-loaders.patch new file +41 -0
new file mode 100644
index 0000000000..1d70f55f88
@@ -0,0 +1,41 @@
+From d1a187d4197552751a86bc1a0d023ad66f591abc Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <[email protected]>
+Date: Thu, 14 Aug 2025 18:17:40 +0100
+Subject: [PATCH] build: Include dependencies for builtin loaders
+
+If we build gdk-pixbuf with builtin loaders, especially if we're doing a
+static build, we need to include the dependencies of each builtin loader
+into the global gdk-pixbuf dependency object, otherwise we won't be able
+to build binaries and tests.
+
+Upstream: https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/d1a187d4197552751a86bc1a0d023ad66f591abc
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ gdk-pixbuf/meson.build | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build
+index 10c1af7fb..db4f645fd 100644
+--- a/gdk-pixbuf/meson.build
++++ b/gdk-pixbuf/meson.build
+@@ -333,7 +333,7 @@ endif
+ gdkpixbuf_dep = declare_dependency(
+   link_with: gdkpixbuf,
+   include_directories: root_inc,
+-  dependencies: gdk_pixbuf_deps,
++  dependencies: [ gdk_pixbuf_deps, included_loaders_deps ],
+   sources: [ gdkpixbuf_enum_h, built_girs ],
+ )
+ meson.override_dependency('gdk-pixbuf-2.0', gdkpixbuf_dep)
+@@ -403,7 +403,7 @@ foreach bin: gdkpixbuf_bin
+ 
+   bin = executable(bin_name, bin_source,
+                    gdkpixbuf_enum_h,
+-                   dependencies: gdk_pixbuf_deps + [ gdkpixbuf_dep ],
++                   dependencies: gdkpixbuf_dep,
+                    include_directories: [ root_inc, gdk_pixbuf_inc ],
+                    c_args: common_cflags + gdk_pixbuf_cflags,
+                    install: true)
+-- 
+2.34.1
+
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot