libstc++ and locale issue

Carmelo AMOROSO carmelo.amoroso at st.com
Wed Feb 11 17:29:56 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Folks,
following previous emails I've looked at this issue better, not it's
clearer to me and I'd like to discuss to figure out the best solution.

I've always used libstdc++ library from gcc toolchain (4.24.) with
uclibc specific pacthes taken from buildroot repository,
(http://sources.uclibc.org/index.py/trunk/buildroot/toolchain/gcc/4.2.4/)
with LOCALE enabled.

If we look at the files
gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
and
gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc

(http://sources.uclibc.org/index.py/trunk/buildroot/toolchain/gcc/4.2.4/200-uclibc-locale.patch?revision=22318&view=markup)

we can see the following lines:

+#define _LIBC
+#include <locale>
+#undef _LIBC
+#include <bits/c++locale_internal.h>

By explicitly defining _LIBC before including locale.h (and then
bits/uClibc_locale.h) it wants to make some internal definitions visible.

Indeed in bits/uClibc_locale.h there are symbols (i.e. __global_locale)
and some data structure definition (i.e. __uclibc_locale_struct) within
#ifdef _LIBC just for internal use.

Now that unifdef tool has been fixed, while building libstdc++ against
sanitised uclibc headers all of these internal symbols have disappeared
(physically deleted from the header) so defining _LIBC will not work any
more.

I can see three different solutions

1) remove the #ifdef _LIBC from within bits/uClibc_locale.h
or
2)if possible, we should not sanitise this header
or
3) change #ifdef _LIBC to something different (i.e. _LIBSTDCPP)
and change the libstdc++ to explicitly set this new macro before
including <locale>

3) it's almost identical to 1) and requires another extra change

What do you guys think about ?

Cheers,
Carmelo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkmTCxQACgkQoRq/3BrK1s824QCeKMHV5UKPnbVuZa3XFje/1X2/
Y8gAn3l3cTDAhzYUp9wBglwlOFP5KI+4
=VPVn
-----END PGP SIGNATURE-----


More information about the uClibc mailing list