[PATCH] Re: Glibc broken for ia64 (take 2)
Jakub Jelinek
jakub@redhat.com
Wed Jan 15 09:54:00 GMT 2003
On Tue, Jan 14, 2003 at 05:36:17PM -0800, Roland McGrath wrote:
> Yeah, I noticed that at the start and never did anything about it. I think
> having an explicit non-kludge separator between the includes and the
> expressions is fine, either your patch or just something like:
> $1 == "--" { next }
> There is no reason to pass anything like comments through, it's just an
> intermediate file.
That's much nicer. Thanks.
The following seemed to generate the same tcb-offsets.h as the
previous patch in both --without-tls and --with-tls case.
2003-01-15 Jakub Jelinek <jakub@redhat.com>
linuxthreads/
* sysdeps/ia64/tls.h (tcbhead_t): Use the TLS ABI required layout
if USE_TLS only.
(NONTLS_INIT_TP): Revert last change.
* sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define to
offsetof (tcbhead_t, multiple_threads) if USE_TLS not defined.
--- libc/linuxthreads/sysdeps/ia64/tls.h.jj 2003-01-13 13:57:10.000000000 +0100
+++ libc/linuxthreads/sysdeps/ia64/tls.h 2003-01-14 18:12:27.000000000 +0100
@@ -32,13 +32,6 @@ typedef union dtv
void *pointer;
} dtv_t;
-
-typedef struct
-{
- dtv_t *dtv;
- void *private;
-} tcbhead_t;
-
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
@@ -49,6 +42,13 @@ typedef struct
# define USE_TLS 1
# ifndef __ASSEMBLER__
+
+typedef struct
+{
+ dtv_t *dtv;
+ void *private;
+} tcbhead_t;
+
/* This is the size of the initial TCB. */
# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
@@ -106,14 +106,22 @@ typedef struct
#else
# ifndef __ASSEMBLER__
+
+typedef struct
+{
+ void *tcb;
+ dtv_t *dtv;
+ void *self;
+ int multiple_threads;
+} tcbhead_t;
+
/* Get the thread descriptor definition. */
# include <linuxthreads/descr.h>
# define NONTLS_INIT_TP \
do { \
- static struct _pthread_descr_struct nontls_init_tp \
- = { .p_header.data.multiple_threads = 0 }; \
- __thread_self = ((__typeof (__thread_self)) &nontls_init_tp) + 1; \
+ static const tcbhead_t nontls_init_tp = { .multiple_threads = 0 }; \
+ __thread_self = (__typeof (__thread_self)) &nontls_init_tp; \
} while (0)
#endif
--- libc/linuxthreads/sysdeps/ia64/tcb-offsets.sym.jj 2003-01-13 13:57:10.000000000 +0100
+++ libc/linuxthreads/sysdeps/ia64/tcb-offsets.sym 2003-01-15 10:35:19.000000000 +0100
@@ -1,4 +1,9 @@
#include <sysdep.h>
#include <tls.h>
+--
+#ifdef USE_TLS
MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_header.data.multiple_threads) - sizeof (struct _pthread_descr_struct)
+#else
+MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
+#endif
Jakub
More information about the Libc-hacker
mailing list