Subject: Re: Support for different MIPS (I, II, III, IV)
To: None <port-cobalt@netbsd.org>
From: Ian Spray <cobalt@minimal.cx>
List: port-cobalt
Date: 12/03/2002 12:22:44
On Sun, Dec 01, 2002 at 03:30:38AM +0100, Rodrigo Fernandez-Vizarra wrote:
> 
> I've been doing some research on this and I realized that the problem is 
> that the compiler is not using MIPS II instruction set because 
> 
I have submitted a fix to the PostgreSQL team on the 6th of June this year
for 7.2.1 that doesn't appear to have made it anywhere useful - Googling will
bring up my post, but failing that this is what I did to get PgSQL up on my
Qube 2 (NetBSD 1.6):

* cd /usr/pkgsrc/database/postgresql-server
* sudo make
* wait for it to fail (or, if you're happy with interrupting the port process
  just break out once the patches have been applied)
* cd work/postgresql-7.2.3/src/template
* edit file netbsd and add the following lines:

  CFLAGS=-O2
  case $host_cpu in
    cobalt*)  CFLAGS="$CFLAGS -mips2";;
  esac

I can't recall if I left the current netbsd file alone or if I simlply
copied the linux one and edited the host name.  I can't recall if I left the
netbsd CFLAGS statement (with the -pipe in it) in there or not - my ports
tree has been cleaned since I did this.

This works for me (I also modifed the kernel config, but that's all detailed
in the PgSQL notes) and the general feeling on the PgSQL list was that this
fix was clean and should be used.  I haven't checked the latest 7.3 to see
if it's in there, but try this and see if you can build it all ok.

I suppose the other option is to get the NetBSD PgSQL port maintainer to
include this mod, but it seemed more useful to get it into the main tree, as
it's a low impact fix.

HTH,
-- 
Ian Spray