Hi all,
Compiling gcc with -Werror=implicit-function-declaration (needed as
warnings for implicit declaration are causing mis-configuration) shows
that vxlib-tls.c still references __gthread*tsd*, but the only remaining
declarations are to __gthread*tls*. I added a conditional declaration
of the __gthread*tsd* functions, and also noticed that one of the calls
to __gthread_tsd_leave_dtor_context doesn't pass tcb.
Also, it says that these functions are provided by the kernel, but I
haven't been able to find any documentation to confirm this. Can
someone confirm that these are in fact provided by the kernel?
I'm citing http://gcc.gnu.org/ml/gcc-patches/2005-08/msg01314.html for
the old prototypes.
The attached patch adds both the conditional declarations (on __RTP__)
and the minor change to the function call.
Robert Mason
>From d008e235167796417cf6a8f68f7206dc4351b5c3 Mon Sep 17 00:00:00 2001
From: rbmj <rbmj@xxxxxxxxxxx>
Date: Wed, 26 Sep 2012 20:12:52 -0400
Subject: [PATCH] [libgcc] * config/vxlib-tls.c: Put declarations for
kernel space TSD
---
libgcc/config/vxlib-tls.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/libgcc/config/vxlib-tls.c b/libgcc/config/vxlib-tls.c
index c469676..a2f5e34 100644
--- a/libgcc/config/vxlib-tls.c
+++ b/libgcc/config/vxlib-tls.c
@@ -96,12 +96,21 @@ static int self_owner;
static volatile int delete_hook_installed;
/* kernel provided routines */
+#ifdef __RTP__
extern void *__gthread_get_tls_data (void);
extern void __gthread_set_tls_data (void *data);
extern void __gthread_enter_tls_dtor_context (void);
extern void __gthread_leave_tls_dtor_context (void);
+#else
+
+extern void *__gthread_get_tsd_data(WIND_TCB *tcb);
+extern void __gthread_set_tsd_data(WIND_TCB *tcb, void *data);
+extern void __gthread_enter_tsd_dtor_context(WIND_TCB *tcb);
+extern void __gthread_leave_tsd_dtor_context(WIND_TCB *tcb);
+
+#endif
/* This is a global structure which records all of the active keys.
@@ -185,7 +194,7 @@ tls_delete_hook (void *tcb ATTRIBUTE_UNUSED)
#ifdef __RTP__
__gthread_leave_tls_dtor_context ();
#else
- __gthread_leave_tsd_dtor_context ();
+ __gthread_leave_tsd_dtor_context (tcb);
#endif
#ifdef __RTP__
--
1.7.10.4