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 ESMTP id 01CF53990829 for ; Fri, 7 May 2021 14:27:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 01CF53990829 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-504-kFQJypKYNmeV4AXmPBK8HA-1; Fri, 07 May 2021 10:26:58 -0400 X-MC-Unique: kFQJypKYNmeV4AXmPBK8HA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2F27A80EDB7; Fri, 7 May 2021 14:26:57 +0000 (UTC) Received: from localhost (unknown [10.33.36.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7DCE5D6A1; Fri, 7 May 2021 14:26:56 +0000 (UTC) Date: Fri, 7 May 2021 15:26:55 +0100 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: [PATCH][_GLIBCXX_DEBUG] libbacktrace integration Message-ID: <20210507142655.GE3008@redhat.com> References: <20210505113337.GU3008@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210505113337.GU3008@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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, 07 May 2021 14:27:04 -0000 On 05/05/21 12:33 +0100, Jonathan Wakely wrote: >On 24/04/21 15:46 +0200, François Dumont via Libstdc++ wrote: >>Hi >> >>    Here is the patch to add backtrace generation on _GLIBCXX_DEBUG >>assertions thanks to libbacktrace. Ville pointed out that we'll need to use libbacktrace for std::stacktrace anyway, and it would be useful if/when we add support for C++ Contracts to the lirbary. So let's integrate libbacktrace into libstdc++ properly. Jakub suggested doing it how libsanitizer does it, which is to rebuild the libbacktrace sources as part of the libsanitizer build, using the preprocessor to rename the symbols so that they use reserved names. e.g. rename backtrace_full to __glibcxx_backtrace_full or something like that. I'll work on getting it building as part of libstdc++ (or maybe as a separate static library for now, as we do for libstdc++fs.a) and then you can rework your Debug Mode patch to depend on the private version of libbacktrace included with libstdc++ (instead of expecting users to provide it themselves).