From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30998 invoked by alias); 23 Jul 2012 11:24:14 -0000 Received: (qmail 30981 invoked by uid 22791); 23 Jul 2012 11:24:13 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_GC,TW_LR,TW_RW,TW_WX X-Spam-Check-By: sourceware.org Received: from mail-gg0-f175.google.com (HELO mail-gg0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Jul 2012 11:24:00 +0000 Received: by ggnp4 with SMTP id p4so6584974ggn.20 for ; Mon, 23 Jul 2012 04:23:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.36.227 with SMTP id t3mr10250287igj.13.1343042639301; Mon, 23 Jul 2012 04:23:59 -0700 (PDT) Received: by 10.50.33.38 with HTTP; Mon, 23 Jul 2012 04:23:59 -0700 (PDT) Date: Mon, 23 Jul 2012 11:24:00 -0000 Message-ID: Subject: _darwin10_Unwind_FindEnclosingFunction From: Bryce McKinlay To: gcc@gcc.gnu.org, java@gcc.gnu.org, Jack Howarth Content-Type: text/plain; charset=ISO-8859-1 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: 2012-07/txt/msg00000.txt.bz2 libgcc_s and libgcj contain a hack which renames _Unwind_FindEnclosingFunction to _darwin10_Unwind_FindEnclosingFunction on darwin targets. It appears this was introduced to work around an issue in OS X 10.6 where the _Unwind_FindEnclosingFunction was implemented as a stub which called abort(). see: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41991 This has since been fixed in OS X 10.7+, and the system's _Unwind_FindEnclosingFunction now works. In Mac OS X 10.7 and 10.8, libgcc_s is installed as a symlink to libSystem: $ ls -l /usr/lib/libgcc_s.1.dylib lrwxr-xr-x 1 root wheel 17 Jun 19 13:16 /usr/lib/libgcc_s.1.dylib -> libSystem.B.dylib Unfortunately this means that libgcj does not work on a standard Mac OS X installation, because dyld will see the symlink and resolve libgcc_s to libSystem before it checks anywhere else: $ gcj Hello.class --main=Hello $ ./a.out dyld: _dyld_bind_fully_image_containing_address() error dyld: Symbol not found: __darwin10_Unwind_FindEnclosingFunction Referenced from: /usr/local/lib/libgcj.13.dylib Expected in: /usr/lib/libSystem.B.dylib in /usr/local/lib/libgcj.13.dylib Trace/BPT trap: 5 This can be worked around by adjusting the system library path, or forcing libgcc_s to be loaded with DYLD_INSERT_LIBRARIES, but libgcj should work out-of-the-box for without having to hack the dyld configuration - so clearly we should not be renaming _Unwind_FindEnclosingFunction on OS X 10.7+ configurations. But I'm not convinced that this solution was ever really right to begin with. Even on a 10.6 system, things ought to work so long as you ensure libgcc_s is loaded before libSystem. Shouldn't the _darwin10_Unwind_FindEnclosingFunction rename be removed entirely? Bryce