[gnu.gcc] Compiling gcc on MIPS M/120

protsko@skorpio.usask.ca (Beth Protsko) (12/04/89)

I'm trying to install gcc and g++ on a MIPS M/120 and experience
difficulties.  Can anyone give me an idea of what I am doing wrong.
I followed the directions in the installation file and have got to
the point where I am trying to compile stage1 and get the following 
error for just about every .o file
R_GPREL relocation entry with no global pointer reference.
On thing that I wasn't able to do was to run the program for converting
the library to/from COFF format.  I did try but was again unable to
get the robotussin.c file to compile - that one appears to require
a header file in which the mips version ifdef's out all the declarations
that are needed.  

Beth Protsko

mod@masscomp.ccur.com (2915) (12/17/89)

In article <1989Dec4.142127.25712@dvinci.usask.ca> protsko@skorpio.usask.ca (Beth Protsko) writes:
>I'm trying to install gcc and g++ on a MIPS M/120 and experience
>difficulties.  Can anyone give me an idea of what I am doing wrong.
>I followed the directions in the installation file and have got to
>the point where I am trying to compile stage1 and get the following 
>error for just about every .o file
>R_GPREL relocation entry with no global pointer reference.
>On thing that I wasn't able to do was to run the program for converting
>the library to/from COFF format.  I did try but was again unable to
>get the robotussin.c file to compile - that one appears to require
>a header file in which the mips version ifdef's out all the declarations
>that are needed.  
>
>Beth Protsko

I just ran into this problem in a completely different context, but I
believe that my solution will also work for you.

First, I believe that you are seeing this message displayed by "ld" as it
tries to link everything together, right?   Well, ld is trying to tell you
that he's seen plenty of references to GP relative data, but he's never
seen an explicit reference to the magic "_gp" symbol.  He therefore
believes that you haven't provided any code which initializes the GP
register and he's being anal about letting you proceed.  I wrote software
that loads and executes MIPS COFF files and initializes the GP register
BEFORE jumping into the loaded code.  Since the loaded code never
initialized the GP register "ld" gave me all kinds of trouble.  I then
arranged for the loaded code to make a completely gratuitous reference
to "_gp" so ld would be quiet and let me get on with life.  It was a
violation of "illegitimi non carborundum", but what can you do...

Disassemble your local crt.o file for an example, if you can't find a
better reference.

Good luck.

 ----------------------------------------------------------------------------
   Michael O'Donnell            (508)392-2915             home(508)251-7576
              ___________
             /  ________/__      ...!{harvard,uunet,petsd}!masscomp!mod
            /__/_______/  /      mod@westford.ccur.com
   Concurrent /__________/
     Computer Corporation        1 Technology Way       Westford, MA  01886
 
  DISCLAIMER: My opinions only coincidentally resemble those of my employer.
 ----------------------------------------------------------------------------