[libitm] Provide all dummy functions in alloc_cpp.cc, eh_cpp.cc

Message ID ydd4ny3vs5q.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Nov. 16, 2011, 6:28 p.m.
I must have been dreaming the first time I looked at libitm testsuite
results on Tru64 UNIX.  Of course it cannot work to provide only a
single dummy function, but all weak definitions must be backed by dummy
definitions on that platform.  The following patch does just that, and
allows at least some libitm execution tests to pass, despite the lack
for named section supported also note in PR other/51174:

		=== libitm tests ===

Schedule of variations:

Running target unix
Running /vol/gcc/src/hg/trunk/local/libitm/testsuite/libitm.c/c.exp ...
FAIL: libitm.c/cancel.c (internal compiler error)
FAIL: libitm.c/cancel.c (test for excess errors)
WARNING: libitm.c/cancel.c compilation failed to produce executable
FAIL: libitm.c/clone-1.c (internal compiler error)
FAIL: libitm.c/clone-1.c (test for excess errors)
WARNING: libitm.c/clone-1.c compilation failed to produce executable
PASS: libitm.c/dropref-2.c (test for excess errors)
XFAIL: libitm.c/dropref-2.c execution test
PASS: libitm.c/dropref.c (test for excess errors)
XFAIL: libitm.c/dropref.c execution test
PASS: libitm.c/memcpy-1.c (test for excess errors)
PASS: libitm.c/memcpy-1.c execution test
PASS: libitm.c/memset-1.c (test for excess errors)
PASS: libitm.c/memset-1.c execution test
PASS: libitm.c/notx.c (test for excess errors)
PASS: libitm.c/notx.c execution test
FAIL: libitm.c/reentrant.c (internal compiler error)
FAIL: libitm.c/reentrant.c (test for excess errors)
WARNING: libitm.c/reentrant.c compilation failed to produce executable
PASS: libitm.c/simple-1.c (test for excess errors)
PASS: libitm.c/simple-1.c execution test
PASS: libitm.c/simple-2.c (test for excess errors)
PASS: libitm.c/simple-2.c execution test
PASS: libitm.c/txrelease.c (test for excess errors)
PASS: libitm.c/txrelease.c execution test
Running /vol/gcc/src/hg/trunk/local/libitm/testsuite/libitm.c++/c++.exp ...
PASS: libitm.c++/dropref.C (test for excess errors)
XFAIL: libitm.c++/dropref.C execution test
FAIL: libitm.c++/eh-1.C (internal compiler error)
FAIL: libitm.c++/eh-1.C (test for excess errors)
WARNING: libitm.c++/eh-1.C compilation failed to produce executable
XFAIL: libitm.c++/static_ctor.C (test for excess errors)
WARNING: libitm.c++/static_ctor.C compilation failed to produce executable
FAIL: libitm.c++/throwdown.C (internal compiler error)
FAIL: libitm.c++/throwdown.C (test for excess errors)

		=== libitm Summary ===

# of expected passes		15
# of unexpected failures	10
# of expected failures		4

Ok for mainline?


2011-11-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* alloc_cpp.cc [__osf__] (_ZnwX, _ZdlPv, _ZnaX, _ZdaPv,
	_ZnwXRKSt9nothrow_t, _ZdlPvRKSt9nothrow_t, _ZdaPvRKSt9nothrow_t):
	Dummy functions.
	* eh_cpp.cc [__osf__] (__cxa_allocate_exception, __cxa_throw,
	__cxa_begin_catch, __cxa_end_catch, __cxa_tm_cleanup): Likewise.


Richard Henderson Nov. 16, 2011, 7:06 p.m. | #1
On 11/16/2011 08:28 AM, Rainer Orth wrote:
> 2011-11-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 	* alloc_cpp.cc [__osf__] (_ZnwX, _ZdlPv, _ZnaX, _ZdaPv,
> 	_ZnwXRKSt9nothrow_t, _ZdlPvRKSt9nothrow_t, _ZdaPvRKSt9nothrow_t):
> 	Dummy functions.
> 	* eh_cpp.cc [__osf__] (__cxa_allocate_exception, __cxa_throw,
> 	__cxa_begin_catch, __cxa_end_catch, __cxa_tm_cleanup): Likewise.




diff --git a/libitm/alloc_cpp.cc b/libitm/alloc_cpp.cc
--- a/libitm/alloc_cpp.cc
+++ b/libitm/alloc_cpp.cc
@@ -61,11 +61,15 @@  extern void *_ZnaXRKSt9nothrow_t (size_t
 extern void _ZdaPvRKSt9nothrow_t (void *, c_nothrow_p) __attribute__((weak));
 #ifdef __osf__ /* Really: !HAVE_WEAKDEF  */
-void *
-_ZnaXRKSt9nothrow_t (size_t, c_nothrow_p)
-  return NULL;
+void *_ZnwX (size_t) { return NULL; }
+void _ZdlPv (void *) { return; }
+void *_ZnaX (size_t) { return NULL; }
+void _ZdaPv (void *) { return; }
+void *_ZnwXRKSt9nothrow_t (size_t, c_nothrow_p) { return NULL; }
+void _ZdlPvRKSt9nothrow_t (void *, c_nothrow_p) { return; }
+void *_ZnaXRKSt9nothrow_t (size_t, c_nothrow_p) { return NULL; }
+void _ZdaPvRKSt9nothrow_t (void *, c_nothrow_p) { return; }
 #endif /* __osf__ */
 /* Wrap the delete nothrow symbols for usage with a single argument.
diff --git a/libitm/eh_cpp.cc b/libitm/eh_cpp.cc
--- a/libitm/eh_cpp.cc
+++ b/libitm/eh_cpp.cc
@@ -39,6 +39,14 @@  extern void *__cxa_begin_catch (void *) 
 extern void *__cxa_end_catch (void) WEAK;
 extern void __cxa_tm_cleanup (void *, void *, unsigned int) WEAK;
+#ifdef __osf__ /* Really: !HAVE_WEAKDEF  */
+void *__cxa_allocate_exception (size_t) { return NULL; }
+void __cxa_throw (void *, void *, void *) { return; }
+void *__cxa_begin_catch (void *) { return NULL; }
+void *__cxa_end_catch (void) { return NULL; }
+void __cxa_tm_cleanup (void *, void *, unsigned int) { return; }