Trouble building 8.1.1 on Tru64 UNIX 5.1

Started by Albert Chinover 20 years ago6 messageshackers
Jump to latest
#1Albert Chin
pgsql-hackers@mlists.thewrittenword.com

While building 8.1.1 on Tru64 UNIX 5.1:
gmake[5]: Leaving directory `/opt/build/postgresql-8.1.1/src/port'
cc -O2 -ieee -msym -readonly_strings -pthread --thread-safe
-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -I./../include
-I. -I../../../../src/include -I/opt/TWWfsw/gettext014/include
-I/opt/TWWfsw/readline50/include -I/opt/TWWfsw/libopenssl097/include
-I/opt/TWWfsw/zlib11/include -I/opt/TWWfsw/tcl84/include
-I/opt/TWWfsw/tk84/include -DMAJOR_VERSION=4 -DMINOR_VERSION=1
-DPATCHLEVEL=1 -c -o preproc.o preproc.c
cc: Error: /usr/include/arpa/nameser_compat.h, line 154: Invalid
declarator. (declarator)
} HEADER;
--^

The problem is that /usr/include/arpa/nameser_compat.h defines a
struct named HEADER. This conflicts with the use of preproc.y in
src/interfaces/ecpg/preproc/preproc.y.

What should it be renamed to?

--
albert chin (china@thewrittenword.com)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Albert Chin (#1)
Re: Trouble building 8.1.1 on Tru64 UNIX 5.1

Albert Chin <pgsql-hackers@mlists.thewrittenword.com> writes:

The problem is that /usr/include/arpa/nameser_compat.h defines a
struct named HEADER. This conflicts with the use of preproc.y in
src/interfaces/ecpg/preproc/preproc.y.

What should it be renamed to?

Perhaps a more relevant question is why ecpg/preproc is including
that header.

regards, tom lane

#3Albert Chin
pgsql-hackers@mlists.thewrittenword.com
In reply to: Tom Lane (#2)
Re: Trouble building 8.1.1 on Tru64 UNIX 5.1

On Mon, Dec 19, 2005 at 05:59:12PM -0500, Tom Lane wrote:

Albert Chin <pgsql-hackers@mlists.thewrittenword.com> writes:

The problem is that /usr/include/arpa/nameser_compat.h defines a
struct named HEADER. This conflicts with the use of preproc.y in
src/interfaces/ecpg/preproc/preproc.y.

What should it be renamed to?

Perhaps a more relevant question is why ecpg/preproc is including
that header.

#include <netdb.h> with -D_REENTRANT includes it.
preproc.c:
#include "postgres_fe.h"
#include "c.h"
#include "port.h"
#include <netdb.h>

ADD has the same problem.

--
albert chin (china@thewrittenword.com)

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Albert Chin (#3)
Re: Trouble building 8.1.1 on Tru64 UNIX 5.1

Albert Chin <pgsql-hackers@mlists.thewrittenword.com> writes:

On Mon, Dec 19, 2005 at 05:59:12PM -0500, Tom Lane wrote:

Perhaps a more relevant question is why ecpg/preproc is including
that header.

#include <netdb.h> with -D_REENTRANT includes it.
preproc.c:
#include "postgres_fe.h"
#include "c.h"
#include "port.h"
#include <netdb.h>

Well, port.h is certainly doing a fine job of polluting the namespace.
Maybe we should pull out the stuff that depends on netdb.h and pwd.h
into some other header that isn't going to get included so widely.

ADD has the same problem.

There's no way that we are going to be able to dodge every single symbol
that any random system header on any random platform might define ---
especially when you get into the less-well-standardized headers like
these. We have to think smaller in terms of what headers we include
everywhere.

regards, tom lane

#5Albert Chin
pgsql-hackers@mlists.thewrittenword.com
In reply to: Tom Lane (#4)
Re: Trouble building 8.1.1 on Tru64 UNIX 5.1

On Mon, Dec 19, 2005 at 06:34:38PM -0500, Tom Lane wrote:

Albert Chin <pgsql-hackers@mlists.thewrittenword.com> writes:

On Mon, Dec 19, 2005 at 05:59:12PM -0500, Tom Lane wrote:

Perhaps a more relevant question is why ecpg/preproc is including
that header.

#include <netdb.h> with -D_REENTRANT includes it.
preproc.c:
#include "postgres_fe.h"
#include "c.h"
#include "port.h"
#include <netdb.h>

Well, port.h is certainly doing a fine job of polluting the namespace.
Maybe we should pull out the stuff that depends on netdb.h and pwd.h
into some other header that isn't going to get included so widely.

ADD has the same problem.

There's no way that we are going to be able to dodge every single symbol
that any random system header on any random platform might define ---
especially when you get into the less-well-standardized headers like
these. We have to think smaller in terms of what headers we include
everywhere.

Well, we've built on most versions of Solaris, HP-UX, AIX, Tru64 UNIX,
Redhat Linux, and IRIX and this is the only symbol conflict we ran
into. So, it's not a big problem.

--
albert chin (china@thewrittenword.com)

#6Bruce Momjian
bruce@momjian.us
In reply to: Albert Chin (#5)
Re: Trouble building 8.1.1 on Tru64 UNIX 5.1

Albert Chin wrote:

On Mon, Dec 19, 2005 at 06:34:38PM -0500, Tom Lane wrote:

Albert Chin <pgsql-hackers@mlists.thewrittenword.com> writes:

On Mon, Dec 19, 2005 at 05:59:12PM -0500, Tom Lane wrote:

Perhaps a more relevant question is why ecpg/preproc is including
that header.

#include <netdb.h> with -D_REENTRANT includes it.
preproc.c:
#include "postgres_fe.h"
#include "c.h"
#include "port.h"
#include <netdb.h>

Well, port.h is certainly doing a fine job of polluting the namespace.
Maybe we should pull out the stuff that depends on netdb.h and pwd.h
into some other header that isn't going to get included so widely.

ADD has the same problem.

There's no way that we are going to be able to dodge every single symbol
that any random system header on any random platform might define ---
especially when you get into the less-well-standardized headers like
these. We have to think smaller in terms of what headers we include
everywhere.

Well, we've built on most versions of Solaris, HP-UX, AIX, Tru64 UNIX,
Redhat Linux, and IRIX and this is the only symbol conflict we ran
into. So, it's not a big problem.

I have converted the symbols that gave you problem (HEAD/ADD) to
HEAD_P/ADD_P. Please test the patch and let me know if things work.
Thanks.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/pgpatches/mipstext/plainDownload+54-54