Re: AIX compilation problems (was Re: Proposal ...) - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: AIX compilation problems (was Re: Proposal ...)
Date
Msg-id Pine.LNX.4.44.0209261955300.1149-100000@localhost.localdomain
Whole thread Raw
In response to Re: AIX compilation problems (was Re: Proposal ...)  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
List pgsql-hackers
Zeugswetter Andreas SB SD writes:

> The problem is, that scan.c includes unistd.h before postgres.h
> and thus unistd.h defines _LARGE_FILE_API which is not allowed
> together with _LARGE_FILES. Do you know an answer ?
> Offhand I can only think of using -D_LARGE_FILES as a compiler flag :-(

That would be pretty tricky to arrange, since the macro that detects all
this is bundled with Autoconf.  Also, it would only fix one particular
manifestation of the overall problem, namely that pg_config.h needs to
come first, period.

I can see two ways to fix this properly:

1. Change the flex call to something like

(echo '#include "postgres.h"'; $(FLEX) -t -o$@) >$@

This would throw off all #line references by one.

2. Direct the flex output to another file, say scan2.c, and create a new
scan.c like this:

#include "postgres.h"
#include "scan2.c"

and create the object file from that.

We have half a dozen flex calls in our tree, so either fix would propagate
a great deal of ugliness around.

> Do we really want a general 64 bit off_t or would it be sufficient in the
> two places that use fseeko ?

It affects all the I/O functions.  If we want to access large files we
need to use the large-file capable function interface.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reconstructing FKs in pg_dump
Next
From: Tom Lane
Date:
Subject: Re: Reconstructing FKs in pg_dump