Re: MinGW compiled client library - Mailing list pgsql-general

From Craig Ringer
Subject Re: MinGW compiled client library
Date
Msg-id 520ADC1A.8080506@2ndquadrant.com
Whole thread Raw
In response to Re: MinGW compiled client library  (John R Pierce <pierce@hogranch.com>)
List 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


pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: MinGW compiled client library
Next
From: Craig Ringer
Date:
Subject: Re: What type of index do I need for this JOIN?