Re: PostgreSQL 8.3.8 on AIX5.3 : compilation failed

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Alexandra Roy *EXTERN*" <Alexandra(dot)Roy(at)bull(dot)net>
Cc: "pgsql general" <pgsql-general(at)postgresql(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL 8.3.8 on AIX5.3 : compilation failed
Date: 2009-11-10 11:25:01
Message-ID: D960CB61B694CF459DCFB4B0128514C203938025@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

I CC: this to the hackers list as it seems to be an old problem that
was never fixed. See at the bottom.

Alexandra Roy wrote:
> This is a summary of what I have noticed concerning
> PostgreSQL 8.3.8 compilation on AIX 5.3 TL9.
>
> 1. To do a successful 64-bit build, specify and execute:
>
>
> # export OBJECT_MODE="64"
> # export CFLAGS="-maix64"
> # export LDFLAGS="-maix64 -Wl,-bbigtoc"
> # ./configure
> # gmake
> # gmake install

I forgot to answer your question concerning the benefits of a 64-bit build:
You will be able to use more memory.

> 2. To do a successful 32-bit build, you must specify:
>
>
> # export OBJECT_MODE="32"
>
> and use the "-disable-largefile" option with configure :
>
>
> # ./configure -disable-largefile
>
>
> If I use the "-disable-largefile" option, "configure"
> indicates at the end:
>
>
> configure: WARNING: option ignored: --enable-largefile
>
>
> And then, the compilation is successful:
>
>
> All of PostgreSQL successfully made. Ready to install.
>
>
> Without the "-disable-largefile" option, the compilation is
> still failing with this error:
>
>
> In file included from psqlscan.c:2385:
> /usr/include/unistd.h:171: error: conflicting types
> for 'lseek64'
> /usr/include/unistd.h:169: error: previous
> declaration of 'lseek64'
> was here
> In file included from /usr/include/unistd.h:744,
> from psqlscan.c:2385:
> /usr/include/sys/lockf.h:64: error: conflicting
> types for 'lockf64'
> /usr/include/sys/lockf.h:62: error: previous declaration of
> 'lockf64' was here
>
>
> Does someone have an idea about this ?
> Why the "-disable-largefile" option is necessary to do a
> PostgreSQL 8.3.8 32-build ?
> Why the "OBJECT_MODE" exported to 32 is not sufficient ?

I dug around a little, and the problem is in psqlscan.c which is generated
from psqlscan.l by flex.

I found descriptions of the problem in the archives:
http://archives.postgresql.org/pgsql-hackers/2002-09/msg01142.php
http://archives.postgresql.org/pgsql-hackers/2002-09/msg01545.php

The problem is that both _LARGE_FILES and _LARGE_FILE_API are #defined
in this case, which makes #include <unistd.h> fail.

A possible workaround, suggested by Peter Eisentraut at the time, would
be to add this line at the beginning of bin/psql/psqlscan.c:
#include "postgres.h"
This fixes the problem for me.

Does anyone have an idea how to best fix this problem in the
source tree? I'm willing to implement and test.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2009-11-10 11:54:51 Re: Editor for sgml files
Previous Message Alban Hertroys 2009-11-10 11:03:58 Re: Incremental Backups in postgres

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-11-10 13:23:23 Re: accent-insensitive
Previous Message Stephen Tyler 2009-11-10 10:38:14 Re: drop tablespace error: invalid argument