From patchwork Fri Jun 28 19:25:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1954154 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TFOGgHoO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W9llt2bHrz20Xf for ; Sat, 29 Jun 2024 05:26:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D58638197EA for ; Fri, 28 Jun 2024 19:26:00 +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 15FD9381D460 for ; Fri, 28 Jun 2024 19:25:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 15FD9381D460 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 15FD9381D460 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=1719602737; cv=none; b=LMSWyEEXIo7i9F+KORRGn0h69H7HWdu3idQ4/QHXr/q3xRnABTIus9SYfFfNThrbPnsZbL2xonhOTMQSa1eC4PorupRfye64+UAGIX68T09qL9X0cWxLDvtft3uU4P0HQKe+/TeeQOugwVpU3S2Hn6p+f0wl/r4oU+pWSj0/UFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719602737; c=relaxed/simple; bh=3C80R02ujRbhwjAPn9554dDzcA8j3GN6Sv7awPQraN8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=F3qmlljIPF2t5y/QC1DoQVLSWlspzm0o2onNoNUqvJTBWmuEyfMAIlbM0WYhLsIsF4OnSYpXwB4PXSVUY0d+66y+/QNegCVS8TucM9r8V0eqfIFdOVcNzvfyvlB7L/2PQMuXYXCgdJjp6Rd13pzVogJuM4R+T5drSMNcAMGAt5Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719602734; 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=mOXKRWdqqKi0F8aPpb+jMwGKFc9Jprh7B03SuMhfSLM=; b=TFOGgHoOOFarwFTf09+mRFw+9tqzAokWxiLYUf4nPJG7B7SA1IGokmsytGaKOOfVfvsnz0 a9KUeSBalZW1Ke3cnOkhOIjMDj9tCOpJ78AbVlw6jQ6hclIpT4sgqPJG1AQ76QPpaC5v30 0BIZwsnmaZAaGWpnkfythRuAvGLpa+8= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-313-38rAYsUAPe2uLL3Zhy9j2w-1; Fri, 28 Jun 2024 15:25:31 -0400 X-MC-Unique: 38rAYsUAPe2uLL3Zhy9j2w-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 99F511956089; Fri, 28 Jun 2024 19:25:29 +0000 (UTC) Received: from localhost (unknown [10.42.28.171]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F1AE219560A3; Fri, 28 Jun 2024 19:25:28 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Define __glibcxx_assert_fail for non-verbose build [PR115585] Date: Fri, 28 Jun 2024 20:25:06 +0100 Message-ID: <20240628192527.343017-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. Pushed to trunk. Backports needed. -- >8 -- When the library is configured with --disable-libstdcxx-verbose the assertions just abort instead of calling __glibcxx_assert_fail, and so I didn't export that function for the non-verbose build. However, that option is documented to not change the library ABI, so we still need to export the symbol from the library. It could be needed by programs compiled against the headers from a verbose build. The non-verbose definition can just call abort so that it doesn't pull in I/O symbols, which are unwanted in a non-verbose build. libstdc++-v3/ChangeLog: PR libstdc++/115585 * src/c++11/assert_fail.cc (__glibcxx_assert_fail): Add definition for non-verbose builds. --- libstdc++-v3/src/c++11/assert_fail.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/src/c++11/assert_fail.cc b/libstdc++-v3/src/c++11/assert_fail.cc index 6d99c7958f3..76c8a5a5c2f 100644 --- a/libstdc++-v3/src/c++11/assert_fail.cc +++ b/libstdc++-v3/src/c++11/assert_fail.cc @@ -22,10 +22,10 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -#include // for std::fprintf, stderr #include // for std::abort #ifdef _GLIBCXX_VERBOSE_ASSERT +#include // for std::fprintf, stderr namespace std { [[__noreturn__]] @@ -41,4 +41,12 @@ namespace std abort(); } } +#else +namespace std +{ + [[__noreturn__]] + void + __glibcxx_assert_fail(const char*, int, const char*, const char*) noexcept + { abort(); } +} #endif