This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Enabling the ieee1003.1-2001 clocale on Solaris 2 (was: RE: Solaris GCC maintainer question...)


> I've at least managed to get libstdc++-v3 to compile and link with
> --enable-clocale=iso1003.1-2001 on Solaris 10/x86.  To achieve that,
> I've shamelessly stolen from the gnu and generic locale
> implementations.  I've generally used the generic implementation
> since it lacked dependencies on glibc and was more portable, removing
> code that restricted it to the C locale.  Most of the changes should
> be obvious in that they were necessary to get the code to compile at
> all and to allow the libstdc++ testsuite to link successfully.

Sounds good.
 
> Only one change bears explanation: changing catalog from int to
> intptr_t in struct message_base was necessary to get the 64-bit
> libstdc++ to compile, otherwise I get the following failure:
> 
> In file included
> from /vol/gcc/obj/gcc-4.5.0-20090929/10-gcc-ieee_1003.1/i386-pc-solaris2.10/amd64/libstdc++-v3/include/bits/locale_facets_nonio.h:1905:0,
> from /vol/gcc/obj/gcc-4.5.0-20090929/10-gcc-ieee_1003.1/i386-pc-solaris2.10/amd64/libstdc++-v3/include/locale:43,
> from /vol/gcc/src/gcc-dist/libstdc++-v3/src/locale-inst.cc:30: /vol/gcc/obj/gcc-4.5.0-20090929/10-gcc-ieee_1003.1/i386-pc-solaris2.10/amd64/libstdc++-v3/include/i386-pc-solaris2.10/bits/messages_members.h:
> In member function 'std::messages_base::catalog
> std::messages<_CharT>::do_open(const std::basic_string<char>&, const
> std::locale&) const [with _CharT = char, std::messages_base::catalog
> =
> int]': /vol/gcc/src/gcc-dist/libstdc++-v3/src/locale-inst.cc:174:18:
> instantiated from
> here /vol/gcc/obj/gcc-4.5.0-20090929/10-gcc-ieee_1003.1/i386-pc-solaris2.10/amd64/libstdc++-v3/include/i386-pc-solaris2.10/bits/messages_members.h:54:75:
> error: cast from '_nl_catd_struct*' to 'std::messages_base::catalog'
> loses precision
> 
> Obviously an int cannot hold a 64-bit pointer.  I fear this change is
> inacceptable as is since it probably changes the libstdc++.so ABI.

Your fix is to change message_base::catalog to int_ptr. My suggestion
here is to instead change message_base::catalog to nl_catd and skip the
cast entirely.

You'll need to abstract out message_base for the various locale flavors
in a way that is not done currently for this facet (see other facets
that do this). The gnu model should stay int. 

This should be well-understood as an ABI breaking change on solaris. I
think it worthwhile.

Sound good?

> 
> Testing didn't go too well, though: even after I installed the
> necessary locales, there are many failures.  I'll upload
> libstdc++.log to bugzilla for further inspection.
> 
> * One group of failures is obvious: Solaris 2 calls the ja_JP.eucjp
> locale ja_JP.eucJP instead.  This can probably be handled by an
> appropriate define.
> 
> * Other locales used in the testsuite have no equivalent on Solaris 2
> at all: de_DE@euro, en_HK, en_PH, se_NO.UTF-8, ta_IN.  I've no idea
> what to do about them.

Punt for now?
 
> * I think that a test shouldn't FAIL if a necessary locale isn't
> installed, but be UNTESTED instead.

Seems reasonable.

> If this can all be fixed, the next step woult be to enable this
> clocale implemenatation by default on Solaris 2.  As of now, there's
> no configure code to do this.  Before, I'll have to verify when the
> functions used were introduced in Solaris 2 to avoid possibly
> breaking older releases.

Plan seems sane.

-benjamin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]