Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJ2mf-00049H-NM for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2016 18:03:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bJ2mf-0006q4-A4 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2016 18:03:21 +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.84_2) (envelope-from ) id 1bJ2lI-0005Kl-Re for pgsql-hackers@postgresql.org; Fri, 01 Jul 2016 18:01: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.84_2) (envelope-from ) id 1bJ2lF-0001CE-L2 for pgsql-hackers@postgresql.org; Fri, 01 Jul 2016 18:01:56 +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 u61I1gJm029823; Fri, 1 Jul 2016 14:01:42 -0400 From: Tom Lane To: Michael Paquier cc: Christoph Berg , Robert Haas , PostgreSQL mailing lists Subject: Re: Broken handling of lwlocknames.h In-reply-to: References: <31398.1467036827@sss.pgh.pa.us> <20160627182256.GB8514@msg.df7cb.de> Comments: In-reply-to Michael Paquier message dated "Tue, 28 Jun 2016 12:26:00 +0900" Date: Fri, 01 Jul 2016 14:01:42 -0400 Message-ID: <29822.1467396102@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Michael Paquier writes: > Yes that would be indeed cleaner this way. I have poked a bit at that > and finished with the attached that defines some rules to generate all > the files needed. But actually it does not seem to be enough, for > example on OSX this would fail to compile because it cannot find the > postgres binary in src/backend/postgres. Does somebody have an idea > what this is about? It seems that we have two problems here. Yeah, on OS X, building regress.so (or any other loadable extension) will fail unless you built the backend first: gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -g -O2 -bundle -multiply_defined suppress -Wl,-undefined,dynamic_lookup -o regress.so regress.o -L../../../src/port -L../../../src/common -Wl,-dead_strip_dylibs -bundle_loader ../../../src/backend/postgres ld: file not found: ../../../src/backend/postgres The reason is you need the "-bundle_loader postgres" option, because OS X's linker is pickier about unresolved symbols than Linux's. However, that is not a 9.6 regression: that's never worked on OS X, or at least not since we started using -bundle_loader. I do not think that we want the makefiles to enforce this build dependency, as that would completely destroy any speed advantage of trying to build just the particular .so. Maybe we could enforce the dependency just on OS X, but since we haven't gotten complaints from people trying to build like this on OS X, I doubt it's worth the trouble. So my inclination is to fix the include-file issue and call it good. In any case, if someone did want to deal with making the -bundle_loader calls safer, it would be material for a separate patch IMO. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers