uClibc-0.9.27 with locale for ntfs-3g

Jorgen Lundman lundman at lundman.net
Wed May 21 03:35:22 UTC 2008


It seems that part of the build procedure it hops into extra/locale/ and 
runs "make". But this appears to fail:

ishift 2  tshift 10  size 22608
smallest = 5776
setting ishift 5  tshift 1
make: *** [wctables.h] Segmentation fault (core dumped)

#0  0x08049018 in main (argc=Cannot access memory at address 0x0
) at gen_wctype.c:293
293                     memset(widtht, 0, sizeof(widtht));


However, removing -O2:

gcc -g -Wall  -D__UCLIBC_GEN_LOCALE gen_wctype.c -o gen_wctype

.. lets "make" complete, and reach what I assume is the end:

cat c8tables.h wctables.h locale_mmap.h >> uClibc_locale_data.h
cat uClibc_locale_data.h | awk 'BEGIN{i=1}{ if ( /WANT_/ ) i = /endif/ ; 
else if (i) print  }' > ../../include/bits/uClibc_locale_data.h



Not entirely sure how you can test locale, but I at least now get this 
result:

#include <stdio.h>
#include <locale.h>

int main(int argc, char *argv)
{
   char *p, buffer[] = { 
0xe6,0x97,0xa5,0xe6,0x9c,0xac,0xe8,0xaa,0x9e,0x0a };

   p = setlocale(LC_ALL, "");
   printf("setlocale(LC_ALL) returns '%s'\n", p ? p : "(null)");

   p = setlocale(LC_ALL, "ja_JP.UTF-8");
   printf("setlocale(LC_ALL) returns '%s'\n", p ? p : "(null)");

   printf("Test: %s\n", buffer);
}

# ./locale_test
setlocale(LC_ALL) returns 'C'
setlocale(LC_ALL) returns 'ja_JP.UTF-8'
Test: 日本語




Jorgen Lundman wrote:
>> Yes, you don't need any extra files. All locale data are embedded into the 
>> uClibc library.
>> /usr/lib/locale/locale.archive is used by glibc not uClibc.
> 
> Thank you, I needed that information. I was unable to locate it on the 
> uClibc pages.
> 
>> - readelf -s libc.so.0 | grep iconv
>>
> 
> Confirmed to be having iconv_open and siblings. So presumably the 
> problem must lie with the cross-compile of ntfs-3g.
> 
> Thank you.
> 
> Lund
> 
> 
> 
>>> Perhaps I have to force ntfs-3g to "see" iconv while cross compiling.
>>>
>>>
>>>> If you need the iconv tool you have to build also utility doing:
>>>> - make utils
>>>>
>>>> So you can have the locale utility "iconv" and "locale", the latter 
>>>> Recently added to see the currently supported locale.
>>> I do not need to binary tool itself, just the functionality 
>>> for ntfs-3g to be able to call iconv_ functions to translate 
>>> between encodings.
>>>
>>> Thanks for your replies.
>>>
>>> Lund
>>>
>>>
>>>
>>>
>>>
>>>>> There was a separate tarball from 2003 with source code, is that 
>>>>> relevant?
>>>> The tarbal you refering are the locale pregenereted file 
>>> needed if We 
>>>> enable "Use pre-genereted Locale Data" also.
>>>>> The rootfs provided on the download page for
>>>>> mips32 appear to contain no locale files.
>>>>>
>>>>> Lund
>>>>>
>>>>>
>>>>> -- 
>>>>> Jorgen Lundman       | <lundman at lundman.net>
>>>>> Unix Administrator   | +81 (0)3 -5456-2687 ext 1017 (work)
>>>>> Shibuya-ku, Tokyo    | +81 (0)90-5578-8500          (cell)
>>>>> Japan                | +81 (0)3 -3375-1767          (home)
>>>>> _______________________________________________
>>>>> uClibc mailing list
>>>>> uClibc at uclibc.org
>>>>> http://busybox.net/cgi-bin/mailman/listinfo/uclibc
>>>>>
>>>> Regards,
>>>> Filippo Arcidiacono
>>>>
>>>>
>>> -- 
>>> Jorgen Lundman       | <lundman at lundman.net>
>>> Unix Administrator   | +81 (0)3 -5456-2687 ext 1017 (work)
>>> Shibuya-ku, Tokyo    | +81 (0)90-5578-8500          (cell)
>>> Japan                | +81 (0)3 -3375-1767          (home)
>>> _______________________________________________
>>> uClibc mailing list
>>> uClibc at uclibc.org
>>> http://busybox.net/cgi-bin/mailman/listinfo/uclibc
>>>
>>
> 

-- 
Jorgen Lundman       | <lundman at lundman.net>
Unix Administrator   | +81 (0)3 -5456-2687 ext 1017 (work)
Shibuya-ku, Tokyo    | +81 (0)90-5578-8500          (cell)
Japan                | +81 (0)3 -3375-1767          (home)



More information about the uClibc mailing list