Re: narwhal and PGDLLIMPORT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: narwhal and PGDLLIMPORT
Date: 2014-10-26 22:52:12
Message-ID: 14085.1414363932@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Noah Misch <noah(at)leadboat(dot)com> writes:
> Calls to ldap_init() exhibit the same problem shfolder.dll:SHGetFolderPath()
> exhibited: it loads and unloads some DLLs, and it manages to unload libpq in
> passing. There's nothing comparable to the above workaround this time, but I
> found a more fundamental fix.
> ...
> libpqdll.def uses "LIBRARY LIBPQ", which yields an internal name of
> "LIBPQ.dll" under MinGW-w64 i686-4.9.1-release-win32-dwarf-rt_v3-rev1. Our
> MSVC build process also gives "LIBPQ.dll". Under narwhal's older toolchain,
> libpq.dll gets a name of just "LIBPQ". The attached patch brings the product
> of narwhal's toolchain in line with the others. I don't know by what magic
> wldap32.dll:ldap_init() and shfolder.dll:SHGetFolderPath() care about finding
> ".dll" in the names of loaded libraries, but it does fix the bug.

Nice detective work!

> This erases the impetus for my recent commit 53566fc. I'm inclined to keep
> that commit in the name of consistency with the MSVC build, but one could
> argue for reverting its 9.4 counterpart. I don't feel strongly either way, so
> I expect to let 2f51f42 stand.

Yeah, I lean the same way. The fewer differences in the results of our
assorted Windows build processes, the better.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2014-10-26 22:56:33 Re: pg_dump/pg_restore seem broken on hamerkop
Previous Message David Rowley 2014-10-26 22:40:24 pset_quoted_string is broken