From patchwork Fri Feb 2 12:14:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 195845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp388359dyc; Fri, 2 Feb 2024 04:24:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeG27TtACwvpxOV9gFlsTHoTmxeuhTawoDoLJYzwQ824kZhAZmlDZUFeJ79uQqke9iDRPE X-Received: by 2002:ad4:5963:0:b0:68c:6380:774a with SMTP id eq3-20020ad45963000000b0068c6380774amr7004676qvb.51.1706876696377; Fri, 02 Feb 2024 04:24:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706876696; cv=pass; d=google.com; s=arc-20160816; b=x6cHFPjKS1qomFGIo/mwIoMYbNwZ2lbLCPjgaLAQ7pUauqkz5j6nWdXATzXDHeQuBx 2O7MItFZrFStjlzFCfLNEpRkq5+IXXLK2dPgLVSeFPR8dCtMkyIxOBZzsm2jk+xEiO9t zorFugAh5vsrQhUhsRMPVLfbT1RyMxAeRm5ld/j0VDdEtXhkxVHzhSf8wEGpEHfW0kBf ierRjzlTmMt2AIe+On+qc7llyXnACbyrFCeJI4qzx2fttjWBzR+XLS57p15KCKIYU/Fl dVFXh+saTzgRkEzw6tXJpmOJ6QNPJWbVU3nCGtceyOxLEnkbmlbFiSrIITZkkqQkFhqe 4Rbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=8GmO/YD2xt7cY72dsu6R4h3EZfZKpXAwUQqRuYcmIUU=; fh=Pi6yjIZfwXib1NUI/nZY2rkgPAtp0J5EjQ707o0lki0=; b=aWkkP52jUVFQi28r3Dju+uezuxpwKFsw6jsSmAvTmAfCqQUx46oZxMq9rFCTlpoMum lvFOCqfhNGPHh9J1pPEMY/urhnW40W3IPGWNY7bs+JKKogUv1FKSO+8KQVsMzfvUj19M JogTCjFlD1BkmWAdiXhF5tqNEPOdYtQ9clIe9GnJHPaiHPpy7vCPdh2l7KHvNPl/0+uW tFRv0a4tApov3sDamD6Mf5bTWjF8HQei9me13GtIRBKM/c4I1BF8B6L2bBGnokkXQxaX /du1xH3AugU08BYlKJFh511LDglDVH2eSrVRnsw1uhD5+A/FTz075+IRtd0P+/vDCZ/M AAsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BYZk5V3J; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCWnmDa9bUWgm7Nvhd+WC0l2wZ1f3rj+IhRCvAQD0CRpuI7JDuh0esWUB/Y8hWRqrO8FMWD5axSjiZJrb0ZF9xNxmKLFFw== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n8-20020a0ce948000000b0068c78db0ea4si1794391qvo.609.2024.02.02.04.24.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 04:24:56 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BYZk5V3J; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 077BC385802F for ; Fri, 2 Feb 2024 12:24:56 +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 3E8523857C43 for ; Fri, 2 Feb 2024 12:23:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3E8523857C43 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 3E8523857C43 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=1706876611; cv=none; b=ZNaUaJmqlN9vgN4sAqFg7tTI/7xAnQPHN9+9+xQJMqd1/DCT64WpWs4XeZ8k3HNL0cOxMs2Ku9YGJI61sgVAs8FAqCM/WITbtmSNx9FA7lxZ6R+M57tBHeda+trfpQkScpVAzLoMkkjdSBA1lVKCNmh6Gz1yWNUJChhclAlkqU0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706876611; c=relaxed/simple; bh=odvAism9k7OThR95pVukW/UjTaraQl635RH1DApyspc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jXLIeFjEaGNf+xqycJSuZ8Z/z19QoxMDLLJayGsZVAhc++0nfJJwWw0QU+yBxYU4Wn52Y7GcECQ/ckczH6Cm1aGX7CXXIBQ8vOb0eP5sSZto9dVh4S3efue+pob6NUum0RzvZk9jWJcBQy+YJej6RKERc2l6PMZl+OydF/LgHZY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706876610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8GmO/YD2xt7cY72dsu6R4h3EZfZKpXAwUQqRuYcmIUU=; b=BYZk5V3JXKUkrQj7gFEGn74kamx1TWO0qropEs3fUIOlUcXnUjLVH/YN/9XDhpTHB62i51 FLFbCvl3087VLYvF1AJ9ZB0bOdkdQiPOPQr9uG3upmYM15ch7UBDBPO6ytyJQIQytTOIes 4Aq+avYSClcTodfG4SEJFIOCHcY51y8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-147-UgBYBNf8NQOFxu-yu1KTrQ-1; Fri, 02 Feb 2024 07:23:26 -0500 X-MC-Unique: UgBYBNf8NQOFxu-yu1KTrQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 996B985A58F; Fri, 2 Feb 2024 12:23:26 +0000 (UTC) Received: from localhost (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61F892026D66; Fri, 2 Feb 2024 12:23:26 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Matthias Klose Subject: [PATCH] libstdc++: Fix libstdc++exp.a so it really does contain Filesystem TS symbols Date: Fri, 2 Feb 2024 12:14:21 +0000 Message-ID: <20240202122321.2273360-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.0 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, T_SCC_BODY_TEXT_LINE 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789789938950400268 X-GMAIL-MSGID: 1789789938950400268 This should fix the problem that libstdc++exp.a doesn't actually contain the symbols from libstdc++fs.a, despite me claiming it did. This increases the size of libstdc++exp.a considerably, because now it really does contain what I intended it to contain. We might be able to avoid that increased on-disk footprint by replacing the installed version of libstdc++fs.a with a linker script that does INPUT(-lstdc++exp.a) but for now duplicating things seems OK. Vendors can replace libstdc++fs.a with a linker script if they want to. This needs to be backported too, because on the gcc-13 branch both libstdc++fs.a _and_ libstdc++_libbacktrace.a are installed, so libtool ignores them both and libstdc++exp.a only contains the contract violation handler. That makes r13-8207-g17acf9fbeb10d7 completely useless until this fix gets backported. -- >8 -- In r14-3812-gb96b554592c5cb I claimed that libstdc++exp.a now contains all the symbols from libstdc++fs.a as well as libstdc++_libbacktrace.a, but that wasn't true. Only the symbols from the latter were added to libstdc++exp.a, the Filesystem TS ones weren't. This seems to be because libtool won't combine static libs that are going to be installed separately. Because libstdc++fs.a is still installed, libtool decides it shouldn't be included in libstdc++exp.a. The solution is similar to what we already do for libsupc++.a: build two static libs, libstdc++fs.a and libstdc++fsconvenience.a, where the former is installed and the latter isn't. If we then tell libtool to include the latter in libstdc++exp.a it will do as it's told. libstdc++-v3/ChangeLog: * src/experimental/Makefile.am: Use libstdc++fsconvenience.a instead of libstdc++fs.a. * src/experimental/Makefile.in: Regenerate. * src/filesystem/Makefile.am: Build libstdc++fsconvenience.a as well. * src/filesystem/Makefile.in: Regenerate. --- libstdc++-v3/src/experimental/Makefile.am | 2 +- libstdc++-v3/src/experimental/Makefile.in | 4 +-- libstdc++-v3/src/filesystem/Makefile.am | 4 +++ libstdc++-v3/src/filesystem/Makefile.in | 37 +++++++++++++++++++---- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/libstdc++-v3/src/experimental/Makefile.am b/libstdc++-v3/src/experimental/Makefile.am index 6241430988e..386e7442de4 100644 --- a/libstdc++-v3/src/experimental/Makefile.am +++ b/libstdc++-v3/src/experimental/Makefile.am @@ -25,7 +25,7 @@ include $(top_srcdir)/fragment.am toolexeclib_LTLIBRARIES = libstdc++exp.la if ENABLE_FILESYSTEM_TS -filesystem_lib = $(top_builddir)/src/filesystem/libstdc++fs.la +filesystem_lib = $(top_builddir)/src/filesystem/libstdc++fsconvenience.la else filesystem_lib = endif diff --git a/libstdc++-v3/src/filesystem/Makefile.am b/libstdc++-v3/src/filesystem/Makefile.am index 4bdbab38660..37cbfe1d00e 100644 --- a/libstdc++-v3/src/filesystem/Makefile.am +++ b/libstdc++-v3/src/filesystem/Makefile.am @@ -22,7 +22,10 @@ include $(top_srcdir)/fragment.am +# Separate libstdc++fs.a to be installed. toolexeclib_LTLIBRARIES = libstdc++fs.la +# Duplicate lib that is to be part of libstdc++exp.a +noinst_LTLIBRARIES = libstdc++fsconvenience.la headers = @@ -44,6 +47,7 @@ sources = \ # vpath % $(top_srcdir)/src/filesystem libstdc__fs_la_SOURCES = $(sources) +libstdc__fsconvenience_la_SOURCES = $(sources) # AM_CXXFLAGS needs to be in each subdirectory so that it can be # modified in a per-library or per-sub-library way. Need to manually