This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Don't rename char_traits::eq in libstdc++.a or user code (was Re: [v3] symbol versioning fixups)

On Thu, Jun 16, 2005 at 04:31:49AM -0400, Jakub Jelinek wrote:
> 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
> when defined _GLIBCXX_SYMVER && defined PIC,
>    then define a macro in 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 (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

This works for me just fine.
I have verified it can be linked back to ld
GNU ld version 20040326
GNU ld version 20040114
fails on it, so the 21590 ld requirement is in order.

2005-06-16  Jakub Jelinek  <>

	* src/ Include bits/c++config.h first.
	and PIC are both defined.
	* include/bits/char_traits.h (char_traits::eq): Rename

--- libstdc++-v3/src/	2005-06-16 06:33:41.121672000 -0400
+++ libstdc++-v3/src/	2005-06-16 09:09:29.181644344 -0400
@@ -28,6 +28,12 @@
 // invalidate any other reasons why the executable file might be covered by
 // the GNU General Public License.
+#include <bits/c++config.h>
+#if defined(_GLIBCXX_SYMVER) && defined(PIC)
 #include <string>
 #include <istream>
 #include <fstream>
--- libstdc++-v3/include/bits/char_traits.h	2005-06-16 06:18:51.286925000 -0400
+++ libstdc++-v3/include/bits/char_traits.h	2005-06-16 09:01:25.203986624 -0400
@@ -242,7 +242,7 @@ namespace std
       static bool
       eq(const char_type& __c1, const char_type& __c2)
       asm ("_W_ZNSt11char_traitsIcE2eqERKcS2_");
@@ -318,7 +318,7 @@ namespace std
       static bool
       eq(const char_type& __c1, const char_type& __c2) 
       asm ("_W_ZNSt11char_traitsIwE2eqERKwS2_")


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]