We needed to install 7.2b3 on Irix 6.5.13 with MIPSpro Compilers:
Version 7.30
when installing as we installed 7.1.3, it is with-template=irix5 adding
to irix5 these lines:
    CC=cc
    CFLAGS='-n32 -O2 -r12000'
    LDFLAGS='-n32 -O2 -r12000'

    where -o2:

                       Turns on extensive optimization.  The
optimizations at
                      this level are generally conservative, in the
sense that
                      they are virtually always beneficial, provide
                      improvements commensurate to the compile time
spent to
                      achieve them, and avoid changes which affect such
things
                      as floating point accuracy.

             -r12000 specifies the processor.

            and -n32: Generates a (new) 32-bit object.

        it is necessary to use cc because gcc gives assembler errors

When installing 7.2b3 we receive after gmake:
        len = offsetof(PgStat_MsgTabpurge, m_tableid[msg.m_nentries])
must have a constant value

I think it's because definition in stddef.h is incompatible with usage
    stdef.h:
        #if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 400)
        #define offsetof(t, memb) ((size_t)__INTADDR__(&(((t
*)0)->memb)))
        #else
        #define offsetof(s, m) (size_t)(&(((s *)0)->m))
        #endif

we managed to install forcing postgres to redefine offsetof, it is
removing #ifndef offsetof
after that it installed of course giving warning in all redefinition,
but it already works.

Hope it helps



Mon, 26 Nov 2001 11:35:13 +0100
Luis Amigo <lamigo@atc.unican.es>
installing 7.2b3 on IRIX 6.5.13
[ redirected from pgsql-admin ]

Luis Amigo <lamigo@atc.unican.es> writes:
> When installing 7.2b3 we receive after gmake:
>         len = offsetof(PgStat_MsgTabpurge, m_tableid[msg.m_nentries])
> must have a constant value

Indeed, a quick look in the C spec says that offsetof is required to
have a constant value, so this coding is unportable.  I've repaired
it in CVS.  Thanks for the report!

It's not clear to me whether we should change template/irix5 or not.
It sounds like gcc is misinstalled on your machine, but that doesn't
necessarily mean that no one is using gcc successfully on IRIX, so
I don't want to force CC=cc.  Possibly this would make sense:

if test "$GCC" = yes ; then
  CFLAGS="-O2"
else
  CFLAGS="-n32 -O2 -r12000"
  LDFLAGS="-n32 -O2 -r12000"
fi

Comments anyone?

			regards, tom lane

Mon, 26 Nov 2001 17:39:30 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: installing 7.2b3 on IRIX 6.5.13 
Tom Lane writes:

> It's not clear to me whether we should change template/irix5 or not.
> It sounds like gcc is misinstalled on your machine, but that doesn't
> necessarily mean that no one is using gcc successfully on IRIX, so
> I don't want to force CC=cc.

One of these days I'm going to write this down somewhere:  GCC + Irix +
PostgreSQL does not work -- until proven otherwise and/or GCC is fixed.
(The reason that the assembly fails is unrelated to this bug; it's just
that no one ever bothered to work on it because there's no use anyway.)
I was going to suggest myself someday that we force CC=cc, but it should
be done in configure.in (near line 274) and not in the template file.

> Possibly this would make sense:
>
> if test "$GCC" = yes ; then
>   CFLAGS="-O2"
> else
>   CFLAGS="-n32 -O2 -r12000"
>   LDFLAGS="-n32 -O2 -r12000"
> fi

We've had successful reports for Irix in the past, so I don't think the -n
and -r flags are strictly necessary -- at least I'd like to see more
information regarding them.  What makes -n32 and -r12000 better than, say,
-n64 and -r6000?

The -O2 seems okay.  Its lack is probably a remnant from the old fmgr
times.

-- 
Peter Eisentraut   peter_e@gmx.net


Tue, 27 Nov 2001 16:36:04 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: installing 7.2b3 on IRIX 6.5.13 
Peter Eisentraut <peter_e@gmx.net> writes:
> One of these days I'm going to write this down somewhere:  GCC + Irix +
> PostgreSQL does not work -- until proven otherwise and/or GCC is fixed.

Oh.  Yup, that should be documented or enforced by configure.

> I was going to suggest myself someday that we force CC=cc, but it should
> be done in configure.in (near line 274) and not in the template file.

Makes sense to me to do it in configure.in.  Shall we go ahead and put
that in?

> We've had successful reports for Irix in the past, so I don't think the -n
> and -r flags are strictly necessary -- at least I'd like to see more
> information regarding them.  What makes -n32 and -r12000 better than, say,
> -n64 and -r6000?

Luis' followup indicated that -r wasn't really needed.  Not sure about -n.

			regards, tom lane

Tue, 27 Nov 2001 10:38:10 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: installing 7.2b3 on IRIX 6.5.13 
Tom Lane wrote:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > One of these days I'm going to write this down somewhere:  GCC + Irix +
> > PostgreSQL does not work -- until proven otherwise and/or GCC is fixed.
>
> Oh.  Yup, that should be documented or enforced by configure.
>
> > I was going to suggest myself someday that we force CC=cc, but it should
> > be done in configure.in (near line 274) and not in the template file.
>
> Makes sense to me to do it in configure.in.  Shall we go ahead and put
> that in?
>
> > We've had successful reports for Irix in the past, so I don't think the -n
> > and -r flags are strictly necessary -- at least I'd like to see more
> > information regarding them.  What makes -n32 and -r12000 better than, say,
> > -n64 and -r6000?
>
> Luis' followup indicated that -r wasn't really needed.  Not sure about -n.
>
>                         regards, tom lane

sorry for following to tom (a mouse mistake)
In our case -n32 (force new 32 bit object(maybe -o32 in old platforms)) was
necessary because with 64 bit object we were getting linking errors.
-rx is processor instruction set, it is not necessary but I recommend it for
better performance.




Tue, 27 Nov 2001 17:56:10 +0100
Luis Amigo <lamigo@atc.unican.es>
Re: installing 7.2b3 on IRIX 6.5.13
Tom Lane wrote:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > One of these days I'm going to write this down somewhere:  GCC + Irix +
> > PostgreSQL does not work -- until proven otherwise and/or GCC is fixed.
>
> Oh.  Yup, that should be documented or enforced by configure.
>
> > I was going to suggest myself someday that we force CC=cc, but it should
> > be done in configure.in (near line 274) and not in the template file.
>
> Makes sense to me to do it in configure.in.  Shall we go ahead and put
> that in?
>
> > We've had successful reports for Irix in the past, so I don't think the -n
> > and -r flags are strictly necessary -- at least I'd like to see more
> > information regarding them.  What makes -n32 and -r12000 better than, say,
> > -n64 and -r6000?
>
> Luis' followup indicated that -r wasn't really needed.  Not sure about -n.
>
>                         regards, tom lane

sorry for replying only to tom (a mouse mistake)
In our case -n32 (force new 32 bit object(maybe -o32 in old platforms)) was
necessary because with 64 bit object we were getting linking errors.
-rx is processor instruction set, it is not necessary but I recommend it for
better performance.

I've been this afternoon search why it fails with gcc and I think I know the
answer:
from sgi.com
gcc vs. cc

                       Code that runs fine when compiled with SGI cc and
doesn't run when compiled with gcc
                       might be calling one of the following functions:

                               inet_ntoa, inet_lnaof, inet_netof,
inet_makeaddr, semctl

                       (there may be others). These are functions that get
passed or return structs that are smaller than
                       16 bytes but not 8 bytes long. gcc and SGI cc are
incompatible in the way they pass these
                       structs so compiling with gcc and linking with the SGI
libc.so (which was compiled with
                       the SGI cc) is likely to cause these problems. Note that
this problem is pretty rare since such
                       functions are not widely used. This may be considered a
bug in gcc but is too involved to fix

this is fixed in gcc libs libgcc.a I'm not sure if it works cause I can't drop
the database just now maybe tomorrow,
If  I can test it tomorrow I'll tell you
Hope it helps
    best wishes



Tue, 27 Nov 2001 18:55:27 +0100
Luis Amigo <lamigo@atc.unican.es>
Re: installing 7.2b3 on IRIX 6.5.13
Tom Lane wrote:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > One of these days I'm going to write this down somewhere:  GCC + Irix +
> > PostgreSQL does not work -- until proven otherwise and/or GCC is fixed.
>
> Oh.  Yup, that should be documented or enforced by configure.
>
> > I was going to suggest myself someday that we force CC=cc, but it should
> > be done in configure.in (near line 274) and not in the template file.
>
> Makes sense to me to do it in configure.in.  Shall we go ahead and put
> that in?
>
> > We've had successful reports for Irix in the past, so I don't think the -n
> > and -r flags are strictly necessary -- at least I'd like to see more
> > information regarding them.  What makes -n32 and -r12000 better than, say,
> > -n64 and -r6000?
>
> Luis' followup indicated that -r wasn't really needed.  Not sure about -n.
>
>                         regards, tom lane

I forgot to say but sure you know that inet_ntoa is widely used but only
critical is:
./postmaster/postmaster.c:2036:         host_addr =
inet_ntoa(port->raddr.in.sin_addr);
sorry for repeating
regards



Tue, 27 Nov 2001 18:57:42 +0100
Luis Amigo <lamigo@atc.unican.es>
Re: installing 7.2b3 on IRIX 6.5.13
Luis Amigo <lamigo@atc.unican.es> writes:
> In our case -n32 (force new 32 bit object(maybe -o32 in old platforms)) was
> necessary because with 64 bit object we were getting linking errors.

Is it worth trying to find and fix the cause of that?  On other
platforms that can build either 32- or 64-bit executables (eg, HPUX 11)
Postgres works in either mode.  So I think it's probably just some
minor tweak needed for IRIX.  It'd be better to let the user choose
which he wants than to force it in the template.

> -rx is processor instruction set, it is not necessary but I recommend it for
> better performance.

Again, it doesn't seem that we should try to guess the right value in
the template (unless IRIX has some command that the template script
could execute to get the right value?).  The user can always specify
the CFLAGS he wants configure to use.

			regards, tom lane

Wed, 28 Nov 2001 10:48:33 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: installing 7.2b3 on IRIX 6.5.13 