This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Problems compiling current CVS under cygwin.
- From: "Andy Hare" <ahare at btinternet dot com>
- To: "gcc-bugs" <gcc-bugs at gcc dot gnu dot org>
- Date: Wed, 28 Nov 2001 20:29:09 -0000
- Subject: Problems compiling current CVS under cygwin.
[Get raw message]
Hi,
I am currently trying to build a cross compiler running under cygwin. 2
weeks ago this succeeded without a problem but now I get a segfault in
fix-header.
Firstly I am using the following command to configure the build :
cd /build/arm ; \
rm -r * ; \
/GNU-Source-Code/src/configure -v \
--prefix=/xgcc-arm/gnu \
--exec-prefix=/xgcc-arm/gnu \
--with-headers=/Gnu-Source-Code/src/newlib/libc/include \
--target=arm-elf >$(HOME)/configure.out 2>&1
and the following to make:
cd /build/arm/gcc ; \
make -w all-gcc install-gcc LANGUAGES="c" >$(HOME)/make-gcc.out 2>&1
I have modified fixproto to echo the lines calling fix-header to the output
so that I could see where the code was failing. Here is the relevant section
of output :
fix-header line :-
/build/arm/gcc/gcc/fix-header varargs.h /build/arm/gcc/gcc/include/varargs.h
/build/arm/gcc/gcc/include/varargs.h -D__STDC__=0 -D__cplusplus -I/build/arm
/gcc/gcc/include -I/xgcc-arm/gnu/arm-elf/sys-include
(No *.h files in /build/arm/gcc/gcc/include/cygwin)
(No *.h files in /build/arm/gcc/gcc/include/machine)
(No *.h files in /build/arm/gcc/gcc/include/sys)
fix-header line :-
/build/arm/gcc/gcc/fix-header ctype.h
/xgcc-arm/gnu/arm-elf/sys-include/ctype.h
/build/arm/gcc/gcc/include/ctype.h -D__STDC__=0 -D__cplusplus -I/build/arm/g
cc/gcc/include -I/xgcc-arm/gnu/arm-elf/sys-include
fix-header line :-
/build/arm/gcc/gcc/fix-header dirent.h
/xgcc-arm/gnu/arm-elf/sys-include/dirent.h
/build/arm/gcc/gcc/include/dirent.h -D__STDC__=0 -D__cplusplus -I/build/arm/
gcc/gcc/include -I/xgcc-arm/gnu/arm-elf/sys-include
0 [main] fix-header 1892 open_stackdumpfile: Dumping stack trace to
fix-header.exe.stackdump
Signal 11
make[2]: *** [stmp-fixproto] Error 1
make[2]: Leaving directory `/build/arm/gcc/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/build/arm/gcc'
I have run this failing line through GDB and discovered that fix-header does
not check some of the array bounds. In particular the failure appears to be
within scan-decls.c. Debugging the following segment of code :
214 if (token->type == CPP_STRING
215 && token->val.str.len == 1
216 && token->val.str.text[0] == 'C')
217 {
- 218 current_extern_C = 1;
- 219 token = get_a_token (pfile);
- 220 if (token->type == CPP_OPEN_BRACE)
221 {
222 brace_nesting++;
- 223 extern_C_braces[extern_C_braces_length++]
224 = brace_nesting;
- 225 goto new_statement;
226 }
227 }
228 else
229 continue;
shows that extern_C_braces is an array of 20 chars and
extern-C-braces_length is 26. I have been stepping through the code for some
time before this happens.
Is any one else having these problems. I tried the latest newlib from CVS to
see if there was a problem with the dirent.h file but this causes the same
problem. Even so should fix-headers not check for array bound limits being
exceeded and fail graciously rather than just seg-faulting and leaving no
evidence as to the problem.
I am quite happy to try any ideas to help fix this problem or indeed to see
if there is a problem with my setup, likely, although it was working until 2
weeks ago.
Andy Hare
www.ahare.btinternet.co.uk