From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E33473858D1E for ; Fri, 23 Dec 2022 13:47:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E33473858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671803240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yk0KQrVwH/n7WD5XtVYs/6w4wKnbNNL/vSYaNygsJJY=; b=VqgBshv+POCfboSVTCAsfWtdBvjl9kIb3QGv1Zq9S8rucf31cx7Xn5GVHWw8cHDMAfIjZG CETE0iCg+foBUel2zHBo+XE4RfXckj7+ZyBzordAnggOm6/r5NFRXlmUi9j2/xT5QHgcFO q/siFuprNEqnAqrveFrq7+ay31Ur5Us= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-198-sDMzVJgzOqKqhy0PO5e72w-1; Fri, 23 Dec 2022 08:47:18 -0500 X-MC-Unique: sDMzVJgzOqKqhy0PO5e72w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 69F531871D97; Fri, 23 Dec 2022 13:47:18 +0000 (UTC) Received: from localhost (unknown [10.33.36.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CE04111F3BB; Fri, 23 Dec 2022 13:47:18 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix Darwin bootstrap error in src/c++20/tzdb.cc Date: Fri, 23 Dec 2022 13:47:17 +0000 Message-Id: <20221223134717.852611-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 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_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: A fix for another bootstrap error caused by yesterday's C++20 time zone commit, for macOS this time. I have only tested on x86_64-linux but Iain confirmed this works for his darwin testers. Pushed to trunk. -- >8 -- Mach-O requires weak symbols to have a definition, so add a default implementation of __gnu_cxx::zoneinfo_dir_override. libstdc++-v3/ChangeLog: * src/c++20/tzdb.cc [__APPLE__] (zoneinfo_dir_override): Add definition. --- libstdc++-v3/src/c++20/tzdb.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/src/c++20/tzdb.cc b/libstdc++-v3/src/c++20/tzdb.cc index a02bcd4aec7..5f5c4199f65 100644 --- a/libstdc++-v3/src/c++20/tzdb.cc +++ b/libstdc++-v3/src/c++20/tzdb.cc @@ -52,6 +52,10 @@ # endif #endif +#ifndef _GLIBCXX_ZONEINFO_DIR +# define _GLIBCXX_ZONEINFO_DIR "/usr/share/zoneinfo" +#endif + namespace __gnu_cxx { #ifdef _AIX @@ -59,6 +63,12 @@ namespace __gnu_cxx const char* (*zoneinfo_dir_override)() = nullptr; #else [[gnu::weak]] const char* zoneinfo_dir_override(); + +#ifdef __APPLE__ + // Need a weak definition for Mach-O. + [[gnu::weak]] const char* zoneinfo_dir_override() + { return _GLIBCXX_ZONEINFO_DIR; } +#endif #endif } @@ -934,9 +944,6 @@ namespace std::chrono return info; } -#ifndef _GLIBCXX_ZONEINFO_DIR -# define _GLIBCXX_ZONEINFO_DIR "/usr/share/zoneinfo" -#endif namespace { string -- 2.38.1