[Buildroot] Problem linking xlib_libXpm-3.5.12/sxpm

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed Jan 3 22:23:01 UTC 2018


Hello,

On Wed, 3 Jan 2018 14:35:52 +0100, Thomas Petazzoni wrote:

> This config fails to build here, with the exact same error as the one
> you had:
> 
>   CCLD     sxpm
> sxpm.o: In function `Usage':
> sxpm.c:(.text+0x14): undefined reference to `libintl_gettext'
> sxpm.c:(.text+0x30): undefined reference to `libintl_gettext'
> sxpm.o: In function `ErrorMessage':
> sxpm.c:(.text+0x170): undefined reference to `libintl_gettext'
> sxpm.c:(.text+0x186): undefined reference to `libintl_gettext'
> sxpm.c:(.text+0x1ba): undefined reference to `libintl_gettext'
> sxpm.o:sxpm.c:(.text+0x1d0): more undefined references to `libintl_gettext' follow
> sxpm.o: In function `main':
> sxpm.c:(.text.startup+0x3a): undefined reference to `libintl_bindtextdomain'
> sxpm.c:(.text.startup+0x46): undefined reference to `libintl_textdomain'
> sxpm.c:(.text.startup+0x81): undefined reference to `libintl_gettext'
> sxpm.c:(.text.startup+0xa17): undefined reference to `libintl_gettext'
> collect2: error: ld returned 1 exit status
> make[3]: *** [sxpm] Error 1
> make[3]: Leaving directory `/home/test/buildroot/output/build/xlib_libXpm-3.5.12/sxpm'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/home/test/buildroot/output/build/xlib_libXpm-3.5.12'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/home/test/buildroot/output/build/xlib_libXpm-3.5.12'
> make: *** [/home/test/buildroot/output/build/xlib_libXpm-3.5.12/.stamp_built] Error 2
> 
> I'll have to investigate.

The problem is due to the fact that xlib_libXpm doesn't use the proper
autoconf/automake integration for gettext.

Due to this, it forgets to link with libintl when intl functions are in
an external library. It is also the reason why libXpm fails to build in
other configurations because xgettext is missing, even if --disable-nls
has been passed.

The most correct solution is to rework the gettext integration in
xlib_libXpm.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com



More information about the buildroot mailing list