This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Suppress EH fallback routine for Darwin on darwin9.


Leopard has unwind information in Libc and so doesn't need
MD_UNWIND_SUPPORT, and occasionally MD_UNWIND_SUPPORT causes trouble,
like a crash instead of a call to terminate().

This doesn't cause trouble building on Leopard and running back on
Tiger because the shared library on Tiger does have the fallback
routine and that's what would be used.

I also updated comments in darwin9.h.

Bootstrapped & tested on powerpc-darwin8.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-darwin-nodarwin9fallback.patch========
2007-07-02  Geoffrey Keating  <geoffk@apple.com>

	* config/darwin9.h: Add copyright notice.
	(LINK_COMMAND_SPEC): Add comment.
	(DARWIN_LIBSYSTEM_HAS_UNWIND): Define.
	* config/rs6000/darwin.h (MD_UNWIND_SUPPORT): Conditionalise on
	DARWIN_LIBSYSTEM_HAS_UNWIND.

Index: gcc/config/rs6000/darwin.h
===================================================================
--- gcc/config/rs6000/darwin.h	(revision 126035)
+++ gcc/config/rs6000/darwin.h	(working copy)
@@ -405,7 +405,7 @@
 #include <stdbool.h>
 #endif
 
-#ifndef __LP64__
+#if !defined(__LP64__) && !defined(DARWIN_LIBSYSTEM_HAS_UNWIND)
 #define MD_UNWIND_SUPPORT "config/rs6000/darwin-unwind.h"
 #endif
 
Index: gcc/config/darwin9.h
===================================================================
--- gcc/config/darwin9.h	(revision 126035)
+++ gcc/config/darwin9.h	(working copy)
@@ -1,3 +1,24 @@
+/* Target definitions for Darwin (Mac OS X) systems.
+   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+   Contributed by Apple Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
 /* Prefer DWARF2.  */
 #undef PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
@@ -3,4 +24,5 @@
 #define DARWIN_PREFER_DWARF
 
+/* Since DWARF2 is default, conditions for running dsymutil are different.  */
 #undef LINK_COMMAND_SPEC
 #define LINK_COMMAND_SPEC "\
@@ -18,6 +40,9 @@
     %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \
     %{g*:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
 
+/* libSystem contains unwind information for signal frames.  */
+#define DARWIN_LIBSYSTEM_HAS_UNWIND
+
 /* The linker can generate branch islands.  */
 #define DARWIN_LINKER_GENERATES_ISLANDS 1
 
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]