public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* crossmake troubles, -isystem, -nostdinc
@ 2001-12-20 11:27 Paul Koning
  0 siblings, 0 replies; only message in thread
From: Paul Koning @ 2001-12-20 11:27 UTC (permalink / raw)
  To: gcc

Gentlepeople,

I have been fighting the crossgcc battles, which are tough given the
lack of documentation anywhere close to reality...

The "combined source tree" approach described in the CrossFAQ seems to
work well; one cross-target built flawlessly that way.

Another one continues to give me trouble, and the cause appears to be
that gcc is doing something that disagrees with the documentation.

Specifically:  my host is x86-linux; the target is mipsel-netbsd.  The
combined source tree build does binutils and phase 1 gcc nicely, but
then blows up when applying xgcc to newlib, in libc/stdio.  The reason
is that some include files from gcc/includes are being mixed in, and
those aren't compatible with the other includes that are coming from
newlib.  The result is compile errors on references to "va_list".

The failing command is:

/lhome/pkoning/bin301/gcc/xgcc -B/lhome/pkoning/bin301/gcc/ -nostdinc -B/lhome/pkoning/bin301/mipsel-netbsd/newlib/ -isystem /lhome/pkoning/bin301/mipsel-netbsd/newlib/targ-include -isystem /usr/src/one301/newlib/libc/include -B/usr/test2/mipsel-netbsd/bin/ -B/usr/test2/mipsel-netbsd/lib/ -isystem /usr/test2/mipsel-netbsd/include -L/lhome/pkoning/bin301/ld --save-temps -DPACKAGE=\"newlib\" -DVERSION=\"1.9.0\"  -I. -I/usr/src/one301/newlib/libc/stdio  -O2 -DMISSING_SYSCALL_NAMES -I../../targ-include -I/usr/src/one301/newlib/libc/../libc/include -fno-builtin      -g -O2 -c /usr/src/one301/newlib/libc/stdio/fclose.c
In file included from /usr/src/one301/newlib/libc/stdio/fclose.c:52:
/usr/src/one301/newlib/libc/stdio/local.h:30: parse error before "va_list"
make: *** [fclose.o] Error 1

Redoing that with -v gives me:

/lhome/pkoning/bin301/gcc/xgcc -B/lhome/pkoning/bin301/gcc/ -nostdinc -B/lhome/pkoning/bin301/mipsel-netbsd/newlib/ -isystem /lhome/pkoning/bin301/mipsel-netbsd/newlib/targ-include -isystem /usr/src/one301/newlib/libc/include -B/usr/test2/mipsel-netbsd/bin/ -B/usr/test2/mipsel-netbsd/lib/ -isystem /usr/test2/mipsel-netbsd/include -L/lhome/pkoning/bin301/ld --save-temps -v -DPACKAGE=\"newlib\" -DVERSION=\"1.9.0\"  -I. -I/usr/src/one301/newlib/libc/stdio  -O2 -DMISSING_SYSCALL_NAMES -I../../targ-include -I/usr/src/one301/newlib/libc/../libc/include -fno-builtin      -g -O2 -c /usr/src/one301/newlib/libc/stdio/fclose.c
Reading specs from /lhome/pkoning/bin301/gcc/specs
Configured with: /usr/src/one301/configure --prefix=/usr/test2 --target=mipsel-netbsd --with-headers=/usr/local/sbtools/x86-linux-rh7.1/mipsel-netbsd-2.1.1/mipsel-netbsd/sys-include --with-newlib --enable-languages=c,c++
Thread model: single
gcc version 3.0.1
 /lhome/pkoning/bin301/gcc/cpp0 -lang-c -nostdinc -v -I. -I/usr/src/one301/newlib/libc/stdio -I../../targ-include -I/usr/src/one301/newlib/libc/../libc/include -iprefix /lhome/pkoning/bin301/gcc/../lib/gcc-lib/mipsel-netbsd/3.0.1/ -isystem /lhome/pkoning/bin301/gcc/include -isystem /lhome/pkoning/bin301/mipsel-netbsd/newlib/include -isystem /usr/test2/mipsel-netbsd/bin/include -isystem /usr/test2/mipsel-netbsd/lib/include -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D__ANSI_COMPAT -DMIPSEL -DR3000 -DSYSTYPE_BSD -D_SYSTYPE_BSD -D__NetBSD__ -Dmips -D__NO_LEADING_UNDERSCORES__ -D__GP_SUPPORT__ -Dunix -D_R3000 -D__ANSI_COMPAT -D__MIPSEL__ -D__R3000__ -D__SYSTYPE_BSD__ -D_SYSTYPE_BSD -D__NetBSD__ -D__mips__ -D__NO_LEADING_UNDERSCORES__ -D__GP_SUPPORT__ -D__unix__ -D_R3000 -D__MIPSEL -D__R3000 -D__SYSTYPE_BSD -D__mips -D__unix -Asystem=unix -Asystem=NetBSD -Amachine=mips -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -DPACKAGE="newlib" -DVERSION="1.9.0" -DMISSING_SYSCALL_NAMES -isystem /lhome/pkoning/bin301/mipsel-netbsd/newlib/targ-include -isystem /usr/src/one301/newlib/libc/include -isystem /usr/test2/mipsel-netbsd/include /usr/src/one301/newlib/libc/stdio/fclose.c fclose.i
ignoring nonexistent directory "/lhome/pkoning/bin301/mipsel-netbsd/newlib/include"
ignoring nonexistent directory "/usr/test2/mipsel-netbsd/bin/include"
ignoring nonexistent directory "/usr/test2/mipsel-netbsd/lib/include"
GNU CPP version 3.0.1 (cpplib) [AL 1.1, MM 40] NetBSD/pmax
ignoring duplicate directory "/lhome/pkoning/bin301/mipsel-netbsd/newlib/targ-include"
ignoring duplicate directory "/usr/src/one301/newlib/libc/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /usr/src/one301/newlib/libc/stdio
 ../../targ-include
 /usr/src/one301/newlib/libc/include
 /lhome/pkoning/bin301/gcc/include
 /usr/test2/mipsel-netbsd/include
End of search list.
 /lhome/pkoning/bin301/gcc/cc1 -fpreprocessed fclose.i -quiet -dumpbase fclose.c -g -O2 -O2 -version -fno-builtin -o fclose.s
GNU CPP version 3.0.1 (cpplib) [AL 1.1, MM 40] NetBSD/pmax
GNU C version 3.0.1 (mipsel-netbsd)
	compiled by GNU C version 3.0.2.
In file included from /usr/src/one301/newlib/libc/stdio/fclose.c:52:
/usr/src/one301/newlib/libc/stdio/local.h:30: parse error before "va_list"
make: *** [fclose.o] Error 1

So, in spite of the -nostdinc, include paths other than the ones
explicitly mentioned are being processed, and in fact are taking
precedence over the ones explicitly supplied.  So what specifically
goes wrong is that the preprocessor is resolving #include <stdarg.h>
from gcc/include, which is a linux flavored version, rather than
finding the correct one in one of the newlib include directories.

Adding -I- to the command line makes no difference.

The documentation tells me that the compiler should not be doing
this.  And it also seems that the intent of the documentation is the
right one, after all, how else do you deal with host and target that
have different, incompatible, ways of putting their header files
together? 

	  paul

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-12-20 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-20 11:27 crossmake troubles, -isystem, -nostdinc Paul Koning

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