This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
The fix to PR19333 uncovered a problem in the Debian (only?) shipped pthread.h file which breaks bootstrapping on this platform: ./xgcc -B./ -B/home/rguenth/x86_64/gcc4.0-230205/x86_64-unknown-linux-gnu/bin/ -isystem /home/rguenth/x86_64/gcc4.0-230205/x86_64-unknown-linux-gnu/include -isystem /home/rguenth/x86_64/gcc4.0-230205/x86_64-unknown-linux-gnu/sys-include -L/tmp/gcc-obj/gcc/../ld -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I/net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc -I/net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/. -I/net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/../include -I/net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/../libcpp/include -fvisibility=hidden -DHIDE_EXPORTS -fexceptions -c /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/unwind-dw2-fde-glibc.c -o libgcc/./unwind-dw2-fde-glibc.o In file included from /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/gthr-posix.h:43, from ./gthr-default.h:1, from /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/gthr.h:114, from /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/unwind-dw2.c:42: /usr/include/pthread.h:655: error: array type has incomplete element type In file included from /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/gthr-posix.h:43, from ./gthr-default.h:1, from /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/gthr.h:114, from /net/alwazn/home/rguenth/src/gcc/gcc4.0/gcc/unwind-dw2-fde-glibc.c:50: /usr/include/pthread.h:655: error: array type has incomplete element type make[3]: *** [libgcc/./unwind-dw2-fde-glibc.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: *** [libgcc/./unwind-dw2.o] Error 1 where the code in pthread.h:655 is really invalid: /* Function used in the macros. */ struct __jmp_buf_tag; extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROW; because __jmp_buf_tag is incomplete (and is defined in setjmp.h).
It is not just debian but anyone who used a bad glibc in the first place. I have no idea when this was introduced at all.
This also happens for me on i686-pc-linux-gnu. It's a bog-standard unpatched NPTL-enabled glibc-2.3.4 system. I don't think it classifies as a "bad glibc". I concur that some fixincludes magic may be required here. This is a showstopper.
Here's the fix to pthread.h from Glibc cvs. I suppose the fixinclude "fix" would need to replicate this: http://sources.redhat.com/ml/glibc-cvs/2005-q1/msg00303.html
(In reply to comment #1) > It is not just debian but anyone who used a bad glibc in the first place. I have no idea when this was > introduced at all. It was introduced by fix for GCC Bug ID 19333
(In reply to comment #4) > (In reply to comment #1) > > It is not just debian but anyone who used a bad glibc in the first place. I > have no idea when this was > > introduced at all. > It was introduced by fix for GCC Bug ID 19333 I mean in glibc, as I have much older glibc and it works still.
For NPTL addon for glibc, it's been their since 12 April 2003, see http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/nptl/sysdeps/pthread/pthread.h?cvsroot=glibc
We really need to fix this for 4.0.0
Well considering this is glibc bug, yes this needs to be fixed but really glibc should have this code in the first place as it would break with -pedantic and they were using an undocumented extension.
Yes, glibc should have this code in the first place but we can not turn the clock back/time travel. Futhermore, I can reproduce it on i686-pc-linux-gnu with NPTL-enabled glibc-2.3.3 system using official tarball with no patches. IMHO, it's quite important for folks using NPTL-enabled systems to bootstrap GCC 4.0.
I've restored the target milestone for this bug, but made the priority P3. I think that it would be good to fix this bug, since these GLIBCs are out there in the wild. The right fix is indded to add that to fixincludes. Richard, Greg, would one of you like to give that a try?
Just FYI, most distributions ship LinuxThreads headers by default and you need to specifically ask for NPTL headers ATM. Linking happens against LinuxThreads libraries as well by default, though NPTL is the default threading library at runtime. This is the setup e.g. Fedora Core, RHEL, SUSE, Mandrake, Conectiva use. So the problem is not that wide-spread.
Patch here: http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01377.html
(In reply to comment #12) > Patch here: > http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01377.html Note for fixinclude patches, Bruce Korb likes to be CCed on them.
Subject: Bug 20166 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: rguenth@gcc.gnu.org 2005-03-21 16:17:55 Modified files: fixincludes : ChangeLog inclhack.def fixincl.x fixincludes/tests/base: pthread.h Log message: 2005-03-21 Richard Guenther <rguenth@gcc.gnu.org> PR target/20166 * inclhack.def: Add fix for array of incomplete structures in function prototype in pthread.h. * fixincl.x: Regenerate. * tests/base/pthread.h: Adjust. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/fixincludes/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.32.2.1&r2=1.32.2.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/fixincludes/inclhack.def.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.16.14.1&r2=1.16.14.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/fixincludes/fixincl.x.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.16.14.1&r2=1.16.14.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/fixincludes/tests/base/pthread.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3&r2=1.3.16.1
Subject: Bug 20166 CVSROOT: /cvs/gcc Module name: gcc Changes by: rguenth@gcc.gnu.org 2005-03-21 16:46:09 Modified files: fixincludes : ChangeLog inclhack.def fixincl.x fixincludes/tests/base: pthread.h Log message: 2005-03-21 Richard Guenther <rguenth@gcc.gnu.org> PR target/20166 * inclhack.def: Add fix for array of incomplete structures in function prototype in pthread.h. * fixincl.x: Regenerate. * tests/base/pthread.h: Adjust. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/fixincludes/ChangeLog.diff?cvsroot=gcc&r1=1.33&r2=1.34 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/fixincludes/inclhack.def.diff?cvsroot=gcc&r1=1.17&r2=1.18 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/fixincludes/fixincl.x.diff?cvsroot=gcc&r1=1.17&r2=1.18 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/fixincludes/tests/base/pthread.h.diff?cvsroot=gcc&r1=1.3&r2=1.4
Fixed.