]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix libstdc++exp.a so it really does contain Filesystem TS symbols
authorJonathan Wakely <jwakely@redhat.com>
Fri, 2 Feb 2024 12:07:09 +0000 (12:07 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Sun, 4 Feb 2024 21:40:23 +0000 (21:40 +0000)
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
libstdc++-v3/src/experimental/Makefile.in
libstdc++-v3/src/filesystem/Makefile.am
libstdc++-v3/src/filesystem/Makefile.in

index 6241430988e19db99c1416413c0c154424f29f43..386e7442de4ae36d718e9b32be4f7521331dff06 100644 (file)
@@ -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
index 13a1f2af68be683a07fdd45541744ccdaea30379..f7b4ee299f3374418d1691682bf3c2aed7f2237c 100644 (file)
@@ -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 = 
index 4bdbab38660197ce9d73d3f7e983339b4d8d0f84..37cbfe1d00ee45082c70464404995fc0e720a5a6 100644 (file)
 
 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
index 852390ec1a985fa5605a41eac13bbf944556359a..76ba905087b06cbe953969c075074687aa81c4c8 100644 (file)
@@ -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 \