Skip to contentSkip to conversation

package/mpd: disable expat explicitly unless target package exists

PATCH In review Andreas Ziegler 1 participant 2 messages Mar 30, 2022 – Mar 31, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/mpd: disable expat explicitly unless target package exists

Background:
During configuration, mpd tries to determine the availability of optional dependencies using (host) pkgconfig and CMake. If host and target architecture are identical, it locates host-libexpat (CMake dependency) and tries to incorporate it into the build process. The link step fails subsequently, because some dependencies of host binaries come from the build machine, and are not present on the target.

This results in the following build error:
/home/data/buildroot.x86_64/host/lib/gcc/x86_64-buildroot-linux-uclibc/11.2.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: warning: libc.so.6, needed by /home/data/buildroot.x86_64/host/lib/libexpat.so.1.8.7, not found (try using -rpath or -rpath-link) /home/data/buildroot.x86_64/host/lib/gcc/x86_64-buildroot-linux-uclibc/11.2.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: /home/data/buildroot.x86_64/host/lib/libexpat.so.1.8.7: undefined reference to `__errno_location@GLIBC_2.2.5'

The link step fails, because libexpat was built against the build machine's C library.

The optional expat dependency is disabled, unless the expat target package is selected. This is in line with BR2_PACKAGE_MPD_UPNP_* handling logic, which selects the target package and needs to enable the expat option. The grey area of expat present on the target for other reasons, but not explicitly needed for mpd, is accepted to avoid making the logic too complicated.

---
 package/mpd/mpd.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/mpd/mpd.mk +5 -0
index 12da36098f..c1ad1bc6c6 100644
@@ -21,6 +21,11 @@ MPD_CONF_OPTS = \
 	-Dpipewire=disabled \
 	-Dsnapcast=false
 
+# Disable expat explicitly, unless the target package is selected
+ifneq ($(BR2_PACKAGE_EXPAT),y)
+MPD_CONF_OPTS += -Dexpat=disabled
+endif
+
 # Zeroconf support depends on libdns_sd from avahi.
 ifeq ($(BR2_PACKAGE_MPD_AVAHI_SUPPORT),y)
 MPD_DEPENDENCIES += avahi
Signature · 6 lines
2.34.1

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

I marked this patch as obsolete. A variant of this failure has come up, and this approach is not feasible anymore.

Kind regards,
Andreas

Quoted 49 lines · Andreas Ziegler

Background:
During configuration, mpd tries to determine the availability of optional dependencies using (host) pkgconfig and CMake. If host and target architecture are identical, it locates host-libexpat (CMake dependency) and tries to incorporate it into the build process. The link step fails subsequently, because
some dependencies of host binaries come from the build machine, and are not present on the target.

This results in the following build error:
/home/data/buildroot.x86_64/host/lib/gcc/x86_64-buildroot-linux-uclibc/11.2.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld:
warning: libc.so.6, needed by
/home/data/buildroot.x86_64/host/lib/libexpat.so.1.8.7, not found (try
using -rpath or -rpath-link) /home/data/buildroot.x86_64/host/lib/gcc/x86_64-buildroot-linux-uclibc/11.2.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld:
/home/data/buildroot.x86_64/host/lib/libexpat.so.1.8.7: undefined
reference to `__errno_location@GLIBC_2.2.5'

The link step fails, because libexpat was built against the build machine's C library.

The optional expat dependency is disabled, unless the expat target package is selected. This is in line with BR2_PACKAGE_MPD_UPNP_* handling logic, which selects the target package and needs to enable the expat option. The grey area of expat present on the target for other reasons, but not explicitly needed for mpd, is accepted to avoid making the logic too complicated.

---
 package/mpd/mpd.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/mpd/mpd.mk +5 -1
index 12da36098f..c1ad1bc6c6 100644
@@ -21,6 +21,11 @@ MPD_CONF_OPTS = \
 	-Dpipewire=disabled \
 	-Dsnapcast=false
 
+# Disable expat explicitly, unless the target package is selected
+ifneq ($(BR2_PACKAGE_EXPAT),y)
+MPD_CONF_OPTS += -Dexpat=disabled
+endif
+
 # Zeroconf support depends on libdns_sd from avahi.
 ifeq ($(BR2_PACKAGE_MPD_AVAHI_SUPPORT),y)
 MPD_DEPENDENCIES += avahi
--
Quoted 1 line

2.34.1

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