This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Link failure with locale routines (when _MB_CAPABLE undefined)
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: newlib at sourceware dot org
- Date: Thu, 18 Aug 2016 14:02:44 +0200 (CEST)
- Subject: Link failure with locale routines (when _MB_CAPABLE undefined)
- Authentication-results: sourceware.org; auth=none
Hello,
attempting to use the new locale routines, in particular newlocale
and freelocale, on a newlib built with _MB_CAPABLE undefined,
results in link failures:
spu/lib/libg.a(lib_a-newlocale.o): In function `_newlocale_r':
newlib/libc/locale/newlocale.c:113: undefined reference to `__C_locale'
newlib/libc/locale/newlocale.c:111: undefined reference to `__C_locale'
newlib/libc/locale/newlocale.c:167: undefined reference to `__loadlocale'
spu/lib/libg.a(lib_a-freelocale.o): In function `_freelocale_r':
newlib/libc/locale/freelocale.c:44: undefined reference to `__C_locale'
newlib/libc/locale/freelocale.c:44: undefined reference to `__C_locale'
This causes a build failure for libgfortran on spu-elf, because it
results in configure detecting uselocale available while newlocale
is not, and libgfortran doesn't handle that combination correctly.
The reason for the failure appears to be that __C_locale and
__loadlocale are defined only if _MB_CAPABLE is defined, but
they are used unconditionally from newlocale.c / freelocale.c.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com