tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: remove compat symbols from libstdc++



Christos Zoulas writes:
> 
> It is pointless to keep the @GLIBCXX_X.Y libstdc++ symbols since we
> bump each version and our numbering scheme is not following theirs.
> I propose we apply the following patch (and not bump from 9, since
> nothing uses these symbols).
> 
> Note that the first patch is needed because the standard code is
> relying on the compat versions... I guess this is what happens if
> you don't test building without the compat versions...
> 
> This has the nice side effect that it fixes static linking issues
> present because the version resolution does not work properly with
> static libraries and you get errors like:
> 
> ld: libtest.so: version node not found for symbol _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv@GLIBCXX_3.4
> 
> Opinions?

this does not match what upstream GCC 7 does, so i'm more inclined
to think we have something else wrong than adopting your change.

eg, i see this on netbsd-8 host:

> nm /usr/pkg/gcc7/lib/libstdc++.a | grep compat
compatibility.o:
compatibility-debug_list.o:
compatibility-debug_list-2.o:
compatibility-c++0x.o:
compatibility-atomic-c++0x.o:
compatibility-thread-c++0x.o:
compatibility-chrono.o:
compatibility-condvar.o:
0000000000000000 t execute_native_thread_routine_compat

so it sure seems like they're expected to exist.  i think the patch
has a missing part, too -- libsupc++/Makefile probably would want
the same edit otherwise it will include these?


.mrg.

> christos
> 
> Index: dist/libstdc++-v3/src/c++98/istream.cc
> ===================================================================
> RCS file: /cvsroot/src/external/gpl3/gcc/dist/libstdc++-v3/src/c++98/istream.cc,v
> retrieving revision 1.1.1.4
> diff -u -u -r1.1.1.4 istream.cc
> --- dist/libstdc++-v3/src/c++98/istream.cc	19 Jan 2019 10:14:04 -0000	1.1.1.4
> +++ dist/libstdc++-v3/src/c++98/istream.cc	23 Apr 2019 17:00:16 -0000
> @@ -112,8 +112,10 @@
>      basic_istream<char>::
>      ignore(streamsize __n, int_type __delim)
>      {
> +#if _GLIBCXX_COMPAT_
>        if (traits_type::eq_int_type(__delim, traits_type::eof()))
>  	return ignore(__n);
> +#endif
>  
>        _M_gcount = 0;
>        sentry __cerb(*this, true);
> @@ -354,8 +356,10 @@
>      basic_istream<wchar_t>::
>      ignore(streamsize __n, int_type __delim)
>      {
> +#ifdef _GLIBCXX_COMPAT_
>        if (traits_type::eq_int_type(__delim, traits_type::eof()))
>  	return ignore(__n);
> +#endif
>  
>        _M_gcount = 0;
>        sentry __cerb(*this, true);
> Index: lib/libstdc++-v3/Makefile
> ===================================================================
> RCS file: /cvsroot/src/external/gpl3/gcc/lib/libstdc++-v3/Makefile,v
> retrieving revision 1.46
> diff -u -u -r1.46 Makefile
> --- lib/libstdc++-v3/Makefile	20 Mar 2019 05:09:27 -0000	1.46
> +++ lib/libstdc++-v3/Makefile	23 Apr 2019 17:00:16 -0000
> @@ -58,7 +58,7 @@
>  
>  SUBDIR=		include
>  
> -SRCS=		${LIBSUPCXXSRCS} ${LIBSTDCXXSRCS}
> +SRCS=		${LIBSUPCXXSRCS:N*compatibility*} ${LIBSTDCXXSRCS:N*compatibility*}
>  
>  CXXFLAGS+=	-fno-implicit-templates
>  CPPFLAGS+=	-I${DIST}/libstdc++-v3/include
> 


Home | Main Index | Thread Index | Old Index