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

values-X[ac].o missing with sparc-sun-solaris2 cross compiler


I seem to be pretty close to having the cross compiler technology now.  I
managed to build a cross compiler i686-linux -> sparc-sun-solaris2 with only
two "hack" steps.  But the compiler I built doesn't quite work.  It fails in
the linking step with the error:

    /home/rutt/cross/sparc-sun-solaris2/sparc-sun-solaris2/bin/ld: cannot open values-Xc.o: No such file or directory

What is interesting is that values-X.c is supposed to be comming from the
working directory, and not from some "libary" directory:

    sparc-sun-solaris2-g++ -v  hello.c
    Reading specs from /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/specs
    gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
     /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=90 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) hello.c /tmp/cca05145.ii
    GNU CPP version egcs-2.90.27 980315 (egcs-1.0.2 release) (sparc)
    #include "..." search starts here:
    #include <...> search starts here:
     /home/rutt/cross/sparc-sun-solaris2/include/g++
     /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/include
     /home/rutt/cross/sparc-sun-solaris2/sparc-sun-solaris2/sys-include
     /home/rutt/cross/sparc-sun-solaris2/sparc-sun-solaris2/include
    End of search list.
     /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/cc1plus /tmp/cca05145.ii -quiet -dumpbase hello.cc -version -o /tmp/cca05145.s
    GNU C++ version egcs-2.90.27 980315 (egcs-1.0.2 release) (sparc-sun-solaris2) compiled by GNU C version egcs-2.90.27 980315 (egcs-1.0.2 release).
    hello.c: In function `int main()':
    hello.c:3: warning: implicit declaration of function `int printf(...)'
     /home/rutt/cross/sparc-sun-solaris2/sparc-sun-solaris2/bin/as -V -Qy -s -o /tmp/cca051451.o /tmp/cca05145.s
    GNU assembler version 2.8.1 (sparc-sun-solaris2), using BFD version 2.8.1
     /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/ld -V -Y P,/usr/ccs/lib:/usr/lib -Qy /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/crt1.o /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/crti.o values-Xa.o /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/crtbegin.o -L/home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27 -L/home/rutt/cross/sparc-sun-solaris2/sparc-sun-solaris2/lib /tmp/cca051451.o -lstdc++ -lm -lgcc -lc -lgcc /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/crtend.o /home/rutt/cross/sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/egcs-2.90.27/crtn.o
    values-Xa.o: file not recognized: File truncated
    GNU ld version 2.8.1 (with BFD 2.8.1)
      Supported emulations:
       elf32_sparc
    collect2: ld returned 1 exit status

Using the -ansi command line switch changes the name of the file to
values-Xc.o.

Here are the steps I followed to build my cross compiler:
     
    mkdir ~/cross
    mkdir ~/cross/sparc-sun-solaris2
    mkdir src
    cd src
    tar xfz ~/tmp/egcs-1.0.2.tar.gz
    tar xfz ~/tmp/binutils-2.8.1.tar.gz
    tar xfz ~/tmp/newlib-1.8.0.tar.gz
    cd newlib
    cp -r newlib/libc/include/ ~/cross/sparc-sun-solaris2/  ## Required??
    cd binutils-2.8.1
    configure --target=sparc-sun-solaris2 --host=i686-linux \
              --prefix=/home/rutt/cross/sparc-elf \
              --with-headers=/home/rutt/cross/sparc-elf/include \
              --with-newlib --with-gnu-as
    make all install
    cd ../egcs-1.0.2
    mkdir sparc-sun-solaris2
    cd sparc-sun-solaris2
    ../configure --target=sparc-sun-solaris2 --host=i686-linux \
                 --prefix=/home/rutt/cross/sparc-sun-solaris2 \
                 --with-headers=/home/rutt/cross/sparc-sun-solaris2/include \
                 --with-newlib -with-gnu-ld
    make CFLAGS=-g cross install
    ####
    #### This gets an error trying to build gmon.o that looks like "PATH_MAX"
    #### undeclared.  I'll submit a separate bug report.  So the following
    #### is a workaround for now:
    cd gcc
    touch gmon.o
    cd ..
    make CFLAGS=-g cross install
    #### This time it completes without an error

    cd ../../newlib-1.8.0
    configure --target=sparc-sun-solaris2 --host=i686-linux \
              --prefix=/home/rutt/cross/sparc-elf \
              --with-headers=/home/rutt/cross/sparc-elf/include \
              --with-newlib --with-gnu-as
    make all install

After this simple 25 step procedure, I have a complete tool chain and, as I
said, it almost works.  But not quite because of the horrible values-X*.o
problem.


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