This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Newbie can't build linux cross-compiler for solaris


Title: Newbie can't build linux cross-compiler for solaris

Hi there,

I am a newbie at building a cross compiler so I'm trying
to read everything I can find, but I've failed in all my
attempts to build a Linux gcc cross-compiler than runs
on Solaris.  Here is my simple script,

 #!/bin/ksh
 GCC=gcc-2.95.3
 BINUTILS=binutils-2.10.1
 TARGET=i686-pc-linux-gnu
 SRCDIR=/home/davidt/gnu/src/sun
 BINDIR=/home/davidt/gnu/bin/sun

 cd $SRCDIR
 mkdir build-binutils build-gcc

 # configure, build and install binutils
 cd build-binutils
 ../$BINUTILS/configure --target=$TARGET --prefix=$BINDIR -v
 make all install

 # configure, build and install gcc
 cd ../build-gcc
 ../$GCC/configure --target=$TARGET --prefix=$BINDIR -v
 make all install

I have untarred the packages into /home/davidt/gnu/bin/sun,
and binutils builds fine.  The error I get is from building
gcc, here is the [slightly formatted] error output,

 for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 \
  _ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 \
  _floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi \
  _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
  _fixtfdi _fixunstfdi _floatditf __gcc_bcmp _varargs __dummy _eprintf \
  _bb _shtab _clear_cache _trampoline __main _exit _ctors _pure; \
 do \
   echo ${name}; \
    /home/davidt/gnu/src/sun/build-gcc/gcc/xgcc \
     -B/home/davidt/gnu/src/sun/build-gcc/gcc/ \
     -B/home/davidt/gnu/bin/sun/i686-pc-linux-gnu/bin/ \
     -I/home/davidt/gnu/bin/sun/i686-pc-linux-gnu/include -O2  \
     -DCROSS_COMPILE -DIN_GCC   -DSVR4  -g -O2 -I./include  \
     -fPIC -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
     -I. -I../../gcc-2.95.3/gcc -I../../gcc-2.95.3/gcc/config \
     -I../../gcc-2.95.3/gcc/../include -c -DL${name} \
     ../../gcc-2.95.3/gcc/libgcc2.c -o ${name}.o; \
   if [ $? -eq 0 ] ; then true; else exit 1; fi; \
   i686-pc-linux-gnu-ar rc tmplibgcc2.a ${name}.o; \
   rm -f ${name}.o; \
 done
 _muldi3
 ../../gcc-2.95.3/gcc/libgcc2.c:41: stdlib.h: No such file or directory
 ../../gcc-2.95.3/gcc/libgcc2.c:42: unistd.h: No such file or directory
 make[1]: *** [libgcc2.a] Error 1
 make[1]: Leaving directory `/home/davidt/gnu/src/sun/build-gcc/gcc'
 make: *** [all-gcc] Error 2

I don't understand why stdlib.h & unistd.h cannot be found.  I need
help, what am I doing wrong?  Any advice or URLs that would help me
(the above script is from http://www.objsw.com/CrossGCC) would be
extremely appreciated.

--
David Thompson
david.thompson@efi.com

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

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