Article View: comp.sys.sgi.bugs
Article #106Re: IRIX-6.2 / gcc2.7.2 **?!@!?**
From: lian
Date: Tue, 20 Aug 1996 00:00
Date: Tue, 20 Aug 1996 00:00
174 lines
6546 bytes
6546 bytes
Peter Maurice-Jones wrote:
>
> Hi
>
> i found an old news post but i can't find the forerunner to it. It
> says you can compile gcc-2.7.2 on IRIX-6.2. This appears to be a holy
> grail since i can find no step-by-step guide to achieve this.
>
> As a last hope i wonder if anyone out there has done this and could
> post to me how to compile gcc-2.7.2 on an SGI-indy-R4600-IRIX6.2. I
> have as a starting point the SGI cc compiler...
>
> Any pointers would be great - Pete
>
> --
> Peter Maurice-Jones e-mail: peter.mj@amoco.com
> Amoco Services Limited Unix Systems Administrator
I have saved the message, but I haven't tried it ( I get no time because
of our R10K-impact)
Here is the news:
++++++++++++++++++++++++++++++++++++++++++++++++
Hi,
some people apparently missed my post of Monday August 5th.
Here it is again with some additional remarks and corrections.
Martin
===============================================================
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=ccc 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
--
+---------------------------------+-----------------------------------+
|Martin Knoblauch | Silicon Graphics GmbH |
|Manager Application Center | Am Hochacker 3 - Technopark |
|Silicon Graphics Computer Systems| D-85630 Grasbrunn-Neukeferloh, FRG|
| | Phone: (+int) 89 46108-179 or -0 |
| | Fax: (+int) 89 46108-190 (-222) |
+---------------------------------+-----------------------------------+
|e-mail: <knobi@munich.sgi.com> | V-Mail: 5-8935 | M/S: IDE-3150 |
+---------------------------------------------------------------------+
--
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Lian SHEN ETHZ; Swiss Federal Institute of Technology in Zurich
P.A.M. Dirac: "God is a mathematician of very high order, and he
used very advanced mathematics in constructing the universe."
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Technical Details
Message-ID:
<32199BBC.2781@lsm.iet.mavt.ethz.ch>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<x2pzq3qa0w4.fsf@amoco.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,bae4de518e556e20 X-Google-Attributes: gid11318c,public X-Google-Thread: 100159,bae4de518e556e20 X-Google-Attributes: gid100159,public X-Google-Thread: 10fdc2,bae4de518e556e20 X-Google-Attributes: gid10fdc2,public X-Google-Thread: 10872d,bae4de518e556e20 X-Google-Attributes: gid10872d,public From: lian <lian@lsm.iet.mavt.ethz.ch> Subject: Re: IRIX-6.2 / gcc2.7.2 **?!@!?** Date: 1996/08/20 Message-ID: <32199BBC.2781@lsm.iet.mavt.ethz.ch> X-Deja-AN: 175290522 references: <x2pzq3qa0w4.fsf@amoco.com> to: Peter Maurice-Jones <peter.mj@amoco.com> content-type: text/plain; charset=us-ascii organization: Swiss Federal Institute of Technology mime-version: 1.0 newsgroups: comp.sys.sgi.bugs,comp.sys.sgi.admin,comp.sys.sgi.misc,gnu.gcc.help x-mailer: Mozilla 2.01S (X11; I; IRIX 6.2 IP20)