From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smarthost2.atos.net (smtppost.atos.net [193.56.114.177]) by sourceware.org (Postfix) with ESMTPS id D1DBE3890406; Fri, 22 Jan 2021 09:57:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D1DBE3890406 X-IronPort-AV: E=Sophos;i="5.79,366,1602540000"; d="scan'208,217";a="155382393" X-MGA-submission: =?us-ascii?q?MDGYnqhwoHOyhxdTHTwKqT+gmdhS8O1grNXlwp?= =?us-ascii?q?wiFpcnb91RIIqVfui+BhayE/PjFPH4vJdPqt1i2P76ZAhuHOiM3q7t56?= =?us-ascii?q?bSurZ0mHFI2lQO8s+x+pyqMQszUVnIL7jx8zSYJxLzLbxEKBXxUmCwrk?= =?us-ascii?q?XL?= Received: from mail.sis.atos.net (HELO GITEXCPRDMB21.ww931.my-it-solutions.net) ([10.89.29.131]) by smarthost2.atos.net with ESMTP/TLS/AES256-GCM-SHA384; 22 Jan 2021 10:57:11 +0100 Received: from GITEXCPRDMB23.ww931.my-it-solutions.net (10.89.29.133) by GITEXCPRDMB21.ww931.my-it-solutions.net (10.89.29.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Fri, 22 Jan 2021 10:57:10 +0100 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (172.16.214.170) by GITEXCPRDMB23.ww931.my-it-solutions.net (10.89.29.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4 via Frontend Transport; Fri, 22 Jan 2021 10:57:10 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F47XsmMrqTBXuF7+8EZtoRKwtcm7cJ6YoshCI+WDLIjZcG9yK9+1wuwGiE9KkbAl8mhxkP1p5TW9VulI7YVOa3ZhelUYjJB1FkPNOk1tDmg5FFy1dhYUCaQfJpf0L6tjEMopc7SBb/k5L/0VcpjpIMY9wVUBFc4BjJ+BK7mhBR0uK1bWtjrSImMPeFeOrTXyQpQsUyG3YF48tfA+IUEv/7gEwPDczNoQA+FwEVueNCT9LwJ72WmUugS3IkF39DpJCnLs8EVEELqW8LsgWCxXMz7mLJj92IdPSzW1cyvplD5ykRDO5PPpN+T4bB+ea/ssBUWtnsGJyRIWKoXzLpzzXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ycHpL2ESjVyoftuVsn4FoAs8Rts6MeS/OEgveRKh0/Y=; b=JHqpTXAgHA+ZvnpWZ1pb6tB4G3Ry6A0cRPnAcUm8pA3ybZK9wpvdDr8WY4LLceKNpkfSg60kJfUkK4wf6RJL19IhFe/BmOoSj2oEcCbXtgRfV8ykwnRA5gzR2b37XLvMw6zENQfP6UQy1Qq9l0ev/fON7NqnFY8pmLYvklqOZi0L+jfbp126vhk6rGiSmrv3FkudWjCb5YwOSlHSPUk8M9MzhPxDcipFgSEXBsJWmf919RpkpnYDlDNlw8g33VB4Gs8rXob7+pmye3eH38YRDFxlqn/EOLIj6n97oU3WymyFGZbvzMkCmDPOH8ladEYwyXH8UsEhaiYbiuNrWGH7dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=atos.net; dmarc=pass action=none header.from=atos.net; dkim=pass header.d=atos.net; arc=none Received: from PA4PR02MB6686.eurprd02.prod.outlook.com (2603:10a6:102:ff::14) by PR3PR02MB6332.eurprd02.prod.outlook.com (2603:10a6:102:77::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.15; Fri, 22 Jan 2021 09:57:08 +0000 Received: from PA4PR02MB6686.eurprd02.prod.outlook.com ([fe80::e06c:aa84:a21d:6932]) by PA4PR02MB6686.eurprd02.prod.outlook.com ([fe80::e06c:aa84:a21d:6932%7]) with mapi id 15.20.3763.016; Fri, 22 Jan 2021 09:57:08 +0000 From: "CHIGOT, CLEMENT" To: Rainer Orth CC: libstdc++ , David Edelsohn , Jonathan Wakely , David Edelsohn via Gcc-patches Subject: Re: [PATCH] libstdc++: implement locale support for AIX Thread-Topic: [PATCH] libstdc++: implement locale support for AIX Thread-Index: AQHW5/cse5cUzOlFpUGzG3vP4ZkwbKoiheqAgAAI90CAAAGAAIAAAJC4gABu9YCAARiZb4AABceAgAAHyTOAAB5/x4AAALUAgAAlmBiAAQvegIAAApjfgAAHBSmAAAEXtYAAA1Z+gAyHwmCAAErKJoABGGUw Date: Fri, 22 Jan 2021 09:57:08 +0000 Message-ID: References: <20210111154058.GB21410@redhat.com> <20210112152505.GE21410@redhat.com> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_Enabled=True; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_SiteId=33440fc6-b7c7-412c-bb73-0e70b0198d5a; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_SetDate=2021-01-22T09:57:07.387Z; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_Name=Atos For Internal Use - All Employees; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_ContentBits=0; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_Method=Standard; x-originating-ip: [165.225.77.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d7b5e38a-4feb-47a3-2126-08d8bebc14dd x-ms-traffictypediagnostic: PR3PR02MB6332: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yOZ43rrlZ03j/mqonRTO21oIKTUnuAs3rMQ0BqV/HOTCVUoNXjIezn2q7hJRtEFhRj+l9UW+iUhlu0cMO2NZ3ppvTKcoZVMyuTfwfHmYvOHCAFx37K1FeNUnT3apfTqV7Npkks90C6zjBbitgcbMA5ItU99DBVjdAy9r9mOk9yxFluomV5g9kAoibFHHtSuYTrCTirR0AROTOcVoOeABg0Te5p8END/f0oX7T2+Dp8ru1EHaL+5CT+aqExQQMEz37KH/cW5y96IH5NuZeI6AQj/3ECMv7r34suAfzxfEBIC1c0iEuwocVQnmrZnIggI+YOoBajnFQxJQ656fIGGBK2O07Y7f4YJ/xsHQUjqKGQ3EyeemAQCo7i16YZ/BOGWnFdogTQXfQevDOIVCiI7Zrw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR02MB6686.eurprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(346002)(366004)(39860400002)(136003)(316002)(76116006)(86362001)(66946007)(478600001)(54906003)(91956017)(66556008)(66476007)(6916009)(55236004)(64756008)(71200400001)(66446008)(6506007)(19627405001)(7696005)(55016002)(5660300002)(8676002)(83380400001)(66574015)(26005)(9686003)(52536014)(186003)(33656002)(8936002)(4326008)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?iso-8859-1?Q?TpaNQ0HCZ5GrsP0hxhyiUAIgfKTlmsRhr6g/Krw+HhNDSsBNTYiBZ34XKH?= =?iso-8859-1?Q?n1YS6f09UVH9jNiDViOivCkj4MXexFLLWGD1H3X5NNc2yuJzUAsFfMReuh?= =?iso-8859-1?Q?HDpMxZh1aR3+NoYMjglwpKJ7dqXH1dOyiW2ZUxEgK6uVWXWwaXQGmc+XM9?= =?iso-8859-1?Q?q5gOItJinQTtfICA+GkEV+aRX6bq7HLMr5Kq8y0Nmel+NUOK9Fs790SgAi?= =?iso-8859-1?Q?QNqkpQB4OhckqDgFBCM550iJBqKpD/5GrY319I7DLTwMRKPoKRfMnv3sGi?= =?iso-8859-1?Q?ECe5jTM93hpbj0gbyaN8zV+14Yd2CNQVCHUT+PAJo75L3vOS67E+nJzTou?= =?iso-8859-1?Q?yS1xMS1NonGsh2i+S9uFV9GEJDmJdhUVMD+wR3cjg4i5Ym6m94K10mQqhB?= =?iso-8859-1?Q?ITAwsepX8PwGOviTeHbyKGHD8aFWaLkKX4gq0mpkr2B0M8Vj1L1rHkvOaX?= =?iso-8859-1?Q?aqoSRYyf4YMq+FJiMCbimI4f6ftpDfNku9iuwv5NBap1lXQ+cyJAId0q6o?= =?iso-8859-1?Q?cxQ9so1zwHtT3H6Mjc+0bzrj6CZ4YbHnRn+tciK2zUzOMgpRnYEObY8uNx?= =?iso-8859-1?Q?wak4MZLR3FJ9ouPlpxEF6T4pFXGykQJavllMuSjnINkI6qcLE3NmcDLd3R?= =?iso-8859-1?Q?XsbPfAjh4hLVF+Y33gWSfkHsGk6WX4wjh3Z5mzY9IWVtq8CmI/5wPw8Z9c?= =?iso-8859-1?Q?K4qdcy45phSDyT40MXYwd9tyJPG6PjcN0T9k0pVC0O0Dq6m+KdNXDjxb8d?= =?iso-8859-1?Q?mhdNcCfyTs+vt+aG9qvkRUaRtjtvFEFniWQzfFG/eWSGiFtudD4e8NN0gk?= =?iso-8859-1?Q?qd/onUHkPOZQwWW2ce5gFnUIFdDkLMrh49SBsPEWvbi8Gm6sFoOQQueoCX?= =?iso-8859-1?Q?XD3G1unnBt6wr0V94xgoPml0iMjKQeVQ/ifrGSWOUPbh/I2gLM1mL9/aH5?= =?iso-8859-1?Q?OgSx4pXpWT0AWdgBfhIhue2dvV3Ru0oifAx6Px6lg0yyZx0sfqmfjLbAj5?= =?iso-8859-1?Q?1AnK5FqwBJYUTYWy8=3D?= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PA4PR02MB6686.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7b5e38a-4feb-47a3-2126-08d8bebc14dd X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2021 09:57:08.4238 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 33440fc6-b7c7-412c-bb73-0e70b0198d5a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GVdIlm66wKl6TAz91SB5j0wqAux1uyn7h2+d6XNFERYAHDcvVkph8fPoIUSm2Pm+57Jeed7h5v7oaKLj3AIlNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR02MB6332 X-OriginatorOrg: atos.net X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_ABUSEAT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2021 09:57:20 -0000 Hi Rainer > > 3) POSIX 2017 and non-POSIX functions > > Many of the *_l functions being used in GNU or dragonfly models aren't > > POSIX 2008, but mainly POSIX 2017 or like strtof_l not POSIX at all. > > However, there are really useful in the code, thus I've made a double > > implementation based on "#ifdef HAVE_". Is it ok for you ? It's not rea= lly > > POSIX 2008 but more POSIX 2008 with 2017 compatibility. > > For the configure, I didn't find any better way to check each syscall, = as > > they all depend on different includes. Tell me if you have a better ide= a. > > First a general observation: there are two groups of functions you're > testing for: > > * Pure BSD additions, not available in either POSIX.1, ISO C, or glibc: > > localeconv_l > mbstowcs_l > strtod_l > strtof_l > strtold_l > wcsftime_l > > * Part of XPG7: > > iswctype_l > strcoll_l > strftime_l > strxfrm_l > towlower_l > towupper_l > wcscoll_l > wcsxfrm_l > wctype_l > > My suggestion would be not to have configure tests _GLIBCXX_HAVE_ > for any of the second group at all: this is ieee_1003.1-2008, after all, > so if some OS selects that clocale variant, it better implement all of > those. If really need be, one could a configure check for those and > error out if any is missing. This makes the code way more readable than > trying to handle some hypothetical partial implementation. In this case, it would be better to call it ieee_1003.1-2017 but I agree it would be better to avoid all these #ifdef. Some are still needed as for example only the last version of AIX have strftime_l. > As for the BSD group, I suggest to have one representative configure > test (for localeconv_l perhaps) and then use an appropriate name for the > group as a whole. Again, this will most likely be an all-or-nothing > thing. I'm not sure this is really all-or-nothing for these. Maybe strtof_l and ci= e can be grouped by. But the 3 others are really different. Linux have wcsfti= me_l but not the others. AIX avec none. BSD have all. > Besides, your configure tests are way too complicated: just use > AC_CHECK_FUNCS doing a link test and be done with it. Sadly, you can't pass includes to AC_CHECK_FUNCS. That's why I had to do that. I've made a first version with AC_CHECK_DECLS which allows extra headers, but it didn't work too. I might know why though. > In a similar vein, configure.ac already has > AC_CHECK_HEADERS([xlocale.h]). Rather than hardcoding the existance of > the header based on the configure triple, just use the existing > HAVE_XLOCALE_H. This ways, things will simply fall into place for > e.g. NetBSD, OpenBSD and possibly others. Right, I'll make the change. Thanks ! > > 4) ctype_configure_char.cc > > I've some troubles knowing what is supposed to be implemented on this f= ile. > > I don't really understand the part with setlocale which appears in many > > os. When I'm adding it, some tests start failing, some start working... > > Moreover, on Linux, if I understand correctly, there is some optimizati= ons > > based on classic_table(), _M_toupper and _M_tolower. Could you confirm > > that it's only useful on Linux ? > > I don't know myself. However, when trying the first version of your > patch (augmented to compile on Solaris), the corresponding change to the > solaris file made no difference in test results. I might have found the correct code since yesterday's mail. The problem see= ms to come from _M_c_locale_ctype initialization. With locale support, it must= be _S_clone_c_locale(__cloc), without it, it must be the default locale which = ends up being "C". I might push a newer patch this afternoon, with the correct code= . > > Feel free to try in on other OS. But I've made modifications only for A= IX and > > Linux, as I can test the other ones. > > While reading through the patch, I saw that in two places you still use > __DragonFly__ || __FreeBSD__ tests. For one, it's hard to tell what > feature they are really about, besides they will require fiddling with > e.g. for other BSDs. Please use a descriptive macro which says which > difference this is about. Right, because I don't know how to handle them (and I've forgotten to ask for it...). The first is for typedef __c_locale. It seems to be int* instead of locale_= t. Could you confirm that this is wanted and mandatory ? The second is in about some functions in ctype_members.cc which are defined in config/os/../ctype_inlines.h for FreeBSD and Dragonfly. Someone has to confirm that it can be merged with the new code, or if this is manda= tory. > That said, I gave the new patch a try on Solaris 11.4. To get it to > compile, I had to apply two changes that I'd mentioned (without an actual > patch) when commenting on the first patch: > > * The C99 fields of struct lconv need _LCONV_C99 to be visible for > C++11. > > * Some ctype macros need __bitmapsize =3D 15, as the generic clocale > implementation uses. If I'm not mistaking, POSIX is only defining 11 bit for ctype. If we want some optimizations we can have a define of bitmasksize or we can simply fill the whole mask by setting bitmasksize=3D15 as in generic. I don't know what's best. > Compared to the augmented first patch, there are a few differences: a > couple of failures went away and I've now > > +XPASS: 22_locale/ctype/is/wchar_t/2.cc execution test This is normal, because I need a way to check for which locale model is being used. Thanks, Cl=E9ment