public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: David Edelsohn <dje.gcc@gmail.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
	 "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	 David Edelsohn via Gcc-patches <gcc-patches@gcc.gnu.org>,
	 "CHIGOT, CLEMENT" <clement.chigot@atos.net>
Subject: Re: [PATCH] libstdc++: implement locale support for AIX
Date: Wed, 13 Jan 2021 12:57:20 +0100	[thread overview]
Message-ID: <yddft35aw2n.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <ydd1reqc4g7.fsf@CeBiTec.Uni-Bielefeld.DE> (Rainer Orth's message of "Tue, 12 Jan 2021 20:58:48 +0100")

Hi David,

>> I agree that #ifdef's are not the correct approach, but, if you enable
>> the fallbacks for Solaris, does everything then work?  Are those
>> fallbacks portable and we solely need a better mechanism to enable
>> them on platforms that require them?
>
> it mostly compiles, with two caveats:
>
> * c_locale.h needs to include <cstdlib> for declarations of strtod and
>   friends.
>
> * Solaris <locale.h> only declares the int_p_cs_precedes etc. members of
>   struct lconv for C99+, but not for C++11+, as it should.  I'll file a
>   bug for that, but for now one can work around the issue by defining
>   _LCONV_C99 before including <locale> in monetary_members.cc.
>
> With those changes, I can at least build libstdc++ with
> --enable-clocale=ieee_1003.1-2008.  Bootstrap still running, though.

while that allowed the compilation to succeed, test results are not
good:

+FAIL: libstdc++-abi/abi_check

# of added symbols:              173
# of missing symbols:            72
# of undesignated symbols:       0
# of incompatible symbols:       144

This alone makes the patch inacceptable in its present form: breaking
the libstdc++ ABI is a non-starter.  However, I suspect this can be
avoided somehow.

+FAIL: 22_locale/classification/isblank.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/classification/isblank.cc:38: void test02(): Assertion 'std::isblank(L' ', std::locale::classic())' failed.

It turns out that this is caused by ieee_1003.1-2008/ctype_members.cc
using __bitmapsize = 11 in a couple of places, unlike the generic
version which uses 15 to accomodate variations in <ctype.h> character
classifications.

Making this change lets a few tests PASS:

@@ -3354 +3354 @@
-FAIL: 22_locale/classification/isblank.cc execution test
+PASS: 22_locale/classification/isblank.cc execution test
@@ -3621 +3621 @@
-FAIL: 22_locale/ctype/is/wchar_t/1.cc execution test
+PASS: 22_locale/ctype/is/wchar_t/1.cc execution test
@@ -3655 +3655 @@
-FAIL: 22_locale/ctype/scan/wchar_t/1.cc execution test
+PASS: 22_locale/ctype/scan/wchar_t/1.cc execution test
@@ -3657 +3657 @@
-FAIL: 22_locale/ctype/scan/wchar_t/wrapped_env.cc execution test
+PASS: 22_locale/ctype/scan/wchar_t/wrapped_env.cc execution test
@@ -10864 +10864 @@
-FAIL: 28_regex/algorithms/regex_match/ecma/wchar_t/hex.cc execution test
+PASS: 28_regex/algorithms/regex_match/ecma/wchar_t/hex.cc execution test
@@ -11070 +11070 @@
-FAIL: 28_regex/traits/wchar_t/isctype.cc execution test
+PASS: 28_regex/traits/wchar_t/isctype.cc execution test

However, there are many more which I haven't even started to
investigate.  I suspect there's one (or a few) reasons immediately
obvious to someone familiar with the code.

+FAIL: 22_locale/codecvt/in/wchar_t/3.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc:118: void test03(): Assertion '!int_traits::compare(i_arr, i_lit, size)' failed.

+FAIL: 22_locale/codecvt/max_length/wchar_t/4.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc:41: void test04(): Assertion 'k == 6' failed.

+FAIL: 22_locale/codecvt/out/wchar_t/3.cc execution test

vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc:113: void test03(): Assertion 'r2 == codecvt_base::ok' failed.

+FAIL: 22_locale/collate/compare/wchar_t/3.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/3.cc:61: void test03(): Assertion 'i == -1' failed.

+FAIL: 22_locale/collate/transform/wchar_t/3.cc execution test

terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::append

+FAIL: 22_locale/ctype/is/wchar_t/1.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/1.cc:71: void test01(): Assertion 'gctype.is(std::ctype_base::punct, c40)' failed.

+FAIL: 22_locale/ctype/is/wchar_t/wrapped_env.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/1.cc:71: void test01(): Assertion 'gctype.is(std::ctype_base::punct, c40)' failed.

+FAIL: 22_locale/ctype/scan/wchar_t/1.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/1.cc:69: void test01(): Assertion 'gctype.scan_is((std::ctype_base::xdigit), (ca), (ca) + traits_type::length(ca)) == (ca)' failed.

+FAIL: 22_locale/ctype/scan/wchar_t/wrapped_env.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/1.cc:69: void test01(): Assertion 'gctype.scan_is((std::ctype_base::xdigit), (ca), (ca) + traits_type::length(ca)) == (ca)' failed.

+FAIL: 22_locale/ctype/widen/wchar_t/2.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc:39: void test02(): Assertion 'wc == static_cast<wchar_t>(0xff)' failed.

+FAIL: 22_locale/locale/cons/29217.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/locale/cons/29217.cc:33: void test01(): Assertion 'locale().name() == "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;" "LC_TIME=C;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=C;" "LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;" "LC_MEASUREMENT=C;LC_IDENTIFICATION=C"' failed.

+FAIL: 22_locale/locale/cons/38368.cc execution test

terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid

+FAIL: 22_locale/messages/members/char/1.cc execution test

vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc:52: void test01(): Assertion 's01 == "bitte"' failed.

+FAIL: 22_locale/messages_byname/named_equivalence.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/messages_byname/named_equivalence.cc:58: void test01(): Assertion 's01 == "bitte"' failed.

+FAIL: 22_locale/money_get/get/wchar_t/1.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc:115: void test01(): Assertion 'result8 == digits1' failed.

+FAIL: 22_locale/money_put/put/wchar_t/1.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc:77: void test01(): Assertion 'result4 == L"7.200.000.000,00 \x20ac"' failed.

+FAIL: 22_locale/money_put/put/wchar_t/3.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc:74: void test03(): Assertion 'result4 == L"7.200.000.000,00 \x20ac"' failed.

+FAIL: 22_locale/time_put/put/char/2.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc:49: void test02(): Assertion 'result2 == "Son" || result2 == "So"' failed.

+FAIL: 22_locale/time_put/put/wchar_t/2.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc:50: void test02(): Assertion 'result2 == L"Son" || result2 == L"So"' failed.

+FAIL: 27_io/basic_filebuf/overflow/wchar_t/11305-1.cc execution test

terminate called after throwing an instance of 'std::__ios_failure'
  what():  basic_filebuf::_M_convert_to_external conversion error: iostream error

+FAIL: 27_io/basic_filebuf/overflow/wchar_t/11305-2.cc execution test

terminate called after throwing an instance of 'std::__ios_failure'
  what():  basic_filebuf::_M_convert_to_external conversion error: iostream error

+FAIL: 27_io/basic_filebuf/overflow/wchar_t/11305-3.cc execution test

terminate called after throwing an instance of 'std::__ios_failure'
  what():  basic_filebuf::_M_convert_to_external conversion error: iostream error

+FAIL: 27_io/basic_filebuf/overflow/wchar_t/11305-4.cc execution test

terminate called after throwing an instance of 'std::__ios_failure'
  what():  basic_filebuf::_M_convert_to_external conversion error: iostream error

+FAIL: 27_io/manipulators/extended/get_time/char/2.cc execution test

vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc:41: void test01(): Assertion 'time1.tm_wday == 2' failed.

+FAIL: 28_regex/algorithms/regex_match/ecma/wchar_t/hex.cc execution test

terminate called after throwing an instance of 'std::regex_error'
  what():  Unexpected end of regex when ascii character.

+FAIL: 28_regex/algorithms/regex_match/extended/wstring_locale.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/wstring_locale.cc:43: void test01(): Assertion 'regex_match_debug(str2, m2, re2)' failed.

+FAIL: 28_regex/iterators/regex_token_iterator/wchar_t/wstring_02.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/28_regex/iterators/regex_token_iterator/wchar_t/wstring_02.cc:44: void test01(): Assertion 'p == end' failed.

+FAIL: 28_regex/traits/wchar_t/isctype.cc execution test

/vol/gcc/src/hg/master/solaris/libstdc++-v3/testsuite/28_regex/traits/wchar_t/isctype.cc:51: void test01(): Assertion 't.isctype(L' ', t.lookup_classname(range(blank)))' failed.

I've also added the locale handling changes in
config/os/aix/ctype_configure_char.cc to
config/os/solaris/ctype_configure_char.cc (ctype<char>::ctype), but that
made no difference.

	Rainer

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

  reply	other threads:[~2021-01-13 11:57 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <PA4PR02MB6686075C6C254E583B72BC2AEAAB0@PA4PR02MB6686.eurprd02.prod.outlook.com>
     [not found] ` <CAGWvny=XpcWGnyb=MWg5ziYSND7O1AnQ6-NAX811p1b5urH0YA@mail.gmail.com>
2021-01-11 15:35   ` Rainer Orth
2021-01-11 15:40     ` Jonathan Wakely
2021-01-11 15:56       ` CHIGOT, CLEMENT
2021-01-11 22:20         ` David Edelsohn
2021-01-12 15:14           ` CHIGOT, CLEMENT
2021-01-12 15:23             ` CHIGOT, CLEMENT
2021-01-12 15:25             ` Jonathan Wakely
2021-01-12 15:40               ` CHIGOT, CLEMENT
2021-01-12 15:44               ` David Edelsohn
2021-01-12 17:34                 ` Jonathan Wakely
2021-01-12 15:52               ` Rainer Orth
2021-01-12 17:41                 ` Rainer Orth
2021-01-12 17:44                   ` David Edelsohn
2021-01-12 19:58                     ` Rainer Orth
2021-01-13 11:57                       ` Rainer Orth [this message]
2021-01-13 12:23                         ` CHIGOT, CLEMENT
2021-01-13 12:31                           ` Rainer Orth
2021-01-13 12:41                             ` CHIGOT, CLEMENT
2021-01-13 12:47                               ` Rainer Orth
2021-01-21 12:48                                 ` CHIGOT, CLEMENT
2021-01-21 16:36                                   ` Rainer Orth
2021-01-22  9:57                                     ` CHIGOT, CLEMENT
2021-01-22 11:04                                       ` Rainer Orth
2021-01-22 11:29                                         ` Jonathan Wakely
2021-01-22 11:54                                           ` Rainer Orth
2021-01-22 12:23                                             ` CHIGOT, CLEMENT
2021-01-27 12:52                                               ` CHIGOT, CLEMENT
2021-01-27 14:26                                                 ` Rainer Orth
2021-01-27 14:44                                                   ` CHIGOT, CLEMENT
2021-01-28 10:09                                                     ` CHIGOT, CLEMENT
2021-05-17  9:17                                                       ` CHIGOT, CLEMENT
2021-06-08  6:59                                                         ` CHIGOT, CLEMENT
2021-06-09 14:50                                                           ` Rainer Orth
2021-07-21 12:00                                                             ` CHIGOT, CLEMENT
2021-07-21 13:04                                                               ` Rainer Orth
2021-07-22 12:09                                                                 ` CHIGOT, CLEMENT
2021-07-22 12:19                                                                   ` Rainer Orth
2021-07-30 14:02                                                                     ` CHIGOT, CLEMENT
2022-03-16  9:57                                                                       ` CHIGOT, CLEMENT
2021-01-22 11:12                                       ` Jonathan Wakely
2021-01-22 11:02                                     ` Jonathan Wakely
2021-01-12 16:00             ` Rainer Orth
     [not found]   ` <PA4PR02MB6686C2022E2B42D82DC9F269EAAB0@PA4PR02MB6686.eurprd02.prod.outlook.com>
2021-01-11 15:38     ` Rainer Orth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddft35aw2n.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=clement.chigot@atos.net \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).