This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Unwind and IA64 HP-UX


The g++ compiler on IA64 HP-UX uses the system unwind library.  It does
not have the new _Unwind_Resume_or_Rethrow entry point that Richard
Henderson created in the GCC unwind library.  This patch is to allow
IA64 HP-UX to avoid using the new entry point and use
_Unwind_RaiseException instead.  This will give us slightly different
semantics on HP-UX but it is as close as we can come using only the
functions in the IA64 Unwind ABI.

If approved I would like to check this in on the 3.3 branch as well as
the main line so that it gets into any 3.3.* releases.  Currently some
C++ programs will not link correctly on IA64 HP-UX with the g++ 3.3
compiler.  They get an unsatisfied symbol (_Unwind_Resume_or_Rethrow)
during the link.

Steve Ellcey
sje@cup.hp.com


2003-05-22  Steve Ellcey  <sje@cup.hp.com>

	* config/os/hpux/os_defines.h: Define _LIBUNWIND_STD_ABI if we are
	on IA64 HP-UX.
	* libsupc++/eh_throw.cc: Don't call _Unwind_Resume_or_Rethrow if
	_LIBUNWIND_STD_ABI is set.


*** gcc.orig/libstdc++-v3/config/os/hpux/os_defines.h	Thu May 22 08:55:55 2003
--- gcc/libstdc++-v3/config/os/hpux/os_defines.h	Thu May 22 08:58:38 2003
*************** namespace std 
*** 84,89 ****
--- 84,96 ----
  typedef long int __padding_type;
  #endif
  
+ // GCC on IA64 HP-UX uses the HP-UX system unwind library,
+ // it does not have the _Unwind_Resume_or_Rethrow entry point
+ // because that is not part of the standard IA64 Unwind ABI.
+ #if defined (__ia64__)
+ #define _LIBUNWIND_STD_ABI 1
+ #endif
+ 
  /* We need explicit instantiation of the atomicity lock on HPPA if
     there is no weak support.  */
  #if !defined(_GLIBCPP_SUPPORTS_WEAK) && defined (__hppa__)
*** gcc.orig/libstdc++-v3/libsupc++/eh_throw.cc	Thu May 22 09:00:28 2003
--- gcc/libstdc++-v3/libsupc++/eh_throw.cc	Thu May 22 08:59:29 2003
*************** __cxa_rethrow ()
*** 98,104 ****
--- 98,108 ----
  #ifdef _GLIBCPP_SJLJ_EXCEPTIONS
        _Unwind_SjLj_Resume_or_Rethrow (&header->unwindHeader);
  #else
+ #ifdef _LIBUNWIND_STD_ABI
+       _Unwind_RaiseException (&header->unwindHeader);
+ #else
        _Unwind_Resume_or_Rethrow (&header->unwindHeader);
+ #endif
  #endif
    
        // Some sort of unwinding error.  Note that terminate is a handler.


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