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]

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


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

Hi Again,

I'm still trying to complete this Linux cross-compiler
for Solaris.  I've taken everyone's advice and I've made
considerable progress (I was delayed due to another project,
but now my focus resumes until completion).  However, I've
now come across new difficulties: when xgcc is used to build
libio, the Makefile fails because now it can't find some
header files, such as errno.h.  However, using this group,
I'm pretty sure I've copied the Linux headers to my Sun box
to the correct locations (Thanks everyone!).

So, why would the building of libio fail due to header files
not being found?  I've made good progress but am still confused
by this latest problem.

Here is the exact script I'm now using.  I've put line numbers
into the listing to help references, line 29 shows where I create
the include and lib directories for the Linux headers and
libraries,

   1 #!/bin/sh
   2 
   3 GCC=gcc-2.95.3
   4 BINUTILS=binutils-2.10.1
   5 TARGET=i686-pc-linux-gnu
   6 SRCDIR=$HOME/gnu/src/sun
   7 BINDIR=$HOME/gnu/bin/sun
   8 TARDIR=/home/davidt/gnu/tar
   9 
  10 test -d "$SRCDIR" || mkdir -p $SRCDIR
  11
  12 cd $SRCDIR
  13 tar -zxf $TARDIR/$BINUTILS.tar.gz
  14 tar -zxf $TARDIR/$GCC.tar.gz
  15 mkdir build-binutils build-gcc
  16
  17 ## -- configure, build and install binutils
  18 cd $SRCDIR/build-binutils
  19 ../$BINUTILS/configure --target=$TARGET --prefix=$BINDIR -v
  20 make all install
  21
  22 ## -- because we need to find executables we just installed
  23 ## -- such as i686-pc-linux-gnu-ar
  24 PATH=$BINDIR/bin:$PATH
  25 export PATH
  26
  27 # -- install headers from target platform
  28 cd $BINDIR/$TARGET
  29 tar -xf $TARDIR/linux.tar
  30
  31 # -- configure, build and install gcc
  32 cd $SRCDIR/build-gcc
  33 ../$GCC/configure --target=$TARGET --prefix=$BINDIR -v
  34 make LANGUAGE=c,c++ all install

Here is the output from the last make command, (I've snipped
lots of output above this, for brevity), hopefully someone will
be able to recognize my problem from this output and suggest
a solution.  I've numbered lines here, too,

   1 Configuring in i686-pc-linux-gnu/libio
   2 Appending ../../../gcc-2.95.3/libio/config/linux.mt to target-mkfrag
   3 Appending ../../../gcc-2.95.3/libio/config/mtsafe.mt to target-mkfrag
   4 Created "Makefile" in /home/davidt/gnu/src/sun/build-gcc/i686-pc-linux-gnu/libio using "target-mkfrag"
   5 Adding multilib support to Makefile in ../../../gcc-2.95.3/libio
   6 multidirs=
   7 with_multisubdir=
   8 Configuring tests...
   9 Created "Makefile" in /home/davidt/gnu/src/sun/build-gcc/i686-pc-linux-gnu/libio/tests
  10 Configuring dbz...
  11 Linked "rdbz.c" to "../../../../gcc-2.95.3/libio/dbz/dbz.c".
  12 Linked "rdbzmain.c" to "../../../../gcc-2.95.3/libio/dbz/dbzmain.c".
  13 Created "Makefile" in /home/davidt/gnu/src/sun/build-gcc/i686-pc-linux-gnu/libio/dbz
  14 Configuring stdio...
  15 Created "Makefile" in /home/davidt/gnu/src/sun/build-gcc/i686-pc-linux-gnu/libio/stdio
  16 Configuring testsuite...
  17 Created "Makefile" in /home/davidt/gnu/src/sun/build-gcc/i686-pc-linux-gnu/libio/testsuite
  18 Configuring in i686-pc-linux-gnu/libiberty
  19 creating cache ./config.cache
  20 checking host system type... i686-pc-linux-gnu
  21 checking build system type... sparc-sun-solaris2.7
  22 checking for i686-pc-linux-gnu-ar... i686-pc-linux-gnu-ar
  23 checking for i686-pc-linux-gnu-ranlib... i686-pc-linux-gnu-ranlib
  24 checking for gcc... /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/

  25 checking whether we are using GNU C... yes
  26 checking whether /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/ accepts -g... yes

  27 checking for POSIXized ISC... no
  28 checking for a BSD compatible install... /usr/local/bin/install -c
  29 checking how to run the C preprocessor... /lib/cpp
  30 checking for sys/file.h... yes
  31 checking for sys/param.h... yes
  32 checking for stdlib.h... yes
  33 checking for string.h... yes
  34 checking for unistd.h... yes
  35 checking for strings.h... yes
  36 checking for sys/time.h... yes
  37 checking for sys/resource.h... yes
  38 checking for sys/wait.h that is POSIX.1 compatible... no
  39 checking whether the C compiler (/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/ -g -O2 ) works... no

  40 configure: error: installation or configuration problem: C compiler cannot create executables.
  41 make[1]: Entering directory `/home/davidt/gnu/src/sun/build-gcc/i686-pc-linux-gnu/libio'
  42 make[1]: *** Warning: File `Makefile' has modification time in the future (999910280 > 999910224)
  43 if [ x"no" = xyes ] && [ ! -d pic ]; then \
  44   mkdir pic; \
  45 else true; fi
  46 touch stamp-picdir
  47 test x"no" != xyes ||\
  48   /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/ -c -g -O2 -I. -I../../../gcc-2.95.3/libio -D_IO_MTSAFE_IO  ../../../gcc-2.95.3/libio/iogetline.c -o pic/iogetline.o

  49 /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/ -c -g -O2 -I. -I../../../gcc-2.95.3/libio -D_IO_MTSAFE_IO ../../../gcc-2.95.3/libio/iogetline.c

  50 In file included from ../../../gcc-2.95.3/libio/iogetline.c:26:
  51 ../../../gcc-2.95.3/libio/libioP.h:30: errno.h: No such file or directory
  52 In file included from ../../../gcc-2.95.3/libio/iolibio.h:1,
  53                  from ../../../gcc-2.95.3/libio/libioP.h:47,
  54                  from ../../../gcc-2.95.3/libio/iogetline.c:26:
  55 ../../../gcc-2.95.3/libio/libio.h:30: _G_config.h: No such file or directory
  56 ../../../gcc-2.95.3/libio/iogetline.c:27: string.h: No such file or directory
  57 make[1]: *** [iogetline.o] Error 1
  58 make[1]: Leaving directory `/home/davidt/gnu/src/sun/build-gcc/i686-pc-linux-gnu/libio'
  59 make: *** [all-target-libio] Error 2

The errno.h header files exist here,

 /home/davidt/gnu/bin/sun/i686-pc-linux-gnu/include/errno.h
 /home/davidt/gnu/bin/sun/i686-pc-linux-gnu/include/asm/errno.h
 /home/davidt/gnu/bin/sun/i686-pc-linux-gnu/include/bits/errno.h
 /home/davidt/gnu/bin/sun/i686-pc-linux-gnu/include/linux/errno.h
 /home/davidt/gnu/bin/sun/i686-pc-linux-gnu/include/sys/errno.h

How come xgcc doesn't find these headers when compiling in the libio subdir?

I really appreciate everyone's help so far, any more help with this
latest difficulty would be greatly appreciated.

--
David Thompson
Foster City, CA USA

------
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]