public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* values-X[ac].o missing with sparc-sun-solaris2 cross compiler
@ 1998-03-27 15:18 John C. Ruttenberg
  1998-03-31  0:46 ` Jim Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: John C. Ruttenberg @ 1998-03-27 15:18 UTC (permalink / raw)
  To: egcs; +Cc: wdl, bwilson

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: values-X[ac].o missing with sparc-sun-solaris2 cross compiler
  1998-03-27 15:18 values-X[ac].o missing with sparc-sun-solaris2 cross compiler John C. Ruttenberg
@ 1998-03-31  0:46 ` Jim Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Wilson @ 1998-03-31  0:46 UTC (permalink / raw)
  To: rutt; +Cc: egcs, egcs-bugs, wdl, bwilson

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

This file is part of Solaris2.  If you want to get the gcc Solaris2 port
working without using the Solaris2 libraries, then you will need to reverse
engineer it and write a replacement.  This file is in /usr/ccs/lib.

If you only want a sparc cross compiler, and don't need a sparc-sun-solaris2
cross compiler, then try configuring for --target=sparc-elf.  This will
avoid the solaris2 specific stuff that is causing your build to fail.

Jim

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-03-31  0:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-27 15:18 values-X[ac].o missing with sparc-sun-solaris2 cross compiler John C. Ruttenberg
1998-03-31  0:46 ` Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).