build: add EXTRALIBS to link with
PATCH 1/1 build: add EXTRALIBS to link with
When doing a uClibc static build, the build fails to link:
http://autobuild.buildroot.org/results/503/50314716a9f72e8bb238e52e9dc342c68f7e0b8b/build-end.log
The cause is due to:
- xfsprogs links dome programs with util-linux' libblkid
- util-linux' libblkid is linked to util-linux' libuuid
- util-linux' libuuid uses i18n functions when locales are enabled
- uClibc does not provide i18n functions
- i18n functions are provided by libintl from libintl from gettext
util-linux installs pkg-config files for thos two libs. However, xfsprogs does not use pkg-config to find libblkid or libuuid, thus it misses the Libs.private field from libuid.
In this case, it is necessary to pass LIBS=-lintl at configure time, so that configure correctly finds libblkid.
Still, this is not enough, because the build will not use LIBS during the link phase.
We fix that last bit by adding EXTRALIBS to the libraries to link with, so that it is possible to pass EXTRALIBS=-lintl at build time:
$ ./configure [...] LIBS=-lintl
$ make EXTRALIBS=-lintl--- include/buildmacros | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/buildmacros +1 -1
@@ -11,7 +11,7 @@ BUILDRULES = $(TOPDIR)/include/buildrules LDFLAGS += $(LOADERFLAGS) $(LLDFLAGS) LTLDFLAGS += $(LOADERFLAGS) -LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB) +LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB) $(EXTRALIBS) MAKEOPTS = --no-print-directory Q=$(Q) SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES)
Signature · 1 line
2.7.4
PATCH 1/1 build: add EXTRALIBS to link with
Hi Yann,
Yann E. MORIN wrote,
Quoted 8 lines
When doing a uClibc static build, the build fails to link:
http://autobuild.buildroot.org/results/503/50314716a9f72e8bb238e52e9dc342c68f7e0b8b/build-end.logThe cause is due to:
- xfsprogs links dome programs with util-linux' libblkid
- util-linux' libblkid is linked to util-linux' libuuid
- util-linux' libuuid uses i18n functions when locales are enabled
- uClibc does not provide i18n functions
One minor issue. uClibc-ng provides i18n functions when UCLIBC_HAS_LIBINTL is set. That was added recently, but is available in the uClibc-ng release used in buildroot.
A better testing of this would be cool. It was imported from gettext-tiny project from Sabotage linux distribution.
best regards
Waldemar
This doesn't look like the correct fix to me. If you specify the libs at ./configure time they should be picked up by autoconf for the build process instead of having to specify them again.
Never mind that the configure script really should probabe for the additional libraries to start with.