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.129.124]) by sourceware.org (Postfix) with ESMTPS id 75AF03858D3C for ; Thu, 18 Apr 2024 19:51:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75AF03858D3C 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 75AF03858D3C 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=1713469872; cv=none; b=v4bCLUQPqLZaH9H8j7AQg03Ltx+YRHktV3mCaB36Vmd1xBFuBMeYEZNP138hI/PQCQRfvJXNObr6JM1f7OLsT1pf72sNIZnRJjoG7LKm3vysHCnUDSVvlhKBEuCFXug23kQiRLuvkRUOuw5zCqHA+CoebfPykWTd3SPrVv7sFGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713469872; c=relaxed/simple; bh=D+V+c9Vpa5vZpfGC5MoID8tyc58+ko+ehswRPlA/pSQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZkZxdBLAF9jLaAj/VXnFSdMbuSOc9w6sqfFPULZ4asEBfS2GiSKzP5qptKZlCOSv5eY3o4ysAGldFVfsbjgKs5RbzVW/TsinKcNEB5xd7I3K64/eERHuv7o0jntNiBsmDiNxJoAsEMBJ8AW677dhCSBcOgF8khFMatQtF1uEydY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713469871; 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=y69U9hx18t32/mr/S9i9dMejRMTutWmtL84HLvhd1Q4=; b=PuhKxusfrbfEqsPAgWdgTecS3bC8MI/utmclqP6/cMeG1wffmPkGVxFgn6lLYtDf/yYd/j AmyuSSNcYQaYFpTS4v8Oc73NLATTS1b+VWWAIFB7UXSz416/dpmkkwezwE3K/0pPgh0TNB YoY4vaSqDOOtb5MQbAl5jWTxEgNTI5I= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-yPxNXDdTNvGIW0dOXTJHtg-1; Thu, 18 Apr 2024 15:51:08 -0400 X-MC-Unique: yPxNXDdTNvGIW0dOXTJHtg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 E424D3C1015F; Thu, 18 Apr 2024 19:51:07 +0000 (UTC) Received: from localhost (unknown [10.42.28.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id B356740F147; Thu, 18 Apr 2024 19:51:07 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [gcc-13 PATCH 0/2] Replace libstdc++_libbacktrace.a with libstdc++exp.a Date: Thu, 18 Apr 2024 18:29:40 +0100 Message-ID: <20240418195107.1281808-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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: The first patch is a backport from trunk to fix the fact that I messed up the change to add all symbols from libstdc++fs.a into libstdc++exp.a, which was backported as r13-8207-g17acf9fbeb10d7. The change builds libstdc++fs.a twice, once to install it and once as a convenience library to be included into libstdc++exp.a. That change already works fine on trunk, so should be fine on gcc-13 too. The second patch is not a backport but is needed for the branch to ensure that libstdc++exp.a also provides the symbols for libstdc++_libbacktrace.a but without removing libstdc++_libbacktrace.a itself. On trunk I removed it and put all its symbols in libstdc++exp.a, but on the branch we don't want to stop installing that static lib halfway through the gcc-13 release series, as it will break makefiles that are using -lstdc++_libbacktrace to get those symbols. Because libstdc++-v3/src/libbacktrace/Makefile.am is more complicated than libstdc++-v3/src/filesystem/Makefile.am and because I don't know what all the _LIBADD etc. variables do, I'm not sure exactly how to do the "build it twice, once for installation and once as a convenience library" thing. So instead what this patch does is change it to a convenience library (as is done on trunk) but then also create a symlink with the old installed name, pointing to libstdc++exp.a, so that using -lstdc++_libbacktrace still works. The symlink is created using $(LN_S) so for targets that don't support symlinks it's just a copy. One gotcha is that if you do 'make install' over a pre-existing gcc-13 installation, the new symlinks for libstdc++_libbacktrace.{a,la} won't be created, because there are already real files with those names. That won't affect users installing gcc-13.3.0 afresh, it would only affect people who've been building 13.2.1 from git or from snapshots. Apart from some errors printed to stderr (and ignored by make) it won't really matter, because the existing regular files provide the same symbols anyway. Does this look reasonable, and done correctly? Or should I bite the bullet and figure out how to properly adjust src/libbacktrace/Makefile.am to create an installable library and a convenience library in parallel? Would I need to copy every libstdc___libbacktrace_la_FOO variable to create a corresponding libstdc___libbacktraceconvenience_la_FOO variable? One advantage of the symlink approach is that we don't increase the installed footprint of gcc-13 by duplicating all the backtrace symbols in two static archives. We could even consider making libstdc++fs.a a symlink to libstdc++exp.a as well, on trunk and gcc-13, to stop duplicating those symbols. -- >8 -- Jonathan Wakely (2): libstdc++: Fix libstdc++exp.a so it really does contain Filesystem TS symbols libstdc++: Add libstdc++_libbacktrace.a to libstdc++exp libstdc++-v3/src/experimental/Makefile.am | 7 +- libstdc++-v3/src/experimental/Makefile.in | 27 ++++--- libstdc++-v3/src/filesystem/Makefile.am | 4 ++ libstdc++-v3/src/filesystem/Makefile.in | 37 ++++++++-- libstdc++-v3/src/libbacktrace/Makefile.am | 2 +- libstdc++-v3/src/libbacktrace/Makefile.in | 86 ++++------------------- 6 files changed, 73 insertions(+), 90 deletions(-) -- 2.44.0