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 1g5twA-0002dM-Ce for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Sep 2018 14:40:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5tw8-0004xI-8s for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Sep 2018 14:40:08 +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 1g5tw8-0004xA-1g for pgsql-hackers@lists.postgresql.org; Fri, 28 Sep 2018 14:40:08 +0000 Received: from mail-yw1-xc42.google.com ([2607:f8b0:4864:20::c42]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5tw1-0007L0-Tn for pgsql-hackers@lists.postgresql.org; Fri, 28 Sep 2018 14:40:07 +0000 Received: by mail-yw1-xc42.google.com with SMTP id e201-v6so2720141ywa.3 for ; Fri, 28 Sep 2018 07:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Oqz6pmm4amdwz22nfwLXUJLC9toF5rGCNNOslBZlysQ=; b=O8o/dUMESR9Bt1Z7e06hFVujxjg3kzVFHg2A8Y/vPY2fhYPLpEIS6CBarPrsYDMkar 8jtZ3GauXXxqH3csqe2yRH1RjJ/ZcBNnqq2DNHAMjgLGinRkRnQvLgLcsWaKgrVeA8G0 loKYTA96r8uVN7NEiCBnG1PvUTo6LGPv+cr1l1A4uXUHPpYaeLlpi3UWgiQmssXHTWgt D85EXF3qqikgSDMd745kXW4WN4QeqCyIOh5HgBgaMIhnJmrdS8q1FVoQDQCsC+i2exBt YyYv21jZBqs0APyjGWTp5dtk9jHmMn2YF5gU3AztPLuk/J4stlxFXbAdsb2Qt81mX9Lz dK1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Oqz6pmm4amdwz22nfwLXUJLC9toF5rGCNNOslBZlysQ=; b=hXSBrC+e98mwpP/JKmAIKUNXLm60kjOIBYn8MitOwrF1Phr9yEmNRTLaXk3qP7WAt4 03kFjWsDq7NNHBClpTxGjY/x6C43L7LPtoXhVUOy2qgG8H+hFUVh8m1n9cWrk/g2BOfR 1CvFQhSCf5QqiZMqxssLrfIDV9DxVduPVbEX+Z9OAJ8AnjcMMEaQtewkvVDv4Psfmkom M+vjkhpcBzlwV4wzGAsRgJ7KszjYB2ea+8yxg26DafYv2T5aheZesP8NloXcr3019YQY oCoI1OWz0nYqtcGrKtn1dfIcr7AiJXIH7AWrhgroZ/64YKRwYzDgt47aQyKEsFXgIjRJ Tmgw== X-Gm-Message-State: ABuFfogXWR5HGmr0rlRbWxRvhsTlXWOFCFc9/FlkeeApfV1ji6bV2Gjz nZc22yL91JAjo5LX0SS1l5CzTKjr5iR0D8GaatALGLjniyJMoeYkNU4Yckm4VuwZSyOBzsdTIXZ 8Dz6p24V/YJpCFMtduqc+HEDBzQsEwMBQjvcAQYFDwHMdAB6e57ZefRdoD5HBfHjQ8F+pqrla2T VjIb+w5+iST71MOO4gatjL X-Google-Smtp-Source: ACcGV61Fr1XMGzrvuIQi2vkzBLeWML7t+WcxlsZbcP18ZsZj8wMvI4WJQT66g1c9lC4+XYaUmNeunQ== X-Received: by 2002:a0d:c143:: with SMTP id c64-v6mr8607342ywd.433.1538145600069; Fri, 28 Sep 2018 07:40:00 -0700 (PDT) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id p62-v6sm2343033ywh.73.2018.09.28.07.39.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 07:39:59 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: Let's stop with the retail rebuilds of src/port/ files already To: Tom Lane , Andres Freund Cc: pgsql-hackers@lists.postgresql.org References: <13022.1538003440@sss.pgh.pa.us> <20180926231331.pngbiyqaawrxgnwf@alap3.anarazel.de> <6570.1538020985@sss.pgh.pa.us> <19581.1538077716@sss.pgh.pa.us> Message-ID: <4d8022f7-5e25-e5b0-0926-4a99d60f3ffb@2ndQuadrant.com> Date: Fri, 28 Sep 2018 10:39:58 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <19581.1538077716@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-MW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 09/27/2018 03:48 PM, Tom Lane wrote: > I wrote: >> Here's a partial patch for that: it adds the third build variant >> to src/port/ and teaches libpq to use it. We'd want to likewise >> modify src/common/ and fix up other callers such as ecpg, but this >> seems to be enough to test whether the idea works or not. >> ... >> What I think would make sense is to push this and see what the >> buildfarm thinks of it. If there are unfixable problems then >> we won't have wasted time fleshing out the concept. Otherwise, >> I'll do the remaining pieces. > Well, the buildfarm did turn up one problem: on really old macOS > (cf prairiedog) the libpq link step fails with > > ld: symbols names listed in -exported_symbols_list: exports.list not in linked objects > _pqsignal > > Apparently, with that linker, the exported symbols list is resolved > against just what is found in the listed *.o files, not anything pulled > in from a library file. > > Now, the question that raises in my mind is why is libpq.so exporting > pqsignal() at all? Probably there was once a reason for it, but nowadays > I would think that any client program using pqsignal() should get it > from -lpgport, not from libpq. Having more than one place to get it from > seems more likely to create issues than solve them. And we certainly > do not document it as a function available from libpq. > > So my recommendation is to remove pqsignal from libpq's exports.txt. > I've verified that prairiedog builds happily with that change, > confirming my expectation that all consumers of the symbol can get it > from someplace else. > > Now, if we go forward with that solution, there will be issues with > some other things that libpq exports without having defined itself: > > src/backend/utils/mb/wchar.c: > pg_utf_mblen > src/backend/utils/mb/encnames.c: > pg_encoding_to_char > pg_char_to_encoding > pg_valid_server_encoding > pg_valid_server_encoding_id > > Now, I'd already had my eye on those two files, because after applying a > similar fix for src/common/, those two files would be the only ones that > libpq needs to symlink from somewhere else. > > What I was thinking of proposing was to move those two files out of the > backend and into src/common/, thereby normalizing their status as > modules available in both frontend and backend, and removing the need > for a special build rule for them in libpq. (initdb could be simplified > too.) Per this discovery, we'd need to also remove these symbols from > libpq's exports list, meaning that clients *must* get them from -lpgcommon > not from libpq. > > There's a small chance that this'd break third-party clients that > are using these symbols out of libpq. We've never documented them > as being available, but somebody might be using them anyway. > If that does happen, it could be repaired by linking against -lpgcommon > along with libpq, but it'd possibly still make people unhappy. > Seems a small enough price to pay. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services