Message ID | 20220330132749.1417115-1-br015@umbiko.net |
---|---|
State | Superseded |
Headers | show |
Series | [1/1] package/mpd: disable expat explicitly unless target package exists | expand |
I marked this patch as obsolete. A variant of this failure has come up, and this approach is not feasible anymore. Kind regards, Andreas On 2022-03-30 13:27, Andreas Ziegler wrote: > 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. > > Signed-off-by: Andreas Ziegler <br015@umbiko.net> > --- > package/mpd/mpd.mk | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/package/mpd/mpd.mk b/package/mpd/mpd.mk > index 12da36098f..c1ad1bc6c6 100644 > --- a/package/mpd/mpd.mk > +++ b/package/mpd/mpd.mk > @@ -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 > -- > 2.34.1
diff --git a/package/mpd/mpd.mk b/package/mpd/mpd.mk index 12da36098f..c1ad1bc6c6 100644 --- a/package/mpd/mpd.mk +++ b/package/mpd/mpd.mk @@ -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
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. Signed-off-by: Andreas Ziegler <br015@umbiko.net> --- package/mpd/mpd.mk | 5 +++++ 1 file changed, 5 insertions(+)