views:

260

answers:

2

Greetings,

According the the gcc build instructions you can build binutils concurrently with building gcc (as well as gmp,mpc,etc).

Here's what that page says :

If you also intend to build binutils (either to upgrade an existing installation or for use in place of the corresponding tools of your OS), unpack the binutils distribution either in the same directory or a separate one. In the latter case, add symbolic links to any components of the binutils you intend to build alongside the compiler (bfd, binutils, gas, gprof, ld, opcodes, ...) to the directory containing the GCC sources.

Likewise the GMP, MPFR and MPC libraries can be automatically built together with GCC. Unpack the GMP, MPFR and/or MPC source distributions in the directory containing the GCC sources and rename their directories to gmp, mpfr and mpc, respectively (or use symbolic links with the same name).

This works fine for gmp,mpc, mpfr, but I can't seem to get it to build all of binutils. Nor can I figure out how to get it to build the new gold linker from binutils. The versions in question are gcc-4.4.2 and binutils-2.20.

A step by step instruction would be great (for me, and for others who run into this issue as well).

Thanks!

+1  A: 

I always build everything separately. After you've built and installed binutils, gcc should build fine as long as you give each configure script the same --target and --prefix options:

binutils:

$ ./configure --target=XYZ --prefix=/abc/def
$ make all install

then add the path (if necessary):

$ export PATH="$PATH:/abc/def/bin"

and build gcc:

$ ./configure --target=XYZ --prefix=/abc/def
$ make all-gcc install-gcc

Then build your libc and the rest of gcc if necessary (maybe a debugger, too!).

Carl Norum
Thanks, but that's not the question I'm asking. I know how to build them separately. The docs indicate you can build them as a single build. That's what I'm looking for.
bdbaddog
Why bother? If you can do them separately and they work, why go through the pain of trying to put them together?
Carl Norum
+4  A: 

What you want to do is called a "combined tree" or "in-tree binutils" build. You can find documentation on how to proceed here and there.

FX