public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* dtv_t in linuxthreads and nptl
@ 2005-01-09  9:49 Andreas Jaeger
  2005-01-09 11:53 ` Andreas Jaeger
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Jaeger @ 2005-01-09  9:49 UTC (permalink / raw)
  To: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 8335 bytes --]


Compilation with linuxthreads fails due to:
../sysdeps/generic/libc-tls.c: In function ‘__libc_setup_tls’:
../sysdeps/generic/libc-tls.c:181: error: request for member ‘val’ in something not a structure or union
../sysdeps/generic/libc-tls.c:190: error: request for member ‘is_static’ in something not a structure or union
../sysdeps/generic/libc-tls.c:192: error: request for member ‘val’ in something not a structure or union


The problem is that the recent changes for nptl have not been made for
linuxthreads.

Ok to commit the appended patch?  I'm currently testing on x86-64.

Andreas

2005-01-08  Andreas Jaeger  <aj@suse.de>

	* sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
	also contains information whether the memory pointed to is static
	TLS or not, include <stdbool.h>.
	* sysdeps/i386/tls.h: Likewise.
	* sysdeps/ia64/tls.h: Likewise.
	* sysdeps/powerpc/tls.h: Likewise.
	* sysdeps/s390/tls.h: Likewise.
	* sysdeps/sh/tls.h: Likewise.
	* sysdeps/sparc/tls.h: Likewise.
	* sysdeps/x86_64/tls.h: Likewise.

============================================================
Index: linuxthreads/sysdeps/alpha/tls.h
--- linuxthreads/sysdeps/alpha/tls.h	30 Jan 2003 21:03:40 -0000	1.5
+++ linuxthreads/sysdeps/alpha/tls.h	9 Jan 2005 09:48:52 -0000
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/Alpha version.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,11 @@
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 
============================================================
Index: linuxthreads/sysdeps/i386/tls.h
--- linuxthreads/sysdeps/i386/tls.h	19 Oct 2004 05:12:58 -0000	1.37
+++ linuxthreads/sysdeps/i386/tls.h	9 Jan 2005 09:48:52 -0000
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  linuxthreads/i386 version.
-   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
 # include <pt-machine.h>
 
 #ifndef __ASSEMBLER__
+# include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
 
@@ -31,7 +32,11 @@
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 
============================================================
Index: linuxthreads/sysdeps/ia64/tls.h
--- linuxthreads/sysdeps/ia64/tls.h	8 Jul 2004 21:20:57 -0000	1.9
+++ linuxthreads/sysdeps/ia64/tls.h	9 Jan 2005 09:48:52 -0000
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/IA-64 version.
-   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,12 +25,17 @@
 # include <dl-sysdep.h>
 # include <pt-machine.h>
 # include <stddef.h>
+# include <stdbool.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 #else /* __ASSEMBLER__ */
============================================================
Index: linuxthreads/sysdeps/powerpc/tls.h
--- linuxthreads/sysdeps/powerpc/tls.h	9 Apr 2004 19:09:42 -0000	1.8
+++ linuxthreads/sysdeps/powerpc/tls.h	9 Jan 2005 09:48:53 -0000
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/PPC version.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -23,13 +23,18 @@
 #ifndef __ASSEMBLER__
 
 # include <pt-machine.h>
+# include <stdbool.h>
 # include <stddef.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 #else /* __ASSEMBLER__ */
============================================================
Index: linuxthreads/sysdeps/s390/tls.h
--- linuxthreads/sysdeps/s390/tls.h	30 Jan 2003 18:34:11 -0000	1.3
+++ linuxthreads/sysdeps/s390/tls.h	9 Jan 2005 09:48:53 -0000
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/s390 version.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -23,13 +23,18 @@
 #ifndef __ASSEMBLER__
 
 # include <pt-machine.h>
+# include <stdbool.h>
 # include <stddef.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 typedef struct
============================================================
Index: linuxthreads/sysdeps/sh/tls.h
--- linuxthreads/sysdeps/sh/tls.h	2 Mar 2003 11:44:20 -0000	1.9
+++ linuxthreads/sysdeps/sh/tls.h	9 Jan 2005 09:48:53 -0000
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  linuxthreads/SH version.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
 # include <pt-machine.h>
 
 #ifndef __ASSEMBLER__
+# include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
 
@@ -31,7 +32,11 @@
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 #else /* __ASSEMBLER__ */
============================================================
Index: linuxthreads/sysdeps/sparc/tls.h
--- linuxthreads/sysdeps/sparc/tls.h	4 Feb 2003 20:41:02 -0000	1.3
+++ linuxthreads/sysdeps/sparc/tls.h	9 Jan 2005 09:48:53 -0000
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/sparc version.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -23,13 +23,18 @@
 #ifndef __ASSEMBLER__
 
 # include <pt-machine.h>
+# include <stdbool.h>
 # include <stddef.h>
 
 /* Type for the dtv.  */
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 typedef struct
============================================================
Index: linuxthreads/sysdeps/x86_64/tls.h
--- linuxthreads/sysdeps/x86_64/tls.h	18 Apr 2004 02:32:25 -0000	1.6
+++ linuxthreads/sysdeps/x86_64/tls.h	9 Jan 2005 09:48:53 -0000
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  linuxthreads/x86-64 version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
 #define _TLS_H
 
 #ifndef __ASSEMBLER__
-
+# include <stdbool.h>
 # include <pt-machine.h>
 # include <stddef.h>
 
@@ -29,7 +29,11 @@
 typedef union dtv
 {
   size_t counter;
-  void *pointer;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
 } dtv_t;
 
 

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: dtv_t in linuxthreads and nptl
  2005-01-09  9:49 dtv_t in linuxthreads and nptl Andreas Jaeger
@ 2005-01-09 11:53 ` Andreas Jaeger
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Jaeger @ 2005-01-09 11:53 UTC (permalink / raw)
  To: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 2146 bytes --]


Here're some more patches that I needed - now make && make check
passes.

Ok to commit?

Andreas

linuxthreads_db:
2005-01-09  Andreas Jaeger  <aj@suse.de>

	* td_thr_tlsbase.c (td_thr_tlsbase): Adjust for dtv change.

linuxthreads:
2005-01-09  Andreas Jaeger  <aj@suse.de>

	* pthread.c (init_one_static_tls): Adjust initialization of DTV
	entry for static tls deallocation fix.

============================================================
Index: linuxthreads/pthread.c
--- linuxthreads/pthread.c	6 Oct 2004 08:04:43 -0000	1.135
+++ linuxthreads/pthread.c	9 Jan 2005 11:30:47 -0000
@@ -482,7 +482,8 @@ init_one_static_tls (pthread_descr descr
 # endif
 
   /* Fill in the DTV slot so that a later LD/GD access will find it.  */
-  dtv[map->l_tls_modid].pointer = dest;
+  dtv[map->l_tls_modid].pointer.val = dest;
+  dtv[map->l_tls_modid].pointer.is_static = true;
 
   /* Initialize the memory.  */
   memset (__mempcpy (dest, map->l_tls_initimage, map->l_tls_initimage_size),

============================================================
Index: linuxthreads_db/td_thr_tlsbase.c
--- linuxthreads_db/td_thr_tlsbase.c	14 Mar 2004 03:40:06 -0000	1.3
+++ linuxthreads_db/td_thr_tlsbase.c	9 Jan 2005 11:38:02 -0000
@@ -1,5 +1,5 @@
 /* Locate TLS data for a thread.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -59,10 +59,10 @@ td_thr_tlsbase (const td_thrhandle_t *th
 
   /* It could be that the memory for this module is not allocated for
      the given thread.  */
-  if (pdtv.pointer == TLS_DTV_UNALLOCATED)
+  if (pdtv.pointer.val == TLS_DTV_UNALLOCATED)
     return TD_TLSDEFER;
 
-  *base = (char *) pdtv.pointer;
+  *base = (char *) pdtv.pointer.val;
 
   return TD_OK;
 #else

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-09 11:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-09  9:49 dtv_t in linuxthreads and nptl Andreas Jaeger
2005-01-09 11:53 ` Andreas Jaeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).