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

Andrew Dunstan <andrew@dunslane.net>

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


On 12/14/2011 11:14 AM, Tom Lane wrote:
> -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.


OK, this and the associated configure change seems to do the trick:

    diff --git a/configure.in b/configure.in
    index 9cf084d..b29bb61 100644
    --- a/configure.in
    +++ b/configure.in
    @@ -437,6 +437,8 @@ if test "$GCC" = yes -a "$ICC" = no; then
        PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])
        # Disable optimizations that assume no overflow; needed for gcc 4.3+
        PGAC_PROG_CC_CFLAGS_OPT([-fwrapv])
    +  # Disable FP optimizations that cause isinf errors on gcc 4.5+
    +  PGAC_PROG_CC_CFLAGS_OPT([-fexcess-precision=standard])
      elif test "$ICC" = yes; then
        # Intel's compiler has a bug/misoptimization in checking for
        # division by NAN (NaN == 0), -mp1 fixes it, so add it to the
    CFLAGS.


I guess we should backpatch it?

cheers

andrew