This is the mail archive of the gcc@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]

Cross Compiling


I'm trying to build a cross-compiler from a Red Hat Linux system to a
Cygwin system (this is actually the first of several cross-compilers I'm
trying to build, so prebuilt packages won't help).  Anyway, here is the
process I'm going through

mkdir build_binutils
cd build_binutils
../binutils-2.9.1/configure --host=i686-pc-linux-gnu \
	--target=i586-pc-cygwin32 \
	--prefix=/home/johnnyb/cross
make
make install

mkdir build_gcc
cd build_gcc
../gcc-2.95/configure --host=i686-pc-linux-gnu --target=i586-pc-cygwin32 \
	--prefix=/home/johnnyb/cross --without-headers

With this configuration issuing make gives me this error:

  /home/johnnyb/build_gcc/gcc/xgcc -B/home/johnnyb/build_gcc/gcc/
-B/usr/local/i586-pc-cygwin32/bin/ -I/usr/local/i586-pc-cygwin32/include
-O2 -I../../gcc-2.95/gcc/../winsup/include -DCROSS_COMPILE -DIN_GCC     -g
-O2 -I./include   -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED   -I.
-I../../gcc-2.95/gcc -I../../gcc-2.95/gcc/config
-I../../gcc-2.95/gcc/../include -c -DL${name} \
       ../../gcc-2.95/gcc/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  i586-pc-cygwin32-ar rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_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 `/home/johnnyb/build_gcc/gcc'
make: *** [all-gcc] Error 2


However, if I specify that I'm going to use newlib, with --with-newlib, I
get:
_lshrdi3
_ashldi3
_ashrdi3
_ffsdi2
_udiv_w_sdiv
_udivmoddi4
_cmpdi2
_ucmpdi2
_floatdidf
_floatdisf
_fixunsdfsi
In file included from include/syslimits.h:7,
                 from include/limits.h:11,
                 from ../../gcc-2.95/gcc/libgcc2.c:1105:
/home/johnnyb/build_gcc/gcc/include/limits.h:117: limits.h: No such file
or directory
make[1]: *** [libgcc2.a] Error 1
make[1]: Leaving directory `/home/johnnyb/build_gcc/gcc'
make: *** [all-gcc] Error 2

I think this is all caused because I don't have newlib installed for that
platform.  However, I can't install newlib for that platform until I have
GCC built.  Any ideas?  Am I just doing it wrong?

Jonathan Bartlett


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