[PATCH] libstdc++: implement locale support for AIX

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Wed Jun 9 14:50:35 GMT 2021


Hi Clement,

> Did anyone have time to take a look at this patch ?

I've finally manged to give it a try on sparc-sun-solaris2.11 (Solaris
11.4).  I had to apply the following additional patch, matching what you
did in config/os/aix/ctype_configure_char.cc:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sccc.patch
Type: text/x-patch
Size: 1590 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210609/77237fb6/attachment.bin>
-------------- next part --------------

For now, I'm passing --enable-clocale=xpg7 at configure time rather than
changing the default.

Results are mixed: with the previous patch, I had 29 FAILs (both 32 and
64-bit).  The number has remained the same, but the exact set of failing
patches changed:

FAIL: libstdc++-abi/abi_check
FAIL: 22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc execution test
FAIL: 22_locale/codecvt/in/wchar_t/3.cc execution test
FAIL: 22_locale/codecvt/max_length/wchar_t/4.cc execution test
FAIL: 22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc execution test
FAIL: 22_locale/codecvt/out/wchar_t/3.cc execution test
FAIL: 22_locale/collate/compare/wchar_t/2.cc execution test
FAIL: 22_locale/collate/compare/wchar_t/3.cc execution test
FAIL: 22_locale/collate/compare/wchar_t/wrapped_env.cc execution test
FAIL: 22_locale/collate/compare/wchar_t/wrapped_locale.cc execution test
FAIL: 22_locale/collate/transform/wchar_t/2.cc execution test
FAIL: 22_locale/collate/transform/wchar_t/3.cc execution test
FAIL: 22_locale/collate/transform/wchar_t/wrapped_env.cc execution test
FAIL: 22_locale/collate/transform/wchar_t/wrapped_locale.cc execution test
FAIL: 22_locale/ctype/widen/wchar_t/2.cc execution test
FAIL: 22_locale/money_get/get/wchar_t/1.cc execution test
FAIL: 22_locale/money_put/put/char/9780-3.cc execution test
FAIL: 22_locale/money_put/put/wchar_t/1.cc execution test
FAIL: 22_locale/money_put/put/wchar_t/3.cc execution test
FAIL: 22_locale/time_get/get_date/wchar_t/4.cc execution test
FAIL: 22_locale/time_put/put/char/2.cc execution test
FAIL: 22_locale/time_put/put/char/4.cc execution test
FAIL: 22_locale/time_put/put/wchar_t/2.cc execution test
FAIL: 22_locale/time_put/put/wchar_t/4.cc execution test
FAIL: 27_io/basic_filebuf/overflow/wchar_t/11305-1.cc execution test
FAIL: 27_io/basic_filebuf/overflow/wchar_t/11305-2.cc execution test
FAIL: 27_io/basic_filebuf/overflow/wchar_t/11305-3.cc execution test
FAIL: 27_io/basic_filebuf/overflow/wchar_t/11305-4.cc execution test
FAIL: 27_io/manipulators/extended/get_time/char/2.cc execution test

-FAIL: 22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc execution test

-FAIL: 22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc execution test

-FAIL: 22_locale/collate/compare/wchar_t/2.cc execution test

-FAIL: 22_locale/collate/compare/wchar_t/wrapped_env.cc execution test
-FAIL: 22_locale/collate/compare/wchar_t/wrapped_locale.cc execution test
-FAIL: 22_locale/collate/transform/wchar_t/2.cc execution test

-FAIL: 22_locale/collate/transform/wchar_t/wrapped_env.cc execution test
-FAIL: 22_locale/collate/transform/wchar_t/wrapped_locale.cc execution test
+FAIL: 22_locale/ctype/is/wchar_t/1.cc execution test
+FAIL: 22_locale/ctype/is/wchar_t/wrapped_env.cc execution test
+FAIL: 22_locale/ctype/scan/wchar_t/1.cc execution test
+FAIL: 22_locale/ctype/scan/wchar_t/wrapped_env.cc execution test

+FAIL: 22_locale/locale/cons/29217.cc execution test
+FAIL: 22_locale/locale/cons/38368.cc execution test
+FAIL: 22_locale/messages/members/char/1.cc execution test
+FAIL: 22_locale/messages_byname/named_equivalence.cc execution test

-FAIL: 22_locale/money_put/put/char/9780-3.cc execution test

-FAIL: 22_locale/time_get/get_date/wchar_t/4.cc execution test

-FAIL: 22_locale/time_put/put/char/4.cc execution test

+FAIL: 28_regex/algorithms/regex_match/ecma/wchar_t/hex.cc execution test
+FAIL: 28_regex/algorithms/regex_match/extended/wstring_locale.cc execution test
+FAIL: 28_regex/iterators/regex_token_iterator/wchar_t/wstring_02.cc execution test
+FAIL: 28_regex/traits/wchar_t/isctype.cc execution test

Just a number of comments on the patch itself:

* In a couple of places, you use uselocale, e.g. in
  config/locale/xpg7/c_locale.h.  E.g. on Solaris 11.3, this is
  missing, which is no wonder given that the OS only conforms to XPG6.
  We will either have to hardcode the clocale based on the minor/micro
  version or check for a couple of necessary XPG7 functions before
  enabling the xpg7 clocale.  However, we can cross that bridge once the
  code works on actual XPG7 systems.

* Your patch changes indentation in a couple of places
  (e.g. config/locale/xpg7/ctype_members.cc,
  config/os/aix/ctype_configure_char.cc) for no reason I can see.  This
  seems to violate the coding style.

* When I tried GCC master on FreeBSD (for the previous version of your
  patch), libstdc++ locale test results were pretty horrible, both
  without and with your patch.  If the dragonfly/xpg7 locale code has
  considerable problems even on the native system it originates from, I
  wonder if it's the best basis for the new xpg7 clocale.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Libstdc++ mailing list