From patchwork Sun Aug 15 20:45:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 61767 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 306BFB70B4 for ; Mon, 16 Aug 2010 06:46:11 +1000 (EST) Received: (qmail 2106 invoked by alias); 15 Aug 2010 20:46:09 -0000 Received: (qmail 2084 invoked by uid 22791); 15 Aug 2010 20:46:07 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from c2bthomr13.btconnect.com (HELO c2bthomr13.btconnect.com) (213.123.20.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 15 Aug 2010 20:46:01 +0000 Received: from thor.office (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by c2bthomr13.btconnect.com with ESMTP id FTX88755; Sun, 15 Aug 2010 21:45:57 +0100 (BST) X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=0001.0A0B0302.4C685205.0072, actions=tag Message-Id: From: IainS To: GCC Patches Mime-Version: 1.0 (Apple Message framework v936) Subject: [Patch libjava, darwin unwind] Do not use _darwin10_Unwind_FindEnclosingFunction except on darwin >= 10 Date: Sun, 15 Aug 2010 21:45:56 +0100 Cc: java-patches@gcc.gnu.org, mrs@gcc.gnu.org X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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