Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 20166
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Richard Guenther <rguenth@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Richard Guenther <rguenth@gcc.gnu.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 20166 depends on: Show dependency tree
Show dependency graph
Bug 20166 blocks: 20726

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2005-03-15 08:15 Opened: 2005-02-23 14:59
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).

------- Comment #1 From Andrew Pinski 2005-02-23 15:01 -------
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.

------- Comment #2 From gschafer@zip.com.au 2005-02-24 04:39 -------
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.

------- Comment #3 From gschafer@zip.com.au 2005-02-24 06:43 -------
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

------- Comment #4 From Haren Visavadia 2005-02-24 08:18 -------
(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



------- Comment #5 From Andrew Pinski 2005-02-28 18:28 -------
(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.

------- Comment #6 From Haren Visavadia 2005-02-28 20:47 -------
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

------- Comment #7 From Richard Guenther 2005-03-01 16:01 -------
We really need to fix this for 4.0.0

------- Comment #8 From Andrew Pinski 2005-03-01 17:05 -------
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.

------- Comment #9 From Haren Visavadia 2005-03-01 19:33 -------
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.

------- Comment #10 From Mark Mitchell 2005-03-11 03:29 -------
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?

------- Comment #11 From Jakub Jelinek 2005-03-11 11:51 -------
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.

------- Comment #12 From Richard Guenther 2005-03-15 08:15 -------
Patch here:
http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01377.html

------- Comment #13 From Andrew Pinski 2005-03-20 17:39 -------
(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.

------- Comment #14 From CVS Commits 2005-03-21 16:18 -------
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


------- Comment #15 From CVS Commits 2005-03-21 16:46 -------
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


------- Comment #16 From Richard Guenther 2005-03-21 16:48 -------
Fixed.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug