how to combine gcc and binutils source into one tree

David Kramer david@thekramers.net
Mon Aug 30 17:22:00 GMT 2004


On Mon, 30 Aug 2004 steve@millersnet.net wrote:

> the linux kernel docs say use gcc 2.95.3 and the latest binutils. However
> some   packages like glibc won't build with 2.95.3 so you end up with 2
> versions of gcc and 2 versions of binutils on the same system. While you
> can manage this, should you get your wires crossed it could make for some
> strange results. Perhaps I'm making the wrong approach, in the end I just
> want two seperate toolchains. Since I will be putting both versions on
> multiple machines I'm looking for a good way to package everything. I'll
> post any success in doing this.

Ah! I see.  I'm going through similar issues now.  I think the solution to 
your problem is not to control how they are built, but how they are 
installed.  If you configure and make them with --with-prefix=, you can 
install them in different places, and have your $PATH set up one way or 
another to use one version or another.

In my login scripts I have:
$ORIGPATH- the path without any devel tools, so I can always get a clean 
path without duplcation.
$PATH- Set to $ORIGPATH
$GCC340PATH- Set to the bin directories for gcc 3.4.0 toolchain
$GCC333PATH- Set to the bin directories for gcc 3.3.3 toolchain
$XLCPATH- Set to the bin directories for the native xlC toolchain

To switch toolchains, I just issue a command like
export PATH=$GCC340PATH:$ORIGPATH
Or make scripts (remember to source them, not run them) or aliases to do 
the same thing.

If you decide to install them under opt, use --with_prefix=/opt/gcc3.3.3
or --with_prefix==/opt/gccc3.4.0 or whatever.  To package them all up,
install all the versions on one machine, and tar up the installed versions
like "cd /opt; tar cvf /tmp/gcc_all.tar gcc*".  Everything goes under the
prefix directory, so that should work.


----------------------------------------------------------------------------
DDDD   David Kramer         david@thekramers.net       http://thekramers.net
DK KD  
DKK D  You don't usually hear "hydraulics" and "simplicity" 
DK KD  in the same sentence.
DDDD                                             Cathy Rogers, Junkyard Wars



More information about the Gcc-help mailing list