From patchwork Thu Apr 18 17:29:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1925268 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=T+cVXqIz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4VL7hH6bsRz1yZY for ; Fri, 19 Apr 2024 05:51:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 081A1384AB5D for ; Thu, 18 Apr 2024 19:51:39 +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 8225C3858C35 for ; Thu, 18 Apr 2024 19:51:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8225C3858C35 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 8225C3858C35 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=1713469874; cv=none; b=GMlVENCtuubeO3asPCee+/FeKjptDSb2QFnuVOst/a0NhIbwTwlz3JynUw8hwwVgzuuKXiVJAqV71TsEMFczvynI5qa0wOfXK2w8PfiChBnUNo7dJTY7u2SoexJ9/dD9tsvUqV/NHqDQ75xcnQ9FnP8u6LWUleaZLRKwNkjy3iI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713469874; c=relaxed/simple; bh=XdKFlVsy9/01lzXIkSBNJ+BxsQd3f/s0jbFbQf1U9XM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mrlcNAx69HByI2CYOgC3lGHTQF/+eyRVN3uvXSZTmZrbtvYAzSLWSTAle6wYnHFhTOUiSvx7e9JycxnZb0AbyHs+rUdSqNzF/2lyZVDQC/H5SPIvjb+lz+k/1EVw5BgjuVGKsnQB/X+k77m57ctWeJyJ3Limy0i1HYe/LZ0M9d0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713469872; 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: in-reply-to:in-reply-to:references:references; bh=wKyWhBgTnCv705k25Zp620PgQm5KmxdSSN2ApgpOAZw=; b=T+cVXqIzYPaNnynreToiLH2d4eSxLqpVWtJjUV351mvYKcT72BI486cl8RAEugxMEaXsas tX+Bie1vO3FrZ67TncArqJglOYCZMY9gdpB0aaOixiwsoqXV5O4LCiT0sXR8bqdEbXCtA8 K2Odrp4emSx0WMqWktglChTyL2lL9Wg= 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-481-DLmjCJfFO6ulib69KxRIWw-1; Thu, 18 Apr 2024 15:51:08 -0400 X-MC-Unique: DLmjCJfFO6ulib69KxRIWw-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 A5628286A9D0; Thu, 18 Apr 2024 19:51:08 +0000 (UTC) Received: from localhost (unknown [10.42.28.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74E562031A45; Thu, 18 Apr 2024 19:51:08 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [gcc-13 PATCH 1/2] libstdc++: Fix libstdc++exp.a so it really does contain Filesystem TS symbols Date: Thu, 18 Apr 2024 18:29:41 +0100 Message-ID: <20240418195107.1281808-2-jwakely@redhat.com> In-Reply-To: <20240418195107.1281808-1-jwakely@redhat.com> References: <20240418195107.1281808-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.1 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_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 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. (cherry picked from commit abf40d2953639534af3428424f467adf3cb52177) --- 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 1c7cea7e846..c5a38d882c2 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/experimental/Makefile.in b/libstdc++-v3/src/experimental/Makefile.in index 6f6b742c1cf..c16083a7fc8 100644 --- a/libstdc++-v3/src/experimental/Makefile.in +++ b/libstdc++-v3/src/experimental/Makefile.in @@ -148,7 +148,7 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) -@ENABLE_FILESYSTEM_TS_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/src/filesystem/libstdc++fs.la +@ENABLE_FILESYSTEM_TS_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/src/filesystem/libstdc++fsconvenience.la @ENABLE_BACKTRACE_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/src/libbacktrace/libstdc++_libbacktrace.la am__objects_1 = contract.lo am_libstdc__exp_la_OBJECTS = $(am__objects_1) @@ -450,7 +450,7 @@ WARN_CXXFLAGS = \ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS) toolexeclib_LTLIBRARIES = libstdc++exp.la @ENABLE_FILESYSTEM_TS_FALSE@filesystem_lib = -@ENABLE_FILESYSTEM_TS_TRUE@filesystem_lib = $(top_builddir)/src/filesystem/libstdc++fs.la +@ENABLE_FILESYSTEM_TS_TRUE@filesystem_lib = $(top_builddir)/src/filesystem/libstdc++fsconvenience.la @ENABLE_BACKTRACE_FALSE@backtrace_lib = @ENABLE_BACKTRACE_TRUE@backtrace_lib = $(top_builddir)/src/libbacktrace/libstdc++_libbacktrace.la headers = diff --git a/libstdc++-v3/src/filesystem/Makefile.am b/libstdc++-v3/src/filesystem/Makefile.am index d2e1fde3f13..55f309b5c15 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 diff --git a/libstdc++-v3/src/filesystem/Makefile.in b/libstdc++-v3/src/filesystem/Makefile.in index 852390ec1a9..76ba905087b 100644 --- a/libstdc++-v3/src/filesystem/Makefile.in +++ b/libstdc++-v3/src/filesystem/Makefile.in @@ -147,7 +147,7 @@ am__uninstall_files_from_dir = { \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(toolexeclibdir)" -LTLIBRARIES = $(toolexeclib_LTLIBRARIES) +LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) libstdc__fs_la_LIBADD = @ENABLE_DUAL_ABI_TRUE@am__objects_1 = cow-dir.lo cow-ops.lo \ @ENABLE_DUAL_ABI_TRUE@ cow-path.lo @@ -158,6 +158,10 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +libstdc__fsconvenience_la_LIBADD = +am_libstdc__fsconvenience_la_OBJECTS = $(am__objects_2) +libstdc__fsconvenience_la_OBJECTS = \ + $(am_libstdc__fsconvenience_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -184,7 +188,8 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = -SOURCES = $(libstdc__fs_la_SOURCES) +SOURCES = $(libstdc__fs_la_SOURCES) \ + $(libstdc__fsconvenience_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -449,7 +454,11 @@ WARN_CXXFLAGS = \ # -I/-D flags to pass when compiling. AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS) + +# 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 = @ENABLE_DUAL_ABI_FALSE@cxx11_abi_sources = @ENABLE_DUAL_ABI_TRUE@cxx11_abi_sources = \ @@ -466,6 +475,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 @@ -565,6 +575,17 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ @@ -603,6 +624,9 @@ clean-toolexeclibLTLIBRARIES: libstdc++fs.la: $(libstdc__fs_la_OBJECTS) $(libstdc__fs_la_DEPENDENCIES) $(EXTRA_libstdc__fs_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) -rpath $(toolexeclibdir) $(libstdc__fs_la_OBJECTS) $(libstdc__fs_la_LIBADD) $(LIBS) +libstdc++fsconvenience.la: $(libstdc__fsconvenience_la_OBJECTS) $(libstdc__fsconvenience_la_DEPENDENCIES) $(EXTRA_libstdc__fsconvenience_la_DEPENDENCIES) + $(AM_V_CXXLD)$(CXXLINK) $(libstdc__fsconvenience_la_OBJECTS) $(libstdc__fsconvenience_la_LIBADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -715,8 +739,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-toolexeclibLTLIBRARIES \ - mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-toolexeclibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -785,8 +809,9 @@ uninstall-am: uninstall-toolexeclibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-toolexeclibLTLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ + clean-libtool clean-noinstLTLIBRARIES \ + clean-toolexeclibLTLIBRARIES cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \