missing stdio.h and ctype.h, when building a m32r cross-compiler

Doug Evans devans@cygnus.com
Tue Jun 30 11:04:00 GMT 1998


   Date: Sun, 28 Jun 1998 17:31:57 -0700 (PDT)
   From: Juan Taft <juan@ozlayer.snv.mea.com>

   Everytime I try to build a gcc cross-compiler or a gcc native-comiler I have errors with 
   include files, mostly stdio.h and ctypes.h.

You don't say which version of gcc you're using.
One guess is that you're using an FSF release of GCC that
doesn't have the patch to not build the Objective C runtime
library when building a cross compiler.

   When I use /usr/include/*.h, then I get 
   errors about variables in the header files (unknown opcode, statement syntax, invalid 
   number of operands.  These are probably not the right include files to be using, probably 
   the ones that come with cc??  The include files found in newlib-1.8.1 don't work either, 
   probably because they need to be build for the correct OS??
   My ultimate goal is to build a DOS gcc cross-compiler for the M32R target.

When building a cross-compiler via the 3-way cross (or "Canadian Cross")
method, there are _4_ compilers involved (see the crossgcc FAQ).  You need to
be explicit which context you're having problems with.

A short answer is /usr/include/*.h is used by the native compiler,
newlib is used by the cross compiler (for embedded systems, and go32/cygwin32).
You can't mix-n-match them.
[I can go into details later, after we get more detailed information
on what problems you're having and what context you're having them in.]

   I have been trying to compile a cross compiler on a Sun workstation running Solaris2.6.
   gcc was installed when the OS was Solaris2.5.
   Then OS was updated to Solaris2.6.
   I seem to always have problems with include files.

   One of these mail messages said something about rebuilding gcc if the OS has been 
   updated since gcc was installed.

You do need to reinstall the native gcc (i.e. the one that runs on
Solaris and build executables that also run on Solaris) after an o/s
upgrade [actually you only need to reinstall the header files].
This isn't a general rule though, as it depends on o/s and gcc version.

   I tried this and ran into snags, but got gcc built
   by switching between using gcc and cc to complete the build.  However even after that I 
   don't see new stdio.h and ctype.h files.

Again, you need to provide more detailed context.  It sounds like
you got the native gcc successfully rebuilt and then had problems
building the cross compiler.  Fixing the include file problems
of the native compiler won't help fixing any include file problems
you're having with a cross compiler.

   So even using the new gcc, I still get missing header files when trying to build a 
   i386-go32 gcc compiler on the sun.
   In another mail  message someone said to run fixincludes if the OS was updated after the 
   gcc was installed.  I have not found good instructions on the operation of fixincludes, 
   and I don't have permission to modify /usr/... files.  Is this necessary?

Fixincludes does not modify headers in /usr/include.  It makes copies
of them and installs the copies (with modifications) in the gcc install
directory.  [I'm assuming that you do have permission to reinstall gcc.]
As for instructions on how to use fixincludes, I always just rebuild gcc
from scratch. In addition to fixincludes there's a program called
fixproto that does additional mods to the headers.



More information about the crossgcc mailing list