This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to get m68k-unknown-linux-gnu working (cpp recursion?)
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>,gcc-patches at gcc dot gnu dot org
- Subject: Re: Patch to get m68k-unknown-linux-gnu working (cpp recursion?)
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Sun, 11 Nov 2001 23:18:40 +0100
- References: <200111112158.QAA25970@caip.rutgers.edu>
On Sunday 11 November 2001 22:58, Kaveh R. Ghazi wrote:
> When trying to cross compile from sparc-sun-solaris2.7 to
> m68k-unknown-linux-gnu, I get some wierd errors. This happens whether
> I use cc, gcc-2.95 or the latest trunk as the host compiler, so I
> don't think its a compiler bug. It seems to recursively include
> m68k/linux.h for some reason I can't figure out.
>
> > /teal/caip5/ghazi/bin/tgcc -c -DCROSS_COMPILE -DIN_GCC -g -W -Wall
> > -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional
> > -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE
> > -I. -I. -I../../egcs-CVS20011111/gcc
> > -I../../egcs-CVS20011111/gcc/. -I../../egcs-CVS20011111/gcc/config
> > -I../../egcs-CVS20011111/gcc/../include
> > ../../egcs-CVS20011111/gcc/gengenrtl.c
> > [20Mb worth of macro redefinition errors...]
> > gcc/config/m68k/linux.h:27:10: #include nested too deeply
> > gcc/config/m68k/linux.h:32:10: #include nested too deeply
> > gcc/config/m68k/linux.h:33:10: #include nested too deeply
> > gcc/config/m68k/linux.h:34:10: #include nested too deeply
> > make: *** [gengenrtl.o] Error 1
>
> The attached patch fixes it by converting the nested includes to
> config.gcc tm_file entries. But I don't understand the original
> problem well enough to be satisfied with the fix. My best guess is
> that the include of "linux.h" regets m68k/linux.h but I don't see why
> that would happen given the -I flags passed in.
Uhm, this seems to be my fault, my configury rework changed the <> include to
a "" include and somehow I missed to add m68k-linux-gnu to the long list (79)
of platforms to test :-(, sorry.
On the include behaviour, this seems to be normal and the wording in the cpp
manual says:
--
GCC looks for headers requested with `#include "FILE"' first in the
directory containing the current file, then in the same places it would
have looked for a header requested with angle brackets. For example,
if `/usr/include/sys/stat.h' contains `#include "types.h"', GCC looks
for `types.h' first in `/usr/include/sys', then in its usual search
path.
--
> Anyway, here's the patch, should I install?
The patch looks OK, I cannot approve it though. But since it's obvious
(CC1_SPEC isn't defined in m68k.h, so the #undef is superflous) and a
regression caused by my patch, I guess it's OK if you commit it.
Franz.