Re: Problem with ControlFileData structure being ABI dependent

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Rainer Bauer" <usenet(at)munnin(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problem with ControlFileData structure being ABI dependent
Date: 2007-12-06 23:07:33
Message-ID: 87mysnpglm.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Rainer Bauer" <usenet(at)munnin(dot)com> writes:

> Gregory Stark wrote:
>
>>This is because of (at least) two changes in the ABI between the runtimes used
>>by mingw and VC++.
>> 1) Enums are apparently 8 bytes on VC++ but 4 bytes on mingw
>
> They are 4 bytes here on my 32 bit WinXP machine with VS2005SP1.

Oh, I bet it's not the enum which is 8 bytes but that the time_t required
8-byte alignment so there's 4 bytes of padding before it.

>> 2) time_t is 8 bytes on VC++ but 4 bytes on mingw.
>
> Not sure whether an 8 byte time_t is now required by postgres. But you can get
> the old behaviour by defining _USE_32BIT_TIME_T.

Ugh.

The immediate problem is that a database initialized with with MSVCC can't be
run under mingw and vice versa. That's not necessarily important but it does
seem like it would be nice.

The looming problem is that you won't be able to use any libraries or 3rd
party tools which use time_t in their interface unless you build with the same
size time_t as they do. I don't know how're expected to find out that a .so
you're handed has a different size time_t.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's RemoteDBA services!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rainer Bauer 2007-12-06 23:25:40 Re: Problem with ControlFileData structure being ABI dependent
Previous Message Rainer Bauer 2007-12-06 22:45:26 Re: Problem with ControlFileData structure being ABI dependent