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

RE: problems compiling 2.95.3


>-----Original Message-----
>From: Nick Papadonis [mailto:npapadon@yahoo.com]
>Sent: 26 April 2001 03:33


>Ok.  I copied the newlib headers to $(gcc_src_prefix)/include.
>Everything starts compiling (because things point to the right
>headers) then I get another error.  I think it's because
>there should be an -I argument with this directory passed.  Is this a
>build problem.

  Don't do it like that.  Copying those include files into the gcc
source has confused the build process.  You said in an earlier mail that
you'd been making hacks to the search paths, and you probably don't want
to do that either.

  Instead, you want to have the gcc-2.95.3 and the newlib-1.9.0 top level
source code directories side-by side in a dir somewhere.  I'd start again
with fresh unpacks of the tar file if I were you.  I generally put my
build dirs in the same tree as well, but they could be anywhere.

.../src/
     |
     +- gcc-2.95.3/
     +- newlib-1.9.0/
     +- gcc-build/
     +- newlib-build/

then cd into gcc-2.95.3 and create a couple of soft links

    cd .../src/gcc-2.95.3
    ln -s ../newlib-1.9.0/newlib newlib
    ln -s ../newlib-1.9.0/libgloss libgloss

  Now you have to make and install gcc in two passes.  This solves the
missing crt0.o problem.  The problem is that before you can build fully
executable programs with the cross compiler, you have to have a working
C library, which is where crt0.o comes from.  But before you can build
the C library, you have to have a working compiler!  Fortunately, that's
not quite true: you can make a half-working compiler, with no libs, that
is good enough for compiling the C lib.  The only thing is, this half-
built compiler *isn't* good enough for building libstdc++, and that's
why your build was going wrong previously:  at the point where it wants
to start building libstdc++, it needs to have a fully working compiler.

  OK, so how do we make this half-working compiler ?   Simple enough:
we just tell the compiler to build a C-only compiler.  That's it!  So
the procedure overall looks something like

 - unpack source code
 - configure, build and install the cross binutils
     (you've probably got this far OK)
 - make soft links in gcc top level source dir
 - change into gcc-build dir
 - configure gcc with option --enable-languages=c (as well as any others
     you've been using)
 - give the command "make LANGUAGES=c all install"
 - cd into newlib build dir
 - configure, build and install newlib
 - cd back to gcc-build dir
 - reconfigure gcc, this time without the --enable-languages option (but
     still with all your other options)
 - finish off by giving the command "make all install"

       DaveK
-- 
 All your base are belong to the Israeli army!  Oh, now they aren't again!


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


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