public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jack Howarth <howarth@bromo.med.uc.edu>
To: Bryce McKinlay <bmckinlay@gmail.com>
Cc: Andrew Haley <aph@redhat.com>,
	java@gcc.gnu.org, mrs@apple.com,
	        developer@sandoe-acoustics.co.uk
Subject: Re: _Unwind_FindEnclosingFunction vs darwin
Date: Sun, 20 Dec 2009 02:03:00 -0000	[thread overview]
Message-ID: <20091220020259.GA936@bromo.med.uc.edu> (raw)
In-Reply-To: <7230133d0912191154s18d9c245m9149b5b7f6b0680f@mail.gmail.com>

Bryce,
  This approach seems cleaner to me...

Index: libgcc/config/t-slibgcc-darwin
===================================================================
--- libgcc/config/t-slibgcc-darwin	(revision 155366)
+++ libgcc/config/t-slibgcc-darwin	(working copy)
@@ -24,7 +24,7 @@
 
 SHLIB_MKMAP = $(gcc_srcdir)/mkmap-flat.awk
 SHLIB_MKMAP_OPTS = -v leading_underscore=1
-SHLIB_MAPFILES += $(gcc_srcdir)/libgcc-std.ver
+SHLIB_MAPFILES += $(gcc_srcdir)/libgcc-std.ver $(gcc_srcdir)/libgcc-darwin10.ver
 
 # we're only going to build the stubs if the target slib is /usr/lib
 # there is no other case in which they're useful in a live system.
Index: gcc/unwind-dw2-fde-darwin.c
===================================================================
--- gcc/unwind-dw2-fde-darwin.c	(revision 155366)
+++ gcc/unwind-dw2-fde-darwin.c	(working copy)
@@ -273,3 +273,15 @@
 					  the_obj_info);
   return ret;
 }
+
+void *
+_darwin10_Unwind_FindEnclosingFunction (void *pc)
+{
+  struct dwarf_eh_bases bases;
+  const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases);
+  if (fde)
+    return bases.func;
+  else
+    return NULL;
+}
+
Index: libjava/include/posix.h
===================================================================
--- libjava/include/posix.h	(revision 155366)
+++ libjava/include/posix.h	(working copy)
@@ -56,6 +56,11 @@
 #define _Jv_platform_solib_suffix ".so"
 #endif
 
+#if defined(__APPLE__) && defined(__MACH__)
+#undef _Unwind_FindEnclosingFunction
+#define _Unwind_FindEnclosingFunction(PC) _darwin10_Unwind_FindEnclosingFunction(PC)
+#endif
+
 // Some POSIX systems don't have O_SYNC and O_DYSNC so we define them here.
 // Needed in java/io/natFileDescriptorPosix.cc.
 #if !defined (O_SYNC) && defined (O_FSYNC)

with a newly created file gcc/libgcc-darwin10.ver containing _darwin10_Unwind_FindEnclosingFunction.
This has the advantages of...

1) Not duplicating as much code.
2) Being easier to maintain when the duplicated code needs to be synchronized with
new changes to the original routines.
3) Allowing for other sections of gcc to utilize the restored calls as well
as providing an mechanism to easily restore additional calls from FSF libgcc
that have been silently nooped by Darwin10.
                  Jack

  parent reply	other threads:[~2009-12-20  2:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-18 14:46 Jack Howarth
2009-12-18 15:01 ` Andrew Haley
2009-12-18 15:54   ` Jack Howarth
2009-12-18 20:41   ` Jack Howarth
2009-12-19 10:51     ` Andrew Haley
2009-12-19 10:58       ` Bryce McKinlay
2009-12-19 11:07         ` Andrew Haley
2009-12-19 13:47       ` Jack Howarth
2009-12-19 17:26         ` Andrew Haley
2009-12-19 18:49           ` Jack Howarth
2009-12-19 19:54             ` Bryce McKinlay
2009-12-20  0:30               ` Jack Howarth
2009-12-20  2:03               ` Jack Howarth [this message]
2009-12-20 12:14                 ` Bryce McKinlay
2009-12-20 13:20                   ` Andrew Haley
2009-12-20 13:25                 ` Andrew Haley
2009-12-20 16:03                   ` Jack Howarth
2009-12-20 16:12                   ` Jack Howarth
2009-12-20 17:47                     ` Andrew Haley
2009-12-19 19:57       ` Jack Howarth
2009-12-20 13:26         ` Andrew Haley
2009-12-19  0:22   ` Jack Howarth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091220020259.GA936@bromo.med.uc.edu \
    --to=howarth@bromo.med.uc.edu \
    --cc=aph@redhat.com \
    --cc=bmckinlay@gmail.com \
    --cc=developer@sandoe-acoustics.co.uk \
    --cc=java@gcc.gnu.org \
    --cc=mrs@apple.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).