public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add multiple inclusion guards to useldt.h
@ 2004-09-25  8:11 Jakub Jelinek
  2004-09-25 10:07 ` Roland McGrath
  2004-10-01  8:33 ` Thorsten Kukuk
  0 siblings, 2 replies; 4+ messages in thread
From: Jakub Jelinek @ 2004-09-25  8:11 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

From reading the code, I believe i686 --with-tls linuxthreads
are now broken.
i686/pt-machine.h includes "../useldt.h", and after change from yesterday
tls.h which includes <pt-machine.h> includes useldt.h unconditionally too.
But this header defines structures.

Untested patch below.

2004-09-25  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/i386/useldt.h: Avoid multiple inclusion.

--- libc/linuxthreads/sysdeps/i386/useldt.h.jj	2003-04-20 10:23:23.000000000 +0200
+++ libc/linuxthreads/sysdeps/i386/useldt.h	2004-09-25 10:01:47.243988345 +0200
@@ -1,6 +1,6 @@
 /* Special definitions for ix86 machine using segment register based
    thread descriptor.
-   Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>.
 
@@ -19,6 +19,9 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.	*/
 
+#ifndef __USELDT_H
+#define __USELDT_H 1
+
 #ifndef __ASSEMBLER__
 #include <stddef.h>	/* For offsetof.  */
 #include <stdlib.h>	/* For abort().	 */
@@ -312,3 +315,5 @@ extern int __have_no_set_thread_area;
 /* Maximum size of the stack if the rlimit is unlimited.  */
 #define ARCH_STACK_MAX_SIZE	8*1024*1024
 #endif
+
+#endif

	Jakub

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

* Re: [PATCH] Add multiple inclusion guards to useldt.h
  2004-09-25  8:11 [PATCH] Add multiple inclusion guards to useldt.h Jakub Jelinek
@ 2004-09-25 10:07 ` Roland McGrath
  2004-10-01  8:33 ` Thorsten Kukuk
  1 sibling, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2004-09-25 10:07 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Ulrich Drepper, Glibc hackers

> >From reading the code, I believe i686 --with-tls linuxthreads
> are now broken.

Ack!  You're right.  The report was about i586 being broken, and I tested
that and failed to go back and test the i686 build.  It's even worse than
you thought, though!  useldt.h gets included once before USE_TLS is set and
once after, changing how it defines things.  So plain multiple inclusion
protection would in fact break it.  I put in another tweak and now I think
both builds are ok again.


Thanks,
Roland

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

* Re: [PATCH] Add multiple inclusion guards to useldt.h
  2004-09-25  8:11 [PATCH] Add multiple inclusion guards to useldt.h Jakub Jelinek
  2004-09-25 10:07 ` Roland McGrath
@ 2004-10-01  8:33 ` Thorsten Kukuk
  2004-10-01  8:38   ` Jakub Jelinek
  1 sibling, 1 reply; 4+ messages in thread
From: Thorsten Kukuk @ 2004-10-01  8:33 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

On Sat, Sep 25, Jakub Jelinek wrote:

> Hi!
> 
> >From reading the code, I believe i686 --with-tls linuxthreads
> are now broken.

It is still broken for me using --with-tls --without-__thread.

All thread test cases will be killed.

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE Linux AG        Maxfeldstr. 5                 D-90409 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B

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

* Re: [PATCH] Add multiple inclusion guards to useldt.h
  2004-10-01  8:33 ` Thorsten Kukuk
@ 2004-10-01  8:38   ` Jakub Jelinek
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Jelinek @ 2004-10-01  8:38 UTC (permalink / raw)
  To: Thorsten Kukuk; +Cc: Glibc hackers

On Fri, Oct 01, 2004 at 10:33:39AM +0200, Thorsten Kukuk wrote:
> On Sat, Sep 25, Jakub Jelinek wrote:
> 
> > Hi!
> > 
> > >From reading the code, I believe i686 --with-tls linuxthreads
> > are now broken.
> 
> It is still broken for me using --with-tls --without-__thread.
> 
> All thread test cases will be killed.

I know, I'm using following patch ATM, but didn't have time to figure
out why exactly current CVS doesn't work, which would be good to understand
so that it can be fixed for real.

2004-09-26  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/i386/tls.h: Only include useldt.h if THREAD_SELF
	is not defined.
	* sysdeps/i386/i686/pt-machine.h: Revert last change.

--- libc/linuxthreads/sysdeps/i386/tls.h	25 Sep 2004 03:32:13 -0000	1.36
+++ libc/linuxthreads/sysdeps/i386/tls.h	26 Sep 2004 08:45:21 -0000	1.35.2.3
@@ -113,7 +113,9 @@ typedef struct
 #   define TLS_LOAD_EBX
 #  endif
 
-#  include "useldt.h"		/* For the structure.  */
+#  ifndef THREAD_SELF
+#   include "useldt.h"		/* For the structure.  */
+#  endif
 #  if __ASSUME_LDT_WORKS > 0
 #   define TLS_DO_MODIFY_LDT_KERNEL_CHECK(doit) (doit) /* Nothing to check.  */
 #  else
--- libc/linuxthreads/sysdeps/i386/i686/pt-machine.h	25 Sep 2004 10:04:15 -0000	1.23
+++ libc/linuxthreads/sysdeps/i386/i686/pt-machine.h	26 Sep 2004 08:45:22 -0000	1.22.2.2
@@ -69,9 +69,7 @@ __compare_and_swap (long int *p, long in
 }
 #endif
 
-/* If tls.h was included, it will include useldt.h after defining USE_TLS.
-   We don't want to include it here first when tls.h includes us.  */
-#if __ASSUME_LDT_WORKS > 0 && !defined _TLS_H
+#if __ASSUME_LDT_WORKS > 0
 #include "../useldt.h"
 #endif
 


	Jakub

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

end of thread, other threads:[~2004-10-01  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-25  8:11 [PATCH] Add multiple inclusion guards to useldt.h Jakub Jelinek
2004-09-25 10:07 ` Roland McGrath
2004-10-01  8:33 ` Thorsten Kukuk
2004-10-01  8:38   ` Jakub Jelinek

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).