[v3] symbol versioning fixups

Jakub Jelinek jakub@redhat.com
Thu Jun 16 08:33:00 GMT 2005


On Thu, Jun 16, 2005 at 10:02:16AM +0200, Paolo Carlini wrote:
> Hi Benjamin,
> 
> >Here's the deal: the export list checking for 3.4.4 and 4.0.0 missed
> >several new exported symbols. These symbols were given the default
> >versioning, ie GLIBCXX_3.4, instead of what would be more accurate and
> >appropriate, ie GLIBCXX_3.4.5.
> >  
> >
> can you possibly clarify the issues with size_t and char_traits::eq?

size_t is unsigned int on some targets and unsigned long int on other
targets, mangled differently.  When using __asm and .symver stuff,
you use the mangled names and therefore must know whether to use j
or m in the mangled names for size_t.

Now, the problems in the patch I see ATM:
1) you use _GLIBCXX_SIZE_T_IS_INT even for streamsize mangling,
   but as streamsize is ptrdiff_t, that looks wrong, there
   is no guarantee both are long or both are int.
   E.g. s390-linux has:
#define __SIZE_TYPE__ long unsigned int
#define __PTRDIFF_TYPE__ int
   and therefore the patch will not work on s390-linux
   IMHO you need similar configury for _GLIBCXX_PTRDIFF_T_IS_INT
   (and I'd rename _GLIBCXX_SIZE_T_IS_INT to
   _GLIBCXX_SIZE_T_IS_UINT, so that it is less confusing)
2) _GLIBCXX_SYMVER is I guess going to be defined in
   <c++config.h>, do you really mean to rename char_traits::eq
   even for user code?  Do you mean to rename it for libstdc++.a
   as well?  I'd say either you want to rename it only in
   compatibility.cc when defined _GLIBCXX_SYMVER && defined PIC,
   then define a macro in compatibility.cc in that case before
   including the headers, say _GLIBCXX_SYMVER_COMPATIBILITY,
   and use it in bits/char_traits.h, or you want to rename
   it for the whole libstdc++.so (but not libstdc++.a), then
   libstdc++-v3 configury should set some new define
   in libstdc++-v3's src/ CFLAGS, say _GLIBCXX_IN_LIBSTDCXX
   or something like that, and guard the renaming in
   bits/char_traits.h with
#if defined _GLIBCXX_IN_LIBSTDCXX && defined _GLIBCXX_SYMVER && defined PIC

	Jakub



More information about the Gcc-patches mailing list