From patchwork Tue May 16 17:30:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 94847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp593004vqo; Tue, 16 May 2023 10:31:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6u3kOB7Ic6p2zn7l0xOc06mAsjRPtXhIDmV2S6dQO25WsfTI8Xj8RSppWxkQ5++sGk2UDl X-Received: by 2002:aa7:d954:0:b0:50b:c164:526c with SMTP id l20-20020aa7d954000000b0050bc164526cmr29127453eds.13.1684258299138; Tue, 16 May 2023 10:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684258299; cv=none; d=google.com; s=arc-20160816; b=vT0fgWx63Gpz4NMbwS+7x+N8LXm6WQz1/3jFnMw+DdkY+YsZaONrLx06rCQi0GGVQI ry7laEzzHaNrUqHTmkx2A6Rc9hsvFkURHD0rIGbw8mQzhw1p4wmtKFtxaXdmSsMS5DPt 5C7HdT1jIO23/7CV8CIUvEy59DAn4otsqbVeLAGnurUEerAKBvCxVeub5RbPddWLyc7A pLGswS9PULSFsT8ztUeeFzSq5JhwVXLf4ToQguCyJKixkiQJO3sepgZuX3lwU7+GhA2D DD9wo8mju3gFA/8jGIjOqcf4urqZjuWw+3L2yL9/Yd+5DLVGoe/4N85C42uZRXJEsg40 e8BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=QBw2kL4M31844waro5FvtIdXovkakxezTlNpsh7YNsk=; b=DzGw6wAbZRTuQ7vvtwZy4hqGn0Csv8JBh9ayped8dSSmBCOTbQyjf+mWIFpTYm0vGi EcJaK9JNng3RBjeJs207C+kr+db7g/GNeS5vGFZIx1GOn3yUGxAzCOoUyiSeCf8jcshR OPu2UYMJjfTfch6RnL2eIVi1iJEa5j2iKn4/a6n9IkVB6VHaE0TUqu63ZwqgZ6CsNMRE NHKvhNCKb6x0EJFNAzGcVAfNZeyuI4vjzn2zixt1QDmTghvRoB0fFqlvqC+NthAOZEIR wQ8D1vmfqI0Gd5SiEJCbkSp1qjbUzIXTW2zaqrrwJA+nJs8Y90zcTGwGxt+bnCaDPJML 3QkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=xD2tOTmE; 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=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id r12-20020aa7d58c000000b0050bc9115cacsi465773edq.293.2023.05.16.10.31.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 10:31:39 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=xD2tOTmE; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A3F383857004 for ; Tue, 16 May 2023 17:31:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3F383857004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684258285; bh=QBw2kL4M31844waro5FvtIdXovkakxezTlNpsh7YNsk=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=xD2tOTmELvfBJj7metAZLb0CzStDccFFBH1Ot3+yrDxuLC15toqSYA2M12oJm5MF7 E9JDpuDtbXBww3TxgKdYkbeahQGBvknrdV+lROQKWwwaazrW8huUUWFMjQ+cHvKiTE s4/NGutDbrexFbHY4klohYRIe+p0cHkcgprBJzf4= 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 618F93858C83 for ; Tue, 16 May 2023 17:30:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 618F93858C83 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-YtPKIjh1PBKPXpPU3yk4Qg-1; Tue, 16 May 2023 13:30:38 -0400 X-MC-Unique: YtPKIjh1PBKPXpPU3yk4Qg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3B9801C05149; Tue, 16 May 2023 17:30:38 +0000 (UTC) Received: from localhost (unknown [10.42.28.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDABD40B947; Tue, 16 May 2023 17:30:37 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Roger Sayle Subject: [PATCH] libstdc++: Disable embedded tzdata for all 16-bit targets Date: Tue, 16 May 2023 18:30:37 +0100 Message-Id: <20230516173037.1807702-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 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, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766072830087205204?= X-GMAIL-MSGID: =?utf-8?q?1766072830087205204?= Tested powerpc64le-linux. Builds OK for avr too. Roger, does this work for xstormy16? -- >8 -- libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_ZONEINFO_DIR): Extend logic for avr and msp430 to all 16-bit targets. * configure: Regenerate. --- libstdc++-v3/acinclude.m4 | 15 +++++++++------ libstdc++-v3/configure | 18 ++++++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 8129373e9dd..eb30c4f00a5 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -5426,12 +5426,15 @@ AC_DEFUN([GLIBCXX_ZONEINFO_DIR], [ zoneinfo_dir=none ;; esac - case "$host" in - avr-*-* | msp430-*-* ) embed_zoneinfo=no ;; - *) - # Also embed a copy of the tzdata.zi file as a static string. - embed_zoneinfo=yes ;; - esac + + AC_COMPUTE_INT(glibcxx_cv_at_least_32bit, [sizeof(void*) >= 4]) + if test "$glibcxx_cv_at_least_32bit" -ne 0; then + # Also embed a copy of the tzdata.zi file as a static string. + embed_zoneinfo=yes + else + # The embedded data is too large for 16-bit targets. + embed_zoneinfo=no + fi elif test "x${with_libstdcxx_zoneinfo}" = xno; then # Disable tzdb support completely. zoneinfo_dir=none diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 188be08d716..345ba5721a8 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -71903,12 +71903,18 @@ fi zoneinfo_dir=none ;; esac - case "$host" in - avr-*-* | msp430-*-* ) embed_zoneinfo=no ;; - *) - # Also embed a copy of the tzdata.zi file as a static string. - embed_zoneinfo=yes ;; - esac + + if ac_fn_c_compute_int "$LINENO" "sizeof(void*) >= 4" "glibcxx_cv_at_least_32bit" ""; then : + +fi + + if test "$glibcxx_cv_at_least_32bit" -ne 0; then + # Also embed a copy of the tzdata.zi file as a static string. + embed_zoneinfo=yes + else + # The embedded data is too large for 16-bit targets. + embed_zoneinfo=no + fi elif test "x${with_libstdcxx_zoneinfo}" = xno; then # Disable tzdb support completely. zoneinfo_dir=none