This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Thread problem in thread-m.h


I need some assistance trying to figure out what ought to happen here with the threads:

gcc malloc.c -c -O -Wall -Winline -Wstrict-prototypes -Wwrite-strings -g  -mhard-quad-float     -I../include -I. -I/space/home/jbailey/build.glibc/malloc -I..   -I/space/home/jbailey/build.glibc -I../sysdeps/sparc/sparc32/elf -I../sysdeps/unix/sysv/sysv4/solaris2/sparc/sparc32 -I../sysdeps/unix/sysv/sysv4/solaris2/sparc -I../sysdeps/unix/sysv/sysv4/solaris2 -I../sysdeps/unix/sysv/sysv4 -I../sysdeps/unix/common -I../sysdeps/unix/sysv -I../sysdeps/unix/sparc -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/sparc/sparc32/fpu -I../sysdeps/sparc/sparc32 -I../sysdeps/wordsize-32 -I../sysdeps/sparc/fpu -I../sysdeps/sparc -I../sysdeps/ieee754 -I../sysdeps/libm-ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic    -include ../include/libc-symbols.h     -o /space/home/jbailey/build.glibc/malloc/malloc.o
In file included from malloc.c:310:
thread-m.h:217: warning: `tsd_key_create' redefined
thread-m.h:98: warning: this is the location of the previous definition
thread-m.h:218: warning: `tsd_setspecific' redefined
thread-m.h:99: warning: this is the location of the previous definition
thread-m.h:219: warning: `tsd_getspecific' redefined
thread-m.h:100: warning: this is the location of the previous definition
In file included from malloc.c:310:
thread-m.h:216: conflicting types for `tsd_key_t'
thread-m.h:96: previous declaration of `tsd_key_t'
make[2]: *** [/space/home/jbailey/build.glibc/malloc/malloc.o] Error 1
make[2]: Leaving directory `/space/home/jbailey/glibc-2.0.105/malloc'

Here's the program flow:

Line 32, #if defined(_LIBC) - True, carry on.
Line 36, #ifdef PTHREAD_MUTEX_INITIALIZER - False skip to:
Line 57, #elif defined(MUTEX_INITIALIZER) - False skip to:
Line 85, #else
Line 87, #define NO_THREADS
Line 89, #endif (Matches Line 36)
Line 96-100, typedefs and defines for threads within libc.
Line 103, #elif defined(USE_PTHREADS) (Matches Line 32) - Skip to #endif next.
Line 202, #endif (Matches Line 32)
Line 204, #ifdef NO_THREADS - (Match! Defined line 87)
Line 216-219, typedefs and stubs for threads.

And *that* is where the conflict happens.  So what I don't know is what is expected to happen here.  Should line 87 be commented out, or should line 204 be ifdef (NO_THREADS && !defined _LIBC), or should the _LIBC thread stuff be wrapped in an if !defined NO_THREADS?



Or have I missed something completely here?

sh-2.02$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.60/specs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
bash-2.02$ uname -a
SunOS zoe 5.6 Generic_105181-03 sun4u sparc
bash-2.02$ 

configured with --enable-hacker-mode [obviously =)]

Tks,
Jeff Bailey
jbailey@phn.ca


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]