Building GCC is not difficult, but is time consuming.  (MOST of the
time is simply letting the build run while you go off and have a cup
of coffee ... or a four course meal ... and dessert ... and take in a
movie.)  You will, of course, need a fully functional development
environment before you can [re]build GCC.

When it works, it is mostly unattended.  When it doesn't work, you
will have to take the time and figure out what broke.  (Maybe you
simply need to upgrade some other support utility.  Who knows?)

YES, you can have two versions of GCC on the same system.  No problem!
 What you must do is have them in different locations.  I use two
schemes for building GCC, as follows, BOTH of which place GCC apart
from the usual locations.  Both of them will automagically download
the GCC source for you.

*** Using "CSCRATCH" to build GCC ***

I often use this in-place build scheme which includes GCC (and
BINUTILS, which you may also want to upgrade).  It happens that the
scheme I call CSCRATCH places GCC (and BINUTILS) under /opt/gcc rather
than under /usr, so your old compiler would still be available.  (And
would in fact be the default.)  Be aware that this scheme will replace
most other packages IN PLACE.  The fact that it relocates GCC is a
happy coincidence that I won't elaborate on today.  It is presently
doing GCC 4.3.2.  If you have a machine, which already has a compiler,
you are welcome to try ...

        mkdir /tmp/csc
        cd /tmp/csc
        wget http://www.casita.net/pub/csc/makefile
        make gcc.mk
        make gcc.src
        make gcc.cfg
        make gcc.exe
        sudo make gcc.ins

Then to run the new compiler, set it first in command search ...

        PATH=/opt/gcc/bin:$PATH ; export PATH

You may want to do the same for BINUTILS which is at the 2.18.50.0.6
level.  (And also lands safely under /opt/gcc.)

*** Using "/usr/opt" to build GCC ***

I also often use a non-intrusive scheme for building packages,
including GCC, which lets you isolate things from the operating
system.  (So it does not break your box out of DPKG or RPM
management.)  Someone at Rice University came up with the basic idea
years ago, and I have come to rely on it heavily.  I found the build
logic for GCC 4.3.2 for this scheme and uploaded it to the web.
"/usr/opt" by design keeps everything AWAY FROM the operating system,
so here too your old compiler would still be available.  (And would
again still be the default.)  There are more steps (than with
CSCRATCH), but this is a much more open-ended solution.

        mkdir /tmp/gcc-4.3.2
        cd /tmp/gcc-4.3.2
        wget http://www.casita.net/pub/gcc/gcc-4.3.2.mak
        cp -p gcc-4.3.2.mak makefile
        wget http://www.casita.net/pub/setup.sh
        cp -p setup.sh setup
        chmod a+rx setup
        make source
        make config
        make
        sudo mkdir -m 1777 /usr/opt
        make install
        ./setup

Again, to run the new compiler, make it first in your command search ...

        PATH=/usr/opt/gcc/bin:$PATH ; export PATH

You may want to do the same with "binutils-2.18.50.0.9".

I do not know how well a home-grown GCC will behave w/r/t your mixed
32-bit and 64-bit environment.  Personally, I would use one of the
above methods and then rigorously test the stuff built by the new GCC.
 (Most of the libraries are outside of compiler space.)  Rigorous
testing is standard operating procedure, yes?   :-)

-- R;   <><





On Fri, Jan 8, 2010 at 11:26, rui <[email protected]> wrote:
> Hi all,
>
> I am looking for gcc 4.2 onwards on sles9 x86_64. Can I get a prebuilt gcc
> or do i have to build it myself? if building is the way to go, what should
> be the configuration options?
> I would like GCC to have 64 bit libs - having 32 bit libs is useful, but not
> necessary.
>
> Regards,
> Raja
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO LINUX-390 or visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390
>

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to