From patchwork Sun Aug 15 20:45:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [libjava, darwin, unwind] Do not use _darwin10_Unwind_FindEnclosingFunction except on darwin >= 10 Date: Sun, 15 Aug 2010 10:45:56 -0000 From: IainS X-Patchwork-Id: 61767 Message-Id: To: GCC Patches Cc: java-patches@gcc.gnu.org, mrs@gcc.gnu.org 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. 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