| Summary: | gcc-3.4.6 fails to compile with uClibc HEAD | ||
|---|---|---|---|
| Product: | uClibc | Reporter: | rhabarber1848 |
| Component: | Locales | Assignee: | unassigned |
| Status: | RESOLVED WONTFIX | ||
| Severity: | enhancement | CC: | aldot, rhabarber1848, uclibc-cvs, vda.linux |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: |
diff of uClibc_locale.h shows removed code
uClibc .config The patch which *possibly* fixes it |
||
|
Description
rhabarber1848
2009-01-15 17:37:56 UTC
Created attachment 23 [details]
diff of uClibc_locale.h shows removed code
Attached you will find the diff of uClibc-generated include/bits/uClibc_locale.h
As you can see the unpatched uClibc SVN HEAD removes a lot of lines from this file, including
extern struct __uclibc_locale_struct * __global_locale;
work_uclibc_head/image/cdkroot/include/bits/uClibc_locale.h
is the file produced by unpatched uClibc SVN HEAD
work_uclibc/image/cdkroot/include/bits/uClibc_locale.h
is the file produced by uClibc SVN HEAD, with commits 24565-24572 removed
Created attachment 25 [details]
uClibc .config
Created attachment 29 [details]
The patch which *possibly* fixes it
Please try it and let me know whether it works.
Using latest SVN HEAD now produces this error message: monetary_members.cc: In member function `void std::moneypunct<_CharT, _Intl>::_M_initialize_moneypunct(int*, const char*) [with _CharT = wchar_t, bool _Intl = true]': monetary_members.cc:412: error: invalid use of undefined type `struct __uclibc_locale_struct' /root/tuxbox/work_uclibc/image/cdk/powerpc-tuxbox-linux-uclibc/include/bits/uClibc_locale.h:93: error: forward declaration of `struct __uclibc_locale_struct' monetary_members.cc:413: error: invalid use of undefined type `struct __uclibc_locale_struct' /root/tuxbox/work_uclibc/image/cdk/powerpc-tuxbox-linux-uclibc/include/bits/uClibc_locale.h:93: error: forward declaration of `struct __uclibc_locale_struct' monetary_members.cc: In member function `void std::moneypunct<_CharT, _Intl>::_M_initialize_moneypunct(int*, const char*) [with _CharT = wchar_t, bool _Intl = false]': monetary_members.cc:570: error: invalid use of undefined type `struct __uclibc_locale_struct' /root/tuxbox/work_uclibc/image/cdk/powerpc-tuxbox-linux-uclibc/include/bits/uClibc_locale.h:93: error: forward declaration of `struct __uclibc_locale_struct' monetary_members.cc:571: error: invalid use of undefined type `struct __uclibc_locale_struct' /root/tuxbox/work_uclibc/image/cdk/powerpc-tuxbox-linux-uclibc/include/bits/uClibc_locale.h:93: error: forward declaration of `struct __uclibc_locale_struct' The solution which works here is to copy the original libc/sysdeps/linux/common/bits/uClibc_locale.h to $PREFIX/include/bits Another bug shows up later in the compile process:
In file included from /root/tuxbox/work_uclibc2/compile/cdk/build_gcc/powerpc-tuxbox-linux-uclibc/nof/libstdc++-v3/include/csignal:49,
from /root/tuxbox/work_uclibc2/compile/cdk/gcc-3.4.6/libstdc++-v3/include/stdc++.h:42:
/root/tuxbox/work_uclibc2/image/cdk/powerpc-tuxbox-linux-uclibc/include/signal.h:372:24: ucontext.h: No such file or directory
In file included from /root/tuxbox/work_uclibc2/compile/cdk/build_gcc/powerpc-tuxbox-linux-uclibc/nof/libstdc++-v3/include/csignal:49,
from /root/tuxbox/work_uclibc2/compile/cdk/gcc-3.4.6/libstdc++-v3/include/stdc++.h:42:
/root/tuxbox/work_uclibc2/image/cdk/powerpc-tuxbox-linux-uclibc/include/signal.h:372:24: ucontext.h: No such file or directory
The reason is this patch:
http://sources.busybox.net/index.py/trunk/uClibc/Makefile.in?r1=24405&r2=24595&diff_format=h
I am compiling uClibc with UCLIBC_SUSV3_LEGACY disabled in this case.
Removing these lines from signal.h fixes the compile problem:
# ifdef __USE_XOPEN
/* This will define `ucontext_t' and `mcontext_t'. */
# include <ucontext.h>
# endif
but it may have side-effects I am not aware of.
Ok. You patched the gcc. The error happens here: +#ifdef __UCLIBC_MJN3_ONLY__ +#warning fix this... should be monetary +#endif +#ifdef __UCLIBC__ +# ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +# else + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; +# endif +#else I have no idea why this patch attempts to use uclibc internals. It is not supposed to ever do it. I will revert my "fix". Please work with patch author to stop using uclibc internals. I meant that error happens in that place in the libstdc++-v3/config/locale/uclibc/monetary_members.cc This file is created by the patch you applied to gcc tree. > I am compiling uClibc with UCLIBC_SUSV3_LEGACY disabled in this case.
Perhaps you need to enable it then
(In reply to comment #7) > Please work with patch author to stop using uclibc internals. Hi, who maintains the patch which can be found on your SVN in the buildroot section? Or in other words, will the buildroot suffer from the same problem with uClibc SVN HEAD and <= gcc-4.2.4? In regard to signal.h I reactivated UCLIBC_SUSV3_LEGACY (mainly because I am too lazy to port usleep() to nanosleep(), but thats another topic), but I think other software will suffer from the same problem, a header is included which is not present. I guess you need to talk to buildroot project: http://buildroot.uclibc.org/ http://buildroot.uclibc.org/lists.html For the record, this patch fixes the problem: http://lists.uclibc.org/pipermail/uclibc/2009-February/041918.html I know this patch will not make it into CVS, but it works;) I think that this works as expected with the 0.9.30.1 release. Note that the (c++) locale support for any supported gcc version needs a re-implementation based off generic support. This is a known TODO at the time of this writing, sensible, tested patches welcome. A clean reimplementation in gcc is in order for everything > 0.9.30. |