[geeks] In Need of RS/6000

Jonathan C. Patschke jp at celestrion.net
Fri Oct 31 16:14:43 CST 2003


On Thu, 30 Oct 2003, Jonathan C. Patschke wrote:

> I need to build GCC 3.3 for AIX, and it won't build with the version
> of GCC that IBM provides.

I got it working!  Here's what needs to be done:

   0) You need a good portion of the AIX Toolbox for Linux Applications
      installed.  Obviously you need GCC, flex, bison, and binutils.
      You probably need (or at least want) texinfo and groff.  Properly
      set $CC, $LD, and friends.  I have $LD pointing to gcc as a habit
      from running IRIX, and it seems to work okay.

   1) Snag the latest gcc-3.0 release (3.0.4) and build it like so:
      gunzip -c gcc-3.0.4.tar.gz | tar xvf -
      mkdir gcc-obj
      cd gcc-obj
      ../gcc-3.0.4/configure --prefix=/usr/local --with-threads=aix \
        --enable-threads=aix --srcdir=../gcc-3.0.4
      gmake SHELL=/opt/freeware/bin/bash \
            CONFIG_SHELL=/opt/freeware/bin/bash bootstrap

    2) The build will error out, complaining about line 1071 of
       include/math.h.  Edit gcc/include/math.h.  Starting at line
       1071, there'll be two pairs of #ifndef/#endif declarations.
       Remove the #ifndef/#endif pairs, but NOT the code inside them.

    3) Rerun gmake as in step 1.  It'll finish in about 2 hours on a
       p615, so now's a good time to go off and do something else.

    4) Run gmake check (if you want) followed by gmake install (as
       root).

    5) Switch $CC from IBM's gcc to the one you just built.  Download
       the latest GCC 3.2 release (3.2.3) and install it over 3.0.4
       just as you did above.  You'll need to perform step 2 again.

    6) Now you can -finally- build 3.3.2.  Do the same thing you did
       in Step 5.

    7) You now have a working GCC 3.3.2, with 64-bit support, if you
       are running 64-bit AIX on 64-bit hardware.  Hopefully a newer
       version of the compiler hasn't come out while you were building
       it. :)

-- 
Jonathan Patschke  ) "Earth works.  That's proof positive that Mother
Elgin, TX         (   Nature isn't a suit."            --Dave McGuire



More information about the geeks mailing list