Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-12-14T16:14:14Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Remove troublesome Asserts in cost_mergejoin().

  2. Enable building with the Mingw64 compiler.

Andrew Dunstan <andrew@dunslane.net> writes:
>>> Done and done (see
>>> <https://sourceforge.net/tracker/?func=detail&aid=3458244&group_id=202880&atid=983354>). 

>> Did you see Kai's update on the ticket? If this is the case, I know 
>> that we have seen similar bugs with PostGIS and the work-around has 
>> been to add -ffloat-store to the compiler flags for the affected files 
>> if that helps?

> Hmm. Yeah, if I remove -O0 and instead set CFLAGS to -ffloat-store the 
> error goes away.

Hmm, we have been bit by that recently elsewhere:
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=ff68b256a533b398e3420750f34d161aeee4e099

I suspect what you are looking at is not at all mingw-specific but will
soon start showing up on other x86 platforms.  I see from the bug report
that that's gcc 4.7.0, which hasn't made it into most distros yet but
surely will soon.

> So, would we want to use that just for this file, or for the whole build?

-ffloat-store is a brute force solution, I think, and would affect old
versions of gcc that don't exhibit any problems.  I would suggest
altering configure to see whether the compiler recognizes
-fexcess-precision=standard and adding that to CFLAGS if so.

			regards, tom lane