From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13379 invoked by alias); 20 Dec 2009 12:14:38 -0000 Received: (qmail 13368 invoked by uid 22791); 20 Dec 2009 12:14:37 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f209.google.com (HELO mail-fx0-f209.google.com) (209.85.220.209) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Dec 2009 12:14:33 +0000 Received: by fxm1 with SMTP id 1so4122798fxm.16 for ; Sun, 20 Dec 2009 04:14:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.239.185.79 with SMTP id b15mr606273hbh.78.1261311270744; Sun, 20 Dec 2009 04:14:30 -0800 (PST) In-Reply-To: <20091220020259.GA936@bromo.med.uc.edu> References: <20091218144617.GA21353@bromo.med.uc.edu> <4B2B9934.7010205@redhat.com> <20091218204147.GA23604@bromo.med.uc.edu> <4B2CB00D.5070405@redhat.com> <20091219134725.GA29636@bromo.med.uc.edu> <4B2D0CB2.6080705@redhat.com> <20091219184907.GA31305@bromo.med.uc.edu> <7230133d0912191154s18d9c245m9149b5b7f6b0680f@mail.gmail.com> <20091220020259.GA936@bromo.med.uc.edu> Date: Sun, 20 Dec 2009 12:14:00 -0000 Message-ID: <7230133d0912200414h6f13b2cfhd24f7ad312f74e06@mail.gmail.com> Subject: Re: _Unwind_FindEnclosingFunction vs darwin From: Bryce McKinlay To: Jack Howarth Cc: Andrew Haley , java@gcc.gnu.org, mrs@apple.com, developer@sandoe-acoustics.co.uk Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg00053.txt.bz2 On Sun, Dec 20, 2009 at 2:02 AM, Jack Howarth wr= ote: > Bryce, > =A0This approach seems cleaner to me... > > Index: libgcc/config/t-slibgcc-darwin > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- libgcc/config/t-slibgcc-darwin =A0 =A0 =A0(revision 155366) > +++ libgcc/config/t-slibgcc-darwin =A0 =A0 =A0(working copy) > @@ -24,7 +24,7 @@ > > =A0SHLIB_MKMAP =3D $(gcc_srcdir)/mkmap-flat.awk > =A0SHLIB_MKMAP_OPTS =3D -v leading_underscore=3D1 > -SHLIB_MAPFILES +=3D $(gcc_srcdir)/libgcc-std.ver > +SHLIB_MAPFILES +=3D $(gcc_srcdir)/libgcc-std.ver $(gcc_srcdir)/libgcc-da= rwin10.ver > > =A0# we're only going to build the stubs if the target slib is /usr/lib > =A0# there is no other case in which they're useful in a live system. > Index: gcc/unwind-dw2-fde-darwin.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/unwind-dw2-fde-darwin.c (revision 155366) > +++ gcc/unwind-dw2-fde-darwin.c (working copy) > @@ -273,3 +273,15 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0the_obj_info); > =A0 return ret; > =A0} > + > +void * > +_darwin10_Unwind_FindEnclosingFunction (void *pc) > +{ > + =A0struct dwarf_eh_bases bases; > + =A0const struct dwarf_fde *fde =3D _Unwind_Find_FDE (pc-1, &bases); > + =A0if (fde) > + =A0 =A0return bases.func; > + =A0else > + =A0 =A0return NULL; > +} > + > Index: libjava/include/posix.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- libjava/include/posix.h =A0 =A0 (revision 155366) > +++ libjava/include/posix.h =A0 =A0 (working copy) > @@ -56,6 +56,11 @@ > =A0#define _Jv_platform_solib_suffix ".so" > =A0#endif > > +#if defined(__APPLE__) && defined(__MACH__) > +#undef _Unwind_FindEnclosingFunction > +#define _Unwind_FindEnclosingFunction(PC) _darwin10_Unwind_FindEnclosing= Function(PC) > +#endif > + > =A0// Some POSIX systems don't have O_SYNC and O_DYSNC so we define them = here. > =A0// Needed in java/io/natFileDescriptorPosix.cc. > =A0#if !defined (O_SYNC) && defined (O_FSYNC) > > with a newly created file gcc/libgcc-darwin10.ver containing _darwin10_Un= wind_FindEnclosingFunction. > This has the advantages of... > > 1) Not duplicating as much code. > 2) Being easier to maintain when the duplicated code needs to be synchron= ized with > new changes to the original routines. > 3) Allowing for other sections of gcc to utilize the restored calls as we= ll > as providing an mechanism to easily restore additional calls from FSF lib= gcc > that have been silently nooped by Darwin10. I thought the plan was to put _Unwind_FindEnclosingFunction into libgcj, and call _Unwind_Find_FDE instead. But, if that doesn't work or the libgcc/darwin folks think this approach is a better idea, then it is fine. Either way, put the posix.h code inside a static inline _Jv_... function rather than overriding the function name directly. Bryce