===================================================================
@@ -103,9 +103,12 @@ void __doTMdeRegistrations (void)
_ITM_deregisterTMCloneTable (tmct);
}
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060
+
/* Provide dummy functions to satisfy linkage for versions of the Darwin
tool-chain that that can't handle undefined weak refs at the link stage.
- ??? Define these dummy functions only when !HAVE_ELF_STYLE_WEAKREF. */
+ Don't define for 10.6 or later with faster weak-symbol coalescing. */
extern void *__cxa_allocate_exception (size_t) WEAK;
extern void __cxa_throw (void *, void *, void *) WEAK;
@@ -144,5 +147,5 @@ void _ZdlPvRKSt9nothrow_t (void * a UNUS
void *_ZnaXRKSt9nothrow_t (size_t s UNUSED, c_nothrow_p b UNUSED)
{ return NULL; }
void _ZdaPvRKSt9nothrow_t (void * a UNUSED, c_nothrow_p b UNUSED) { return; }
-
+#endif
#endif
===================================================================
@@ -131,8 +131,7 @@ extern int darwin_emit_branch_islands;
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
%{mpc32:crtprec32.o%s} \
%{mpc64:crtprec64.o%s} \
- %{mpc80:crtprec80.o%s} \
- %{fgnu-tm: -lcrttme.o}"
+ %{mpc80:crtprec80.o%s}" TM_DESTRUCTOR
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
===================================================================
@@ -363,7 +363,8 @@ extern GTY(()) int darwin_ms_struct;
%{shared-libgcc:%:version-compare(< 10.5 mmacosx-version-min= crt3.o%s)}"
/* We want a destructor last in the list. */
-#define ENDFILE_SPEC "%{fgnu-tm: -lcrttme.o}"
+#define TM_DESTRUCTOR "%{fgnu-tm: -lcrttme.o}"
+#define ENDFILE_SPEC TM_DESTRUCTOR
#define DARWIN_EXTRA_SPECS \
{ "darwin_crt1", DARWIN_CRT1_SPEC }, \
===================================================================
@@ -60,7 +60,7 @@
extern void *_ZnaXRKSt9nothrow_t (size_t, c_nothrow_p) __attribute__((weak));
extern void _ZdaPvRKSt9nothrow_t (void *, c_nothrow_p) __attribute__((weak));
-#if !defined (HAVE_ELF_STYLE_WEAKREF) && !defined (__MACH__)
+#if !defined (HAVE_ELF_STYLE_WEAKREF)
void *_ZnwX (size_t) { return NULL; }
void _ZdlPv (void *) { return; }
void *_ZnaX (size_t) { return NULL; }
===================================================================
@@ -39,7 +39,7 @@
extern void __cxa_end_catch (void) WEAK;
extern void __cxa_tm_cleanup (void *, void *, unsigned int) WEAK;
-#if !defined (HAVE_ELF_STYLE_WEAKREF) && !defined (__MACH__)
+#if !defined (HAVE_ELF_STYLE_WEAKREF)
void *__cxa_allocate_exception (size_t) { return NULL; }
void __cxa_throw (void *, void *, void *) { return; }
void *__cxa_begin_catch (void *) { return NULL; }