uClibc 교차 컴파일 오류 해결

9999 단어
컴파일 오류
# [extra/locale/locale_mmap.h:46: error: '__LOCALE_DATA_WCctype_II_LEN' undeclared here (not in a function)](https://stackoverflow.com/questions/11963280/extra-locale-locale-mmap-h46-error-locale-data-wcctype-ii-len-undeclared)

[Ask](https://stackoverflow.com/questions/ask)

원인을 찾아 같은 잘못을 발견하다
https://stackoverflow.com/questions/11963280/extra-locale-locale-mmap-h46-error-locale-data-wcctype-ii-len-undeclared/28906427#28906427
해결 방법에 따라 처리하였으나 결과는 여전히 틀렸다.
그리고 오류 원인과 patch 파일 오류 원인은 다음과 같습니다.https://dev.archive.openwrt.org/ticket/13095patch 파일은 다음과 같습니다.
http://ftp.osuosl.org/pub/manulix/scripts/build-scripts/PPFILES/ppfiles-uclibc/gen_wctype.patch
patch 파일
--- a/extra/locale/gen_wctype.c
+++ b/extra/locale/gen_wctype.c
@@ -227,11 +227,12 @@
            ++verbose;
            continue;
        }
-       if (!setlocale(LC_CTYPE, *argv)) {
+   /* setlocale might be just a stub */
+   /*  if (!setlocale(LC_CTYPE, *argv)) {
            verbose_msg("setlocale(LC_CTYPE,%s) failed!  Skipping this locale...
", *argv); continue; } - + */ if (!(totitle = wctrans("totitle"))) { verbose_msg("no totitle transformation.
"); } @@ -306,43 +307,43 @@ #endif #if 0 if (c < 256) { - unsigned int glibc; + unsigned int curr_stdclib; - glibc = 0; - if (isalnum(c)) ++glibc; glibc <<= 1; - if (isalpha(c)) ++glibc; glibc <<= 1; - if (isblank(c)) ++glibc; glibc <<= 1; - if (iscntrl(c)) ++glibc; glibc <<= 1; - if (isdigit(c)) ++glibc; glibc <<= 1; - if (isgraph(c)) ++glibc; glibc <<= 1; - if (islower(c)) ++glibc; glibc <<= 1; - if (isprint(c)) ++glibc; glibc <<= 1; - if (ispunct(c)) ++glibc; glibc <<= 1; - if (isspace(c)) ++glibc; glibc <<= 1; - if (isupper(c)) ++glibc; glibc <<= 1; - if (isxdigit(c)) ++glibc; - verbose_msg("%#8x : ctype %#4x
", c, glibc); + curr_stdclib = 0; + if (isalnum(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (isalpha(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (isblank(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iscntrl(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (isdigit(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (isgraph(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (islower(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (isprint(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (ispunct(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (isspace(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (isupper(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (isxdigit(c)) ++curr_stdclib; + verbose_msg("%#8x : ctype %#4x
", c, curr_stdclib); } #endif #if 1 /* Paranoid checking... */ { - unsigned int glibc; + unsigned int curr_stdclib; unsigned int mine; - glibc = 0; - if (iswalnum(c)) ++glibc; glibc <<= 1; - if (iswalpha(c)) ++glibc; glibc <<= 1; - if (iswblank(c)) ++glibc; glibc <<= 1; - if (iswcntrl(c)) ++glibc; glibc <<= 1; - if (iswdigit(c)) ++glibc; glibc <<= 1; - if (iswgraph(c)) ++glibc; glibc <<= 1; - if (iswlower(c)) ++glibc; glibc <<= 1; - if (iswprint(c)) ++glibc; glibc <<= 1; - if (iswpunct(c)) ++glibc; glibc <<= 1; - if (iswspace(c)) ++glibc; glibc <<= 1; - if (iswupper(c)) ++glibc; glibc <<= 1; - if (iswxdigit(c)) ++glibc; + curr_stdclib = 0; + if (iswalnum(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswalpha(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswblank(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswcntrl(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswdigit(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswgraph(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswlower(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswprint(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswpunct(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswspace(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswupper(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswxdigit(c)) ++curr_stdclib; mine = 0; if (mywalnum(d,c)) ++mine; mine <<= 1; @@ -358,15 +359,15 @@ if (mywupper(d,c)) ++mine; mine <<= 1; if (mywxdigit(d,c)) ++mine; - if (glibc != mine) { - verbose_msg("%#8x : glibc %#4x != %#4x mine %u
", c, glibc, mine, d); + if (curr_stdclib != mine) { + verbose_msg("%#8x : curr_stdclib %#4x != %#4x mine %u
", c, curr_stdclib, mine, d); return EXIT_FAILURE; } #if 0 if (iswctype(c,is_comb) || iswctype(c,is_comb3)) { /* if (!iswpunct(c)) { */ verbose_msg("%#8x : %d %d %#4x
", - c, iswctype(c,is_comb),iswctype(c,is_comb3), glibc); + c, iswctype(c,is_comb),iswctype(c,is_comb3), curr_stdclib); /* } */ } #endif @@ -553,7 +554,7 @@ for (c = 0; c <= 0x10ffffUL; c++) #endif { - unsigned int glibc; + unsigned int curr_stdclib; unsigned int mine; unsigned int upper, lower; @@ -568,19 +569,19 @@ } #endif #endif - glibc = 0; - if (iswalnum(c)) ++glibc; glibc <<= 1; - if (iswalpha(c)) ++glibc; glibc <<= 1; - if (iswblank(c)) ++glibc; glibc <<= 1; - if (iswcntrl(c)) ++glibc; glibc <<= 1; - if (iswdigit(c)) ++glibc; glibc <<= 1; - if (iswgraph(c)) ++glibc; glibc <<= 1; - if (iswlower(c)) ++glibc; glibc <<= 1; - if (iswprint(c)) ++glibc; glibc <<= 1; - if (iswpunct(c)) ++glibc; glibc <<= 1; - if (iswspace(c)) ++glibc; glibc <<= 1; - if (iswupper(c)) ++glibc; glibc <<= 1; - if (iswxdigit(c)) ++glibc; + curr_stdclib = 0; + if (iswalnum(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswalpha(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswblank(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswcntrl(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswdigit(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswgraph(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswlower(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswprint(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswpunct(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswspace(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswupper(c)) ++curr_stdclib; curr_stdclib <<= 1; + if (iswxdigit(c)) ++curr_stdclib; { unsigned int u; @@ -630,8 +631,8 @@ if (mywupper(d,c)) ++mine; mine <<= 1; if (mywxdigit(d,c)) ++mine; - if (glibc != mine) { - verbose_msg("%#8x : glibc %#4x != %#4x mine %d
", c, glibc, mine, d); + if (curr_stdclib != mine) { + verbose_msg("%#8x : curr_stdclib %#4x != %#4x mine %d
", c, curr_stdclib, mine, d); if (c < 0x30000UL) { verbose_msg("sc=%#x u=%#x n=%#x i0=%#x i1=%#x
", sc, u, n, i0, i1); } @@ -655,17 +656,17 @@ } if (towupper(c) != upper) { - verbose_msg("%#8x : towupper glibc %#4x != %#4x mine
", + verbose_msg("%#8x : towupper curr_stdclib %#4x != %#4x mine
", c, towupper(c), upper); } if (towlower(c) != lower) { - verbose_msg("%#8x : towlower glibc %#4x != %#4x mine i0 = %d
", + verbose_msg("%#8x : towlower curr_stdclib %#4x != %#4x mine i0 = %d
", c, towlower(c), lower, i0); } if (totitle && ((tt = towctrans(c, totitle)) != upper)) { - verbose_msg("%#8x : totitle glibc %#4lx != %#4x mine i0 = %d
", + verbose_msg("%#8x : totitle curr_stdclib %#4lx != %#4x mine i0 = %d
", c, tt, upper, i0); } }

uClibc의 버전이 다르기 때문에 패치를 하는 데 오류가 발생할 수 있습니다. 패치와gen_에 따라wctype.c 파일의 대비로 gen_ 수정wctype.c 파일, 이렇게 하면 해결할 수 있습니다!

좋은 웹페이지 즐겨찾기