Newbie can't build linux cross-compiler for solaris
David Thompson
David.Thompson@efi.com
Mon Sep 10 12:02:00 GMT 2001
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
More information about the crossgcc
mailing list