diff mbox

[libjava,darwin,unwind] Do not use _darwin10_Unwind_FindEnclosingFunction except on darwin >= 10

Message ID EF42E08B-15CA-4684-B32E-49693D302CCA@sandoe-acoustics.co.uk
State New
Headers show

Commit Message

Iain Sandoe Aug. 15, 2010, 8:45 p.m. UTC
Hi,
This function should not be susbstituted on darwin versions with a  
working _Unwind_FindEnclosingFunction.
(darwin 10 == OSX 10.6 BTW).

OK for trunk & 4.5?
Iain

gcc:

	* unwind-dw2-fde-darwin.c (_darwin10_Unwind_FindEnclosingFunction):
	Don't generate any code unless the target is OSX >= 10.6 (Darwin10).

libjava/include:
	
	* posix.h: Make substitution of _darwin10_Unwind_FindEnclosingFunction
	conditional on the OSX version >= 10.6 (Darwin10).



  // Some POSIX systems don't have O_SYNC and O_DYSNC so we define  
them here.

Comments

Mike Stump Aug. 15, 2010, 10:46 p.m. UTC | #1
On Aug 15, 2010, at 1:45 PM, IainS wrote:
> This function should not be susbstituted on darwin versions with a working _Unwind_FindEnclosingFunction.
> (darwin 10 == OSX 10.6 BTW).
> 
> OK for trunk & 4.5?

Ok.
Iain Sandoe Aug. 17, 2010, 2:55 p.m. UTC | #2
On 15 Aug 2010, at 23:46, Mike Stump wrote:

> On Aug 15, 2010, at 1:45 PM, IainS wrote:
>> This function should not be susbstituted on darwin versions with a  
>> working _Unwind_FindEnclosingFunction.
>> (darwin 10 == OSX 10.6 BTW).
>>
>> OK for trunk & 4.5?
>
> Ok.
ci r163309 (trunk)
diff mbox

Patch

Index: gcc/unwind-dw2-fde-darwin.c
===================================================================
--- gcc/unwind-dw2-fde-darwin.c	(revision 163268)
+++ gcc/unwind-dw2-fde-darwin.c	(working copy)
@@ -276,13 +276,14 @@  _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases
  }

  void *
-_darwin10_Unwind_FindEnclosingFunction (void *pc)
+_darwin10_Unwind_FindEnclosingFunction (void *pc ATTRIBUTE_UNUSED)
  {
+#if __MACH__ && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060)
    struct dwarf_eh_bases bases;
    const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases);
    if (fde)
      return bases.func;
-  else
-    return NULL;
+#endif
+  return NULL;
  }

Index: libjava/include/posix.h
===================================================================
--- libjava/include/posix.h	(revision 163268)
+++ libjava/include/posix.h	(working copy)
@@ -56,9 +56,9 @@  details.  */
  #define _Jv_platform_solib_suffix ".so"
  #endif

-#if defined(__APPLE__) && defined(__MACH__)
-#undef _Unwind_FindEnclosingFunction
-#define _Unwind_FindEnclosingFunction(PC)  
_darwin10_Unwind_FindEnclosingFunction(PC)
+#if __MACH__ && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060)
+#  undef _Unwind_FindEnclosingFunction
+#  define _Unwind_FindEnclosingFunction(PC)  
_darwin10_Unwind_FindEnclosingFunction(PC)
  #endif