Message ID | 20240130150216.1790473-1-jwakely@redhat.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1286058dyb; Tue, 30 Jan 2024 07:10:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFf/s4EOx3lcuxNkFGfMn3at/OjLKNLekyNhMjGqoUqVyBH2XkW+IdNNAURyJALCKO0u6Qh X-Received: by 2002:a05:622a:1748:b0:42a:a166:16a with SMTP id l8-20020a05622a174800b0042aa166016amr5657277qtk.52.1706627423976; Tue, 30 Jan 2024 07:10:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706627423; cv=pass; d=google.com; s=arc-20160816; b=oOD+0c0ri/MqjM5ExG0BnZW3Aag9rk85dztN3+p+lnm8/tLzwEAgad0UzwnVmokdPH 9TYRp+O4EYITbyf6gcUP9c+Z4M+bB7mF33Xn4//2gxm1Bwpb/T9+ytqFv/94mjpqgYLh 4EMcw6QQYKNBxMwguwBVAwqA8///wq4L+z1WJgoOXdP/WAp0OJcp2UDmW2yRNQ1U+6hY /m3xlH+J7usd+ErOKAVrlV0Cks+9EQ5RZzFKVeN7n2csl3Qz1t2yETHn4iHocnO6eqCz jqQno8+7tWwxt6AL6GdbwzEeh5Gj2eYEympAoxuD3DJESbvc9YFV4/oIUrA+HQxr2LEV /vzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Hu4yvTAjWNrRnXO9/0RjS5vXB3r7e7BooL19+t/3EnU=; fh=5d+reY3bAznjr66z+qmva2wrxGtgagPiaFlBRfF5mOA=; b=qiK2edQfNuzEo5EhpywxppTB6uFKR/UAhBo9dZYoPYpwPTOkuUcyrZqiaezJUink2K oPMDX1z3AKMeQy4ccptDkvEpj74mSM+3AiUK+WSHsB4rq7YsoEUEwfwC192afD0IzrhY fobhmm90zL3LDSZnPCmSFA/Tv1LFyEgbgWY8vxxzVw1QVgN2YthJKOavzXpS8COZjIS7 APROFZVkGB/rqc6t4iu+Ms7i5VBOpBF37OFBe8875IV5xN60Hxw3VJRvjCsdpp91fLjL F9Xx6AO1ncSqMDk5gXO1A7VKoEmfUnqwVwtzDXKszPOe45Dg17ohIz5FuCN5apw/lNjL 8eBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LrsJAUl7; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id z21-20020a05622a029500b0042aa8c7b492si4026943qtw.484.2024.01.30.07.10.23 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 07:10:23 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LrsJAUl7; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C0C863857728 for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 15:03:20 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CAF2B3858407 for <gcc-patches@gcc.gnu.org>; Tue, 30 Jan 2024 15:02:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CAF2B3858407 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CAF2B3858407 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706626943; cv=none; b=AvGko7DTBZmkaoUpdfalpwrw5OAKJgGWQv42fuBUZvfhyx+L1SiQBTsKx2ZLS26CeBVG5iOHBUOr2RQjxMgdV11XApKxg2XOILIOOit9p0l7QD3Z1p1kFcorF7BR76DoCqIDJ+1aLN3VGNSyrhhwooLyq9CTZlLzHoQtP2MyqxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706626943; c=relaxed/simple; bh=uoLa6KmD9NpgsSl2h8zW0tan6alCJopIBgJXLDYozWQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qQOcTOFfQyU4ayoSWd1Ru1yOCsG5LyA/iOtcROtry9vjuSHUWvl+IHhRLDboPT6c6gFMVrj6MPiRMVLbGhWIxd0E4kEkseAk0Vws165ET8D/IIXHPGN/E+wMiF28Z0WLK/cweBQKnNTALYFjUD7Hod0i+9UfgRn8uaewBzCK1KA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706626941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hu4yvTAjWNrRnXO9/0RjS5vXB3r7e7BooL19+t/3EnU=; b=LrsJAUl77aLvaCKVgAoZcs2TL3e6Ylz5EScAgJpEZ85KXdCnyIVq6emFbqpMT06mmHoaVX TGKnletcTArb9Hb/eMVRHGtvgNPbgkZ+17zhc9qIoQpQLT2hF8m44AkIBOFpa420aOU0JV j/e15gINzOeTIe81HfrY4heAv5iIl4s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-605-3DfAe33TPRG-Pc22lO8zRA-1; Tue, 30 Jan 2024 10:02:17 -0500 X-MC-Unique: 3DfAe33TPRG-Pc22lO8zRA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C9DE85970A; Tue, 30 Jan 2024 15:02:17 +0000 (UTC) Received: from localhost (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB00BC0FDCA; Tue, 30 Jan 2024 15:02:16 +0000 (UTC) From: Jonathan Wakely <jwakely@redhat.com> To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Iain Sandoe <idsandoe@googlemail.com> Subject: [PATCH] libstdc++: Enable std::text_encoding for darwin and FreeBSD Date: Tue, 30 Jan 2024 15:02:04 +0000 Message-ID: <20240130150216.1790473-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789528557620161496 X-GMAIL-MSGID: 1789528557620161496 |
Series |
libstdc++: Enable std::text_encoding for darwin and FreeBSD
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jonathan Wakely
Jan. 30, 2024, 3:02 p.m. UTC
This should fix the std/text_encoding/* FAILs that Iain sees on darwin. I assume it will make it work for FreeBSD too. I won't push this until I hear it works for at least one of those. Tested x86_64-linux. -- >8 -- The <xlocale.h> header is needed for newlocale and locale_t on these targets. libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_CHECK_TEXT_ENCODING): Use <xlocale.h> if needed for newlocale. * configure: Regenerate. * src/c++26/text_encoding.cc: Use <xlocale.h>. --- libstdc++-v3/acinclude.m4 | 3 +++ libstdc++-v3/configure | 3 +++ libstdc++-v3/src/c++26/text_encoding.cc | 3 +++ 3 files changed, 9 insertions(+)
Comments
Hi Jonathan, > On 30 Jan 2024, at 15:02, Jonathan Wakely <jwakely@redhat.com> wrote: > > This should fix the std/text_encoding/* FAILs that Iain sees on darwin. > I assume it will make it work for FreeBSD too. > > I won't push this until I hear it works for at least one of those. It works on x86_64-darwin{19,21,23} and on a cross to powerpc-darwin9. The header is present on all versions we currently support (although I did not yet test more widely than noted above). As discussed on IRC, Darwin is qualified to Posix 2003 (and does not, generally, have all the optional parts), so we do not expect the symbols to be present in locale.h (even with some _XOPEN_SOURCE= value). thanks for taking care of this, Iain > > Tested x86_64-linux. > > -- >8 -- > > The <xlocale.h> header is needed for newlocale and locale_t on these > targets. > > libstdc++-v3/ChangeLog: > > * acinclude.m4 (GLIBCXX_CHECK_TEXT_ENCODING): Use <xlocale.h> if > needed for newlocale. > * configure: Regenerate. > * src/c++26/text_encoding.cc: Use <xlocale.h>. > --- > libstdc++-v3/acinclude.m4 | 3 +++ > libstdc++-v3/configure | 3 +++ > libstdc++-v3/src/c++26/text_encoding.cc | 3 +++ > 3 files changed, 9 insertions(+) > > diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 > index f9ba7ef744b..f72bd0f45b8 100644 > --- a/libstdc++-v3/acinclude.m4 > +++ b/libstdc++-v3/acinclude.m4 > @@ -5834,6 +5834,9 @@ AC_LANG_SAVE > AC_MSG_CHECKING([whether nl_langinfo_l is defined in <langinfo.h>]) > AC_TRY_COMPILE([ > #include <locale.h> > + #if __has_include(<xlocale.h>) > + # include <xlocale.h> > + #endif > #include <langinfo.h> > ],[ > locale_t loc = newlocale(LC_ALL_MASK, "", (locale_t)0); > diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure > index 65ce679f1bd..f4bc0486768 100755 > --- a/libstdc++-v3/configure > +++ b/libstdc++-v3/configure > @@ -54533,6 +54533,9 @@ $as_echo_n "checking whether nl_langinfo_l is defined in <langinfo.h>... " >&6; > /* end confdefs.h. */ > > #include <locale.h> > + #if __has_include(<xlocale.h>) > + # include <xlocale.h> > + #endif > #include <langinfo.h> > > int > diff --git a/libstdc++-v3/src/c++26/text_encoding.cc b/libstdc++-v3/src/c++26/text_encoding.cc > index 33c6c07820c..b9a50ef1a00 100644 > --- a/libstdc++-v3/src/c++26/text_encoding.cc > +++ b/libstdc++-v3/src/c++26/text_encoding.cc > @@ -27,6 +27,9 @@ > > #ifdef _GLIBCXX_USE_NL_LANGINFO_L > #include <locale.h> > +#if __has_include(<xlocale.h>) > +# include <xlocale.h> > +#endif > #include <langinfo.h> > > #if __CHAR_BIT__ == 8 > -- > 2.43.0 >
On Wed, 31 Jan 2024 at 09:38, Iain Sandoe wrote: > > Hi Jonathan, > > > On 30 Jan 2024, at 15:02, Jonathan Wakely <jwakely@redhat.com> wrote: > > > > This should fix the std/text_encoding/* FAILs that Iain sees on darwin. > > I assume it will make it work for FreeBSD too. > > > > I won't push this until I hear it works for at least one of those. > > It works on x86_64-darwin{19,21,23} and on a cross to powerpc-darwin9. > The header is present on all versions we currently support (although I did not yet > test more widely than noted above). > > As discussed on IRC, Darwin is qualified to Posix 2003 (and does not, generally, > have all the optional parts), so we do not expect the symbols to be present in > locale.h (even with some _XOPEN_SOURCE= value). OK, thanks for the checks. I've pushed it now.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index f9ba7ef744b..f72bd0f45b8 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -5834,6 +5834,9 @@ AC_LANG_SAVE AC_MSG_CHECKING([whether nl_langinfo_l is defined in <langinfo.h>]) AC_TRY_COMPILE([ #include <locale.h> + #if __has_include(<xlocale.h>) + # include <xlocale.h> + #endif #include <langinfo.h> ],[ locale_t loc = newlocale(LC_ALL_MASK, "", (locale_t)0); diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 65ce679f1bd..f4bc0486768 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -54533,6 +54533,9 @@ $as_echo_n "checking whether nl_langinfo_l is defined in <langinfo.h>... " >&6; /* end confdefs.h. */ #include <locale.h> + #if __has_include(<xlocale.h>) + # include <xlocale.h> + #endif #include <langinfo.h> int diff --git a/libstdc++-v3/src/c++26/text_encoding.cc b/libstdc++-v3/src/c++26/text_encoding.cc index 33c6c07820c..b9a50ef1a00 100644 --- a/libstdc++-v3/src/c++26/text_encoding.cc +++ b/libstdc++-v3/src/c++26/text_encoding.cc @@ -27,6 +27,9 @@ #ifdef _GLIBCXX_USE_NL_LANGINFO_L #include <locale.h> +#if __has_include(<xlocale.h>) +# include <xlocale.h> +#endif #include <langinfo.h> #if __CHAR_BIT__ == 8