This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: [PowerPC] private futex build error
- From: "Ryan S. Arnold" <rsa at us dot ibm dot com>
- To: Hiroki Kaminaga <kaminaga at sm dot sony dot co dot jp>
- Cc: cseo at linux dot vnet dot ibm dot com, libc-help at sourceware dot org
- Date: Fri, 11 Jul 2008 15:36:41 -0500
- Subject: Re: [PowerPC] private futex build error
- Organization: IBM
- References: <ff4da150804271938s682dda79k55f934bd5d7d1406@mail.gmail.com> <20080428.134611.59462166.kaminaga@sm.sony.co.jp> <1215533584.24788.2.camel@localhost> <20080709.102941.21933543.kaminaga@sm.sony.co.jp>
- Reply-to: rsa at us dot ibm dot com
On Tue, Jul 8, 2008 at 8:29 PM, Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
wrote:
> Thanks!
> would appreciate your time.
Hiroki,
I don't think your patch is entirely correct but it's not entirely wrong
either. Take a look at this portion of nptl/sysdeps/descr.h:
/* Thread descriptor data structure. */
struct pthread
{
union
{
#if !TLS_DTV_AT_TP
/* This overlaps the TCB as used for TLS without threads (see
tls.h). */
tcbhead_t header;
#else
struct
{
int multiple_threads;
int gscope_flag;
# ifndef __ASSUME_PRIVATE_FUTEX
int private_futex;
# endif
} header;
#endif
...
On PowerPC TLS_DTV_AT_TP is defined. On i386 in contrast, TLS_TCB_AT_TP
is defined.
So i386 accesses private_futex via the pthread struct's struct tcbhead_t
header private_futex member, e.g.
PRIVATE_FUTEX offsetof (tcbhead_t, private_futex)
On PowerPC we access private_futex via the pthread struct's struct
header private_futex member, e.g.
# define thread_offsetof(mem) ((ptrdiff_t) THREAD_SELF + offsetof
(struct pthread, mem))
PRIVATE_FUTEX_OFFSET thread_offsetof (header.private_futex)
So the part of your patch which adds private_futex to tcbhead_t in
nptl/sysdeps/powerpc/tls.h is not necessary on PowerPC.
The guard in nptl/sysdeps/powerpc/tcb-offsets.sym is necessary.
Carlos Eduardo Seo created the bugzilla entry
I'll add the second half of your patch, with a proper changelog, to the
bugzilla entry, test and then we'll push it to libc-alpha.
2008-04-28 Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
[BZ 6740]
nptl/sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET):
Guard sym definition with #ifndef __ASSUME_PRIVATE_FUTEX.
--- a/nptl/sysdeps/powerpc/tcb-offsets.sym
+++ b/nptl/sysdeps/powerpc/tcb-offsets.sym
@@ -15,4 +15,6 @@ MULTIPLE_THREADS_OFFSET thread_offsetof
PID thread_offsetof (pid)
TID thread_offsetof (tid)
POINTER_GUARD (offsetof (tcbhead_t, pointer_guard) -
TLS_TCB_OFFSET - sizeof (tcbhead_t))
+#ifndef __ASSUME_PRIVATE_FUTEX
PRIVATE_FUTEX_OFFSET thread_offsetof (header.private_futex)
+#endif
Regards,
Ryan S. Arnold