[not x86 host; not glibc host; build error] bootstrapping uclibc with locale support: is it possible at all?

Douglas Mencken dougmencken at gmail.com
Mon Feb 14 22:36:17 UTC 2011


any attempt to build uclibc with UCLIBC_HAS_LOCALE=yes yields with:

  LN include/bits/posix_opt.h
  HOSTCC extra/locale/gen_wc8bit -D__UCLIBC_GEN_LOCALE
-DCTYPE_PACKED=1 -DDO_WIDE_CHAR=1
extra/locale/gen_wc8bit.c: In function 'main':
extra/locale/gen_wc8bit.c:375:28: warning: array subscript is above array bounds
extra/locale/gen_wc8bit.c:434:29: warning: array subscript is above array bounds
extra/locale/gen_wc8bit.c:500:27: warning: array subscript is above array bounds
  GEN extra/locale/codesets.txt
  GEN extra/locale/c8tables.h
sh: locale: not found
make: *** [extra/locale/c8tables.h] Error 1
  HOSTCC extra/locale/gen_locale -D_GNU_SOURCE
In file included from extra/locale/gen_locale.c:13:0:
extra/locale/c8tables.h:1:7: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'not'
extra/locale/gen_locale.c: In function 'do_locale_names':
extra/locale/gen_locale.c:227:42: error: 'lc_names' undeclared (first
use in this function)
extra/locale/gen_locale.c:227:42: note: each undeclared identifier is
reported only once for each function it appears in
extra/locale/gen_locale.c: In function 'lc_monetary_C':
extra/locale/gen_locale.c:1083:2: warning: #warning fix the char
entries for monetary... target signedness of char may be different!
make: *** [extra/locale/gen_locale] Error 1
ERROR: 'make' error. Abort.

./extra/locale/gen_wc8bit.c does include this:

 if (!setlocale(LC_CTYPE, "en_US.UTF-8")) {
                /* Silly foreigners disabling en_US locales */
                fp = popen("locale -a", "r");

I don't know anything about any "silly foreigners", but I'm sure that
uclibc built w/o UCLIBC_HAS_LOCALE set to "yes" has nor 'setlocale'
returning non-zero, nor 'locale' command.
So how is it possible to bootstrap locale-aware uclibc?

Also (from 'extra/locale/gen_wc8bit.c'):

int main(int argc, char **argv)
{
        FILE *fp;

and then

FILE *fp = popen("locale -a", "r");

does anyway produce an error, despite any host/target (which at least
is easily correctable: just remove "FILE *" from "FILE *fp").


More information about the uClibc mailing list