public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/35081]  New: abi breakage in typeinfo (4.0.1 -> 4.2.1)
@ 2008-02-04 20:11 mrs at apple dot com
  2008-02-04 20:19 ` [Bug libstdc++/35081] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: mrs at apple dot com @ 2008-02-04 20:11 UTC (permalink / raw)
  To: gcc-bugs

Someone appears to have blown the g++ abi in gcc-4.2.1 as compared to
gcc-4.0.1.  The below patch appears to be needed?  If so, could you please add
this to at least *-apple-darwin*.

$ cat patches-4.2.1/typeinfo-abi.patch 
--- gcc-4.2.1/libstdc++-v3/libsupc++/typeinfo   2007-06-26 11:35:42.000000000
-0400
+++ libstdc++-v3/libsupc++/typeinfo     2007-10-08 12:08:44.000000000 -0400
@@ -100,6 +100,15 @@ namespace std 
     bool operator!=(const type_info& __arg) const
     { return !operator==(__arg); }

+   // APPLE LOCAL begin
+   // For ABI stability these virtuals must be ordered: __is_pointer_p,
__is_function_p, __do_catch, __do_upcast
+
+   // Return true if this is a pointer type of some kind
+    virtual bool __is_pointer_p() const;
+
+    // Return true if this is a function type
+    virtual bool __is_function_p() const;
+
     // Try and catch a thrown type. Store an adjusted pointer to the
     // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then
     // THR_OBJ points to the thrown object. If THR_TYPE is a pointer
@@ -113,11 +122,7 @@ namespace std 
     virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
                             void **__obj_ptr) const;

-   // Return true if this is a pointer type of some kind
-    virtual bool __is_pointer_p() const;
-
-    // Return true if this is a function type
-    virtual bool __is_function_p() const;
+   // APPLE LOCAL end

   protected:
     const char *__name;


It went in with:

r126016 | bkoz | 2007-06-26 04:01:15 -0700 (Tue, 26 Jun 2007) | 13 lines

2007-06-26  Benjamin Kosnik  <bkoz@redhat.com>

        * include/ext/throw_allocator.h: Fixes for -fno-exceptions.
        * testsuite/util/testsuite_shared.cc: Same.
        * testsuite/util/io/illegal_input_error.hpp: Same.
        * testsuite/util/io/verified_cmd_line_input.cc: Same.

        * libsupc++/typeinfo (type_info): Correct comment formatting,
        clarify member access and public interface.
        * libsupc++/exception: Less compressed comments.
        * libsupc++/new: Same.

$ svn diff -c126016 typeinfo
Index: typeinfo
===================================================================
--- typeinfo    (revision 126015)
+++ typeinfo    (revision 126016)
@@ -93,25 +93,12 @@
   class type_info 
   {
   public:
-    /** Destructor. Being the first non-inline virtual function, this
+    /** Destructor first. Being the first non-inline virtual function, this
      *  controls in which translation unit the vtable is emitted. The
      *  compiler makes use of that information to know where to emit
      *  the runtime-mandated type_info structures in the new-abi.  */
     virtual ~type_info();

-  private:
-    /// Assigning type_info is not supported.  Made private.
-    type_info& operator=(const type_info&);
-    type_info(const type_info&);
-    
-  protected:
-    const char *__name;
-    
-  protected:
-    explicit type_info(const char *__n): __name(__n) { }
-    
-  public:
-    // the public interface
     /** Returns an @e implementation-defined byte string; this is not
      *  portable between compilers!  */
     const char* name() const
@@ -119,6 +106,7 @@

 #if !__GXX_TYPEINFO_EQUALITY_INLINE
     bool before(const type_info& __arg) const;
+
     // In old abi, or when weak symbols are not supported, there can
     // be multiple instances of a type_info object for one
     // type. Uniqueness must use the _name value, not object address.
@@ -133,19 +121,13 @@
     // and therefore address comparisons are sufficient.
     bool before(const type_info& __arg) const
     { return __name < __arg.__name; }
+
     bool operator==(const type_info& __arg) const
     { return __name == __arg.__name; }
 #endif
     bool operator!=(const type_info& __arg) const
     { return !operator==(__arg); }

-    // the internal interface
-  public:
-    // return true if this is a pointer type of some kind
-    virtual bool __is_pointer_p() const;
-    // return true if this is a function type
-    virtual bool __is_function_p() const;
-
     // Try and catch a thrown type. Store an adjusted pointer to the
     // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then
     // THR_OBJ points to the thrown object. If THR_TYPE is a pointer
@@ -155,9 +137,25 @@
     virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
                            unsigned __outer) const;

-    // internally used during catch matching
+    // Internally used during catch matching
     virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
                             void **__obj_ptr) const;
+
+   // Return true if this is a pointer type of some kind
+    virtual bool __is_pointer_p() const;
+
+    // Return true if this is a function type
+    virtual bool __is_function_p() const;
+
+  protected:
+    const char *__name;
+    
+    explicit type_info(const char *__n): __name(__n) { }
+    
+  private:
+    /// Assigning type_info is not supported.
+    type_info& operator=(const type_info&);
+    type_info(const type_info&);
   };

   /**
@@ -169,9 +167,11 @@
   {
   public:
     bad_cast() throw() { }
+
     // This declaration is not useless:
     // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
     virtual ~bad_cast() throw();
+
     // See comment in eh_exception.cc.
     virtual const char* what() const throw();
   };
@@ -181,9 +181,11 @@
   {
   public:
     bad_typeid () throw() { }
+
     // This declaration is not useless:
     // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
     virtual ~bad_typeid() throw();
+
     // See comment in eh_exception.cc.
     virtual const char* what() const throw();
   };

?


-- 
           Summary: abi breakage in typeinfo (4.0.1 -> 4.2.1)
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mrs at apple dot com
 GCC build triplet: *-apple-darwin*
  GCC host triplet: *-apple-darwin*
GCC target triplet: *-apple-darwin*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35081


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libstdc++/35081] abi breakage in typeinfo (4.0.1 -> 4.2.1)
  2008-02-04 20:11 [Bug libstdc++/35081] New: abi breakage in typeinfo (4.0.1 -> 4.2.1) mrs at apple dot com
@ 2008-02-04 20:19 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-02-04 20:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-02-04 20:18 -------
And it has already been fixed in 4.2.2.

*** This bug has been marked as a duplicate of 33678 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35081


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-04 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-04 20:11 [Bug libstdc++/35081] New: abi breakage in typeinfo (4.0.1 -> 4.2.1) mrs at apple dot com
2008-02-04 20:19 ` [Bug libstdc++/35081] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).