Installing a cross compiler

Jean-Sebastien Trottier jstrot@home.com
Tue Oct 30 07:16:00 GMT 2001


First, you need the content of /usr/include and /usr/lib from a
solaris2.8 system. These are not completely compatible with gcc's and
newlib's headers you'll need to do some modifications and it might get
pretty confusing.

I made a pretty neat makefile to automatically build all my
cross-compilers, attached is the output of 'make
TARGET=sparc-sun-solaris2.8 cross -n'... you can use it as a template.
There's a lot of options you won't necessarily need though.

I also suggest you don't use RedHat's gcc 2.96 (it's a highly patched
pre-release of gcc 3)... you should first build a native 2.95.3
bootstrap gcc.

Also, I could never get the posix/solaris threads working correctly with
the headers I got. So I use --enable-threads=single since I don't need
them anyway for my own compiles.

Hope this help...
I don't really have time to be more elaborate but I'm sure it'll give
you a head start.

-----Original Message-----
From: crossgcc-owner@sources.redhat.com
[ mailto:crossgcc-owner@sources.redhat.com ] On Behalf Of J-C Louis
Sent: Tuesday, October 30, 2001 09:34
To: crossgcc@sourceware.cygnus.com
Subject: Installing a cross compiler

Since two weeks, I try to install a cross-compiler but there
are still erros in the compilation.

I'm building Gcc on a Red hat 7.1 system, Gcc (2.96 version) is
already installed with the distribution
and I would configure Gcc for solaris on the same computer.

I recapitulate my compilation :

First, I configure and build binutils :

    export TARGET=sparc-sun-solaris2.8
    export PREFIX=/opt/i686-pc-linux-gnu/${TARGET}
    export PATH=$PATH:${PREFIX}/bin

    configure --target=${TARGET} --prefix=${PREFIX}
    make all install

Then, I configure Gcc (2.95.3 version) :

    configure --target=${TARGET} --prefix=${PREFIX}
        --without-headers --with-newlib
    make all-gcc install-gcc


The compilation failed. Here is the error message :

    In file included from gthr-default.h:1,
                              from gthr.h:98,
                              from ./libgcc2.c:3034:
    gthr-posix.h:37: pthread.h: No such file or directory
    .....

libgcc2 will be built without needing "gthr" (gnu pthreads)
So I add the option -D__gthr_posix_h and -Dinhibit_libc to
TARGET_LIBGCC2_CFLAGS in the file :
    ..gcc2.95.3/gcc/config/sparc/t-sol2


After that, there is another error in my compilation :

    ./frame.c:57: parse error before `object_mutex'
    ./frame.c:57: warning: data definition has no type or storage class
    make[1]: *** [libgcc2.a] Error 1


What does that mean ?
I try to compile with another target (arm-elf ) and the compilation
don't failed but with the target Sparc-sun-solaris2.*, there are
problems
I don't understand.

Any help will be very appreciated.

Jean-Christophe.




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