Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6HHk-0003Hh-5K for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Sep 2018 15:36:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g6HHg-0002D2-8v for pgsql-hackers@arkaria.postgresql.org; Sat, 29 Sep 2018 15:35:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6HHg-0002Cv-1m for pgsql-hackers@lists.postgresql.org; Sat, 29 Sep 2018 15:35:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g6HHc-0000Q5-UT for pgsql-hackers@lists.postgresql.org; Sat, 29 Sep 2018 15:35:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8TFZlix001057; Sat, 29 Sep 2018 11:35:47 -0400 From: Tom Lane To: Andrew Dunstan cc: pgsql-hackers@lists.postgresql.org Subject: Cygwin linking rules MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1055.1538235347.1@sss.pgh.pa.us> Date: Sat, 29 Sep 2018 11:35:47 -0400 Message-ID: <1056.1538235347@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Most of the buildfarm is now happy with the changes I made to have libpq + ecpg get src/port and src/common files via libraries ... but lorikeet isn't. It gets through the core regression tests fine (so libpq, per se, works), but contrib/dblink fails: ! ERROR: could not establish connection ! DETAIL: libpq is incorrectly linked to backend functions What this means is that libpq is calling the backend version of src/common/link-canary.c rather than the frontend version. Why would it do the right thing normally and the wrong thing in dblink? I can think of a few theories but I lack the ability to investigate: 1. Maybe the dblink.dll build is pulling in libpq.a rather than establishing a reference to libpq.dll. If so, the wrong things would happen because libpq.a won't contain the src/common/ files that libpq needs. (It seems like libpq.a is an active hazard given this. Why are we building it at all?) 2. Maybe we need a --version-script option or something equivalent to get libpq.dll's references to be preferentially resolved internally rather than to the backend. But this doesn't really explain why it worked properly before. regards, tom lane