This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Include file failures in building a cross-compiler


Scenario:

 I started with a fresh (virgin) installation of Red Hat 6.1 linux on my
system.  Following the examples in the FAQ from objsw.com/CrossGCC, I
obtained the sources from ftp.gnu.org and installed them into /usr/src,
where I was running as root. I unpacked the source trees as per standard
procedures:
      tar -xzvf binutils-2.9.1.tar.gz
      tar -xzvf gcc-2.95.tar.gz
      tar -xzvf newlib-1.8.2.tat.gz
      tar -xzvf gdb-4.18.tar.gz

I set environmental variables:
      host=i686-pc-linux-gnu
      target=i486-pc-linux-gnu
      prefix=/cross
      i=$prefix/bin

I created build directories:
      mkdir build-binutils build-gcc build-newlib build-gdb

I built binutils:
      cd build-binutils
      ../binutils-2.9.1/configure --target=$target --prefix=$prefix -v &>
config.log
      make all install &> make.log

Then I tried to make gcc:
      cd ../build-gcc
      ../gcc-2.95/configure --target=$target --prefix=$prefix -v &>
config.log
      make all install &> make.log

The make blew up.  Examination of make.log yielded:
.
.
[snip]
.
.
_muldi3
../../gcc-2.95/gcc/libgcc2.c:41: stdlib.h: No such file or directory
../../gcc-2.95/gcc/libgcc2.c:42: unistd.h: No such file or directory
make[1]: *** [libgcc2.a] Error 1
make[1]: Leaving directory `/usr/src/build-gcc/gcc'
make: *** [all-gcc] Error 2

This error is repeatable, and I've found I can get around it by adding the
following to my ../gcc-2.95/configure statement:
--with-headers=../newlib-1.8.2/newlib/libc\include  --enable-languages="c,c+
+"

Hope this helps.

Please feel free to contact me if I can supply more information.

Please disregard the automatically inseted name "Mike".  This is from:

Richard Bowser
Engineer
Thunder Scientific Corporation

email:    richardb@thunderscientific.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]