aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iains@gcc.gnu.org>2012-02-15 23:39:28 +0000
committerPatrick Marlier <pmarlier@gcc.gnu.org>2012-02-15 23:39:28 +0000
commite948a1fbd4dc864dfb5ff9e5511e03c630416e5a (patch)
tree6b555950db9f790ccbc9a8b2d3739d727cd63bb2
parente3a66c388451d35712a345ee98fb242b116caf10 (diff)
downloadgcc-e948a1fbd4dc864dfb5ff9e5511e03c630416e5a.zip
gcc-e948a1fbd4dc864dfb5ff9e5511e03c630416e5a.tar.gz
gcc-e948a1fbd4dc864dfb5ff9e5511e03c630416e5a.tar.bz2
re PR libitm/52220 (FAIL: libitm.c++/eh-1.C execution test due to Xcode 4 weakref linker bug)
libitm/ 2012-02-15 Iain Sandoe <iains@gcc.gnu.org> Patrick Marlier <patrick.marlier@gmail.com> PR libitm/52220 * alloc_cpp.cc: No dummy definitions for darwin. * eh_cpp.cc: Likewise. libgcc/ 2012-02-15 Iain Sandoe <iains@gcc.gnu.org> Patrick Marlier <patrick.marlier@gmail.com> PR libitm/52220 * config/darwin-crt-tm.c: Generate dummy functions. Co-Authored-By: Patrick Marlier <patrick.marlier@gmail.com> From-SVN: r184293
-rw-r--r--libgcc/ChangeLog6
-rw-r--r--libgcc/config/darwin-crt-tm.c44
-rw-r--r--libitm/ChangeLog7
-rw-r--r--libitm/alloc_cpp.cc2
-rw-r--r--libitm/eh_cpp.cc2
5 files changed, 59 insertions, 2 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index ff5101a..fef5b6d 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,6 +1,12 @@
2012-02-15 Iain Sandoe <iains@gcc.gnu.org>
Patrick Marlier <patrick.marlier@gmail.com>
+ PR libitm/52220
+ * config/darwin-crt-tm.c: Generate dummy functions.
+
+2012-02-15 Iain Sandoe <iains@gcc.gnu.org>
+ Patrick Marlier <patrick.marlier@gmail.com>
+
PR libitm/52042
* config/darwin-crt-tm.c (getTMCloneTable): New function.
(__doTMRegistrations): Call it.
diff --git a/libgcc/config/darwin-crt-tm.c b/libgcc/config/darwin-crt-tm.c
index 78053f65..319b4f8 100644
--- a/libgcc/config/darwin-crt-tm.c
+++ b/libgcc/config/darwin-crt-tm.c
@@ -39,6 +39,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#endif
#define WEAK __attribute__((weak))
+#define UNUSED __attribute__((unused))
extern void _ITM_registerTMCloneTable (void *, size_t) WEAK;
extern void _ITM_deregisterTMCloneTable (void *) WEAK;
@@ -103,3 +104,46 @@ void __doTMdeRegistrations (void)
}
#endif
+
+/* 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. */
+
+extern void *__cxa_allocate_exception (size_t) WEAK;
+extern void __cxa_throw (void *, void *, void *) WEAK;
+extern void *__cxa_begin_catch (void *) WEAK;
+extern void *__cxa_end_catch (void) WEAK;
+extern void __cxa_tm_cleanup (void *, void *, unsigned int) WEAK;
+
+extern void *_ZnwX (size_t) WEAK;
+extern void _ZdlPv (void *) WEAK;
+extern void *_ZnaX (size_t) WEAK;
+extern void _ZdaPv (void *) WEAK;
+
+typedef const struct nothrow_t { } *c_nothrow_p;
+
+extern void *_ZnwXRKSt9nothrow_t (size_t, c_nothrow_p) WEAK;
+extern void _ZdlPvRKSt9nothrow_t (void *, c_nothrow_p) WEAK;
+extern void *_ZnaXRKSt9nothrow_t (size_t, c_nothrow_p) WEAK;
+extern void _ZdaPvRKSt9nothrow_t (void *, c_nothrow_p) WEAK;
+
+void *__cxa_allocate_exception (size_t s UNUSED) { return NULL; }
+void __cxa_throw (void * a UNUSED, void * b UNUSED, void * c UNUSED)
+ { return; }
+void *__cxa_begin_catch (void * a UNUSED) { return NULL; }
+void *__cxa_end_catch (void) { return NULL; }
+void __cxa_tm_cleanup (void * a UNUSED, void * b UNUSED, unsigned int c UNUSED)
+ { return; }
+
+void *_ZnwX (size_t s UNUSED) { return NULL; }
+void _ZdlPv (void * a UNUSED) { return; }
+void *_ZnaX (size_t s UNUSED) { return NULL; }
+void _ZdaPv (void * a UNUSED) { return; }
+
+void *_ZnwXRKSt9nothrow_t (size_t s UNUSED, c_nothrow_p b UNUSED)
+ { return NULL; }
+void _ZdlPvRKSt9nothrow_t (void * a UNUSED, c_nothrow_p b UNUSED) { return; }
+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; }
+
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index 3b54c8b..e103ca0 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-15 Iain Sandoe <iains@gcc.gnu.org>
+ Patrick Marlier <patrick.marlier@gmail.com>
+
+ PR libitm/52220
+ * alloc_cpp.cc: No dummy definitions for darwin.
+ * eh_cpp.cc: Likewise.
+
2012-02-14 Richard Henderson <rth@redhat.com>
* config/x86/target.h (GTM_longjmp): Correct the .cfi corrections.
diff --git a/libitm/alloc_cpp.cc b/libitm/alloc_cpp.cc
index 0789b2e..00a4d32 100644
--- a/libitm/alloc_cpp.cc
+++ b/libitm/alloc_cpp.cc
@@ -60,7 +60,7 @@ extern void _ZdlPvRKSt9nothrow_t (void *, c_nothrow_p) __attribute__((weak));
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)
+#if !defined (HAVE_ELF_STYLE_WEAKREF) && !defined (__MACH__)
void *_ZnwX (size_t) { return NULL; }
void _ZdlPv (void *) { return; }
void *_ZnaX (size_t) { return NULL; }
diff --git a/libitm/eh_cpp.cc b/libitm/eh_cpp.cc
index 352a313..5c4ca28 100644
--- a/libitm/eh_cpp.cc
+++ b/libitm/eh_cpp.cc
@@ -39,7 +39,7 @@ extern void *__cxa_begin_catch (void *) WEAK;
extern void *__cxa_end_catch (void) WEAK;
extern void __cxa_tm_cleanup (void *, void *, unsigned int) WEAK;
-#if !defined (HAVE_ELF_STYLE_WEAKREF)
+#if !defined (HAVE_ELF_STYLE_WEAKREF) && !defined (__MACH__)
void *__cxa_allocate_exception (size_t) { return NULL; }
void __cxa_throw (void *, void *, void *) { return; }
void *__cxa_begin_catch (void *) { return NULL; }