Re: MinGW compiled client library

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, mike(at)cchtml(dot)com
Subject: Re: MinGW compiled client library
Date: 2013-08-14 01:23:38
Message-ID: 520ADC1A.8080506@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/14/2013 08:57 AM, John R Pierce wrote:
>
> no. GCC uses a totally different libc in its generated code. that alone
> ensures its binaries are not directly comparable. linking code with
> incompatible libc's is gonna result in some gnarly messes, imagine what
> kind of ugly stuff could happen if you used one malloc and another free ?

Windows code is required to defend against this and PostgreSQL is no
exception.

It's very common on Windows for different libraries to use different
libcs. Horrible, but common. They deal with this by doing things like:

* Always free()ing memory in the same module it was malloc()'d in;
* Never passing file handles around, instead using wrapper functions;

etc.

libpq compiled with gcc should work in an MSVC-compiled executable so
long as the port/ code for mingw is correct and there are no
undiscovered portability bugs.

In this case I'm wondering if we've got an issue with selection of
socket flags. Michael, can you try some older versions and see if you
can find when this problem first appeared? Does it only affect mingw-64,
or is the 32-bit version affected too?

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2013-08-14 01:27:24 Re: What type of index do I need for this JOIN?
Previous Message John R Pierce 2013-08-14 00:57:05 Re: MinGW compiled client library