Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1Arh-00059o-M8 for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Jul 2021 16:57:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m1Arg-0004Gg-Iw for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Jul 2021 16:57:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1Arg-0004GY-CX for pgsql-bugs@lists.postgresql.org; Wed, 07 Jul 2021 16:57:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1Are-0004pr-6v for pgsql-bugs@lists.postgresql.org; Wed, 07 Jul 2021 16:57:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 167GvVGb1860067; Wed, 7 Jul 2021 12:57:31 -0400 From: Tom Lane To: Adrian Ho cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17083: [PATCH] PostgreSQL fails to build with OpenLDAP 2.5.x In-reply-to: References: <17083-a19190d9591946a7@postgresql.org> <1666182.1625579201@sss.pgh.pa.us> <1677203.1625582865@sss.pgh.pa.us> Comments: In-reply-to Adrian Ho message dated "Wed, 07 Jul 2021 15:54:59 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1860065.1625677051.1@sss.pgh.pa.us> Date: Wed, 07 Jul 2021 12:57:31 -0400 Message-ID: <1860066.1625677051@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Ho writes: > Thanks, Tom, that turned out to only require one additional line, since > $LIBS is already being saved and restored around that block: I poked at this a bit further and realized that it's got a showstopper problem: in OpenLDAP 2.4, ldap_simple_bind() exists in both libldap.so and libldap_r.so. Thus, if we were dealing with an installation that does not have a thread-safe libldap, the patched configure would incorrectly seize on libldap.so as being an acceptable substitute, allowing weird hard-to-diagnose failures at runtime. IOW, while it might look from our existing coding like there's something about ldap_simple_bind() that is tied to reentrancy, there isn't. How else can we determine whether an OpenLDAP library is reentrant, if we can no longer depend on the _r suffix? Maybe we can decide that in 2021 such situations no longer exist in the wild, but I'm unsure. regards, tom lane