swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SGI gcc install hints.


From: bleydorf
Subject: SGI gcc install hints.
Date: Thu, 29 May 1997 11:44:31 -0400

All,
I found the following hints on installing gcc 2.7.2 on an Irix 6.2
box...I thought I would pass it on to the rest of the group.  I
personally haven't tried it yet, but if anyone has please drop me a note
and tell me how it went...

Thanks,
Brad Leydorf
address@hidden

---------------How to build gcc-2.7.2 under IRIX-6.2------------------  
               [last updated 10/29/96, MKN]
               
Hi,

 after seeing quite a few requests on how to build gcc-2.7.2
under IRIX-6.2, here is my receipe. I have tested it on my
own systems, but of course there are no guarantees. The
systems tested are an Indy/R4K running 6.2 and an Indigo2/R10K.

 First of all, what is the problem? There are two of them:

a) the 6.2 "ld" program does not handle the output of the
   GNU assembler (needed to generate debugger ouptut for "-g").
   For some reason, wise people have included the original 5.3
   "ld" as "/usr/lib/old_ld" (parto of IDO).
b) the "configure" program wrongly assumes a 64-bit environment
   if it encounters "IRIX 6.2".

 Both problems need to be adressed by GNU for the next release
of "binutils" and "gcc". In the meanwhile here is my workaround.
I'm assuming you have IDO purchased and installed (see my
heritage :-):

a) Build the GNU Assembler (from "binutils") using IRIX "cc".
   You need to build it for IRIX-5.3 host AND target. You need
   to install it at a place where "gcc" looks for it BEFORE you
   start building "gcc". Make sure you are working in the
   "-32" compilation environment for SGI's "cc".

% setenv SGI_ABI "-32"
% ./configure --host=mips-sgi-irix5.3 --target=mips-sgi-irix5.3 \
    --build=mips-sgi-irix5.3
% gmake CC=cc
% gmake CC=cc install


b) Unload the "gcc-2.7.2" distribution. Save the file "collect2.c"
   and make the following changes:


% diff -rc2 collect2.c-orig collect2.c
*** collect2.c-orig     Tue Sep 12 19:08:27 1995
--- collect2.c  Mon Aug  5 12:26:39 1996
***************
*** 921,925 ****
--- 921,929 ----
       char *argv[];
  {
+ #ifdef USE_OLD_LD
+   char *ld_suffix     = "/usr/lib/old_ld";
+ #else
    char *ld_suffix     = "ld";
+ #endif
    char *full_ld_suffix        = ld_suffix;
    char *real_ld_suffix        = "real-ld";
***************
*** 1407,1412 ****
--- 1411,1421 ----
    /* Load the program, searching all libraries.  */
  
+ #ifdef USE_OLD_LD
+   collect_execute ("/usr/lib/old_ld", ld1_argv, ldout);
+   do_wait ("/usr/lib/old_ld");
+ #else
    collect_execute ("ld", ld1_argv, ldout);
    do_wait ("ld");
+ #endif
    dump_file (ldout);
    unlink (ldout);
***************
*** 1510,1514 ****
--- 1519,1527 ----
  
    fork_execute ("gcc",  c_argv);
+ #ifdef USE_OLD_LD
+   fork_execute ("/usr/lib/old_ld", ld2_argv);
+ #else
    fork_execute ("ld", ld2_argv);
+ #endif
  
    /* Let scan_prog_file do any final mods (OSF/rose needs this for

c) Tell the IRIX "cc" compiler to use the "old" 32 bit mode:

% setenv SGI_ABI "-32"

d) configure "gcc" for an IRIX-5.3 environment:

% ./configure --with-gnu-as --with-stabs --host=mips-sgi-irix5.3 \
  --target=mips-sgi-irix5.3 --build=mips-sgi-irix5.3

e) Now bootstrap "gcc" with "USE_OLD_LD" defined:

% gmake LANGUAGES=c CFLAGS="-O2 -DUSE_OLD_LD"
% gmake stage1
% gmake CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -DUSE_OLD_LD"
% gmake stage2
% gmake CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2 -DUSE_OLD_LD"
% gmake CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2 -DUSE_OLD_LD" compare

 You should not see any message from the last step. Finally:

f) Install "gcc":

% gmake CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2 -DUSE_OLD_LD" install


 A final remark: *I* would not use the resulting product for
64-bit code or for "-mips3"/"-mips4". While "gcc" is a very
fine tool, the level of MIPS support is definitely smaller
compared to other CPU's. I guess "mips1/2" got some fair
testing over the years, but "mips3/4" and the new ABI's
(-n32, -64) definitely are to new.

Have more fun
Martin

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]