https://bugs.gentoo.org/767706 https://gcc.gnu.org/PR99172 From c2be82058fb40f3ae891c68d185ff53e07f14f45 Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Fri, 12 Mar 2021 07:34:36 -0800 Subject: [PATCH] libstdc++-v3: Update VTV vars for libtool link commands [PR99172] This fixes PR 99172 Currently when GCC is configured with --enable-vtable-verify, the libstdc++-v3 Makefiles add "-fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end" to libtool link commands. The "-fvtable-verify=std" piece causes alternate versions of libtool (such as slibtool) to fail, unable to find "-lvtv" (GNU libtool just removes that piece). This patch updates the libstdc++-v3 Makefiles to not pass "-fvtable-verify=std" to the libtool link commands. --- libstdc++-v3/src/Makefile.am | 4 +++- libstdc++-v3/src/Makefile.in | 3 ++- --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -214,12 +214,14 @@ compatibility-condvar.o: compatibility-condvar.cc # set this option because CONFIG_CXXFLAGS has to be after # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden # as the occasion calls for it. -AM_CXXFLAGS = \ +AM_CXXFLAGS_PRE = \ -std=gnu++98 \ $(glibcxx_compiler_pic_flag) \ $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \ $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) +AM_CXXFLAGS = $(filter-out -fvtable-verify=std,$(AM_CXXFLAGS_PRE)) + # Libtool notes # 1) In general, libtool expects an argument such as `--tag=CXX' when --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -578,12 +578,13 @@ libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags) # set this option because CONFIG_CXXFLAGS has to be after # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden # as the occasion calls for it. -AM_CXXFLAGS = \ +AM_CXXFLAGS_PRE = \ -std=gnu++98 \ $(glibcxx_compiler_pic_flag) \ $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \ $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) +AM_CXXFLAGS = $(filter-out -fvtable-verify=std,$(AM_CXXFLAGS_PRE)) # Libtool notes -- 2.30.2