I'm trying to build an m32c-elf toolchain, hosted on OSX. I've downloaded binutils-2.16.94, mpfr-2.2.1, gmp-4.2.1, gcc-4.1.2 and newlib-1.15.0 and unpacked them all into separate directories. Then I created a build subdirectory for each of binutils, newlib and gcc. I configured, built and installed binutils with no problems. However the gcc build fails when it gets to building libssp. The command is: /Users/peterhull/gnuproject/build-gcc/./gcc/xgcc -B/Users/peterhull/gnuproject/build-gcc/./gcc/ -B/Users/peterhull/m32c-elf/bin/ -B/Users/peterhull/m32c-elf/lib/ -isystem /Users/peterhull/m32c-elf/include -isystem /Users/peterhull/m32c-elf/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-4.1.2/libssp -I. -Wall -O2 -g -O2 -I../mpfr-2.2.1 -MT ssp.lo -MD -MP -MF .deps/ssp.Tpo -c ../../../gcc-4.1.2/libssp/ssp.c -o ssp.o The errors are: ../../../gcc-4.1.2/libssp/ssp.c: In function '__guard_setup': ../../../gcc-4.1.2/libssp/ssp.c:70: warning: implicit declaration of function 'open' ../../../gcc-4.1.2/libssp/ssp.c:70: error: 'O_RDONLY' undeclared (first use in this function) ../../../gcc-4.1.2/libssp/ssp.c:70: error: (Each undeclared identifier is reported only once ../../../gcc-4.1.2/libssp/ssp.c:70: error: for each function it appears in.) .... and many more 'undeclared' errors. As far as I can see this is because when configure runs for libssp, it doesn't find any of the standard headers, so (for example) HAVE_FCNTL_H is not #defined in config.h. I assume that the libssp.a that's being built is for m32c-elf, rather than for the host. If so, it should be the newlib headers on the search path, rather than the ones in /usr/include. Is this right? Am I following the right procedure for building gcc or am I missing something? Peter