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 1l0Dep-000166-HB for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Jan 2021 01:12:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l0Deo-0004Rh-ET for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Jan 2021 01:12:06 +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 1l0Deo-0004RZ-5n for pgsql-hackers@lists.postgresql.org; Fri, 15 Jan 2021 01:12:06 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l0Del-00028y-Gu for pgsql-hackers@postgresql.org; Fri, 15 Jan 2021 01:12:05 +0000 Received: from Sergeys-MacBook-Pro.local (unknown [62.217.185.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id DFFBD21C36C7; Fri, 15 Jan 2021 04:12:01 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1610673121; bh=fcyjGnzqIYRWtqf9aaRjZjW5GD9Hhm4dai2lFv07rwE=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=QBF7wK00jvySMYLkaIA5wdoRySBmHdxdvsLMD0EhwjrLsQeD+HDK/lWvbQ7ltvq0G mdJZVrNZnb5SNRqkHeRBl/WCmf4RYDh5vMeXp2iDbIhNKuKLnYnnBPSGKIxm1sw0NT 2cMAKrYYUHK92/mxYgS1lmArGyQgsb8RVTyFa0UQ= Subject: Re: pg_preadv() and pg_pwritev() To: Tom Lane Cc: Thomas Munro , pgsql-hackers References: <341497.1608420857@sss.pgh.pa.us> <20201220224040.evr5pduibvm6dze5@alap3.anarazel.de> <448b3cb5-0ba0-6dc5-63c7-789e4eebc40b@postgrespro.ru> <1283127.1610554395@sss.pgh.pa.us> <1286060.1610558607@sss.pgh.pa.us> <1297389.1610562046@sss.pgh.pa.us> <1341608.1610580122@sss.pgh.pa.us> <1410650.1610638974@sss.pgh.pa.us> <1418166.1610647514@sss.pgh.pa.us> From: Sergey Shinderuk Message-ID: <7e2b4313-0ebb-7959-82f6-48acf88dad11@postgrespro.ru> Date: Fri, 15 Jan 2021 04:12:01 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <1418166.1610647514@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 14.01.2021 21:05, Tom Lane wrote: > After considerable playing around, I'm guessing that the reason > -no_weak_imports doesn't help is that it rejects calls that are > marked as weak references on the *calling* side. Since AC_CHECK_FUNCS > doesn't bother to #include the relevant header file, the compiler > doesn't know that preadv() ought to be marked as a weak reference. > Then, when the test program gets linked against the stub libc that's > provided by the SDK, there is a version of preadv() there so no link > failure occurs. (There are way more moving parts in this weak-reference > thing than I'd realized.) > Oh, that's interesting. I've just played with it a bit and it looks exactly as you say. > Another thing I've been realizing while poking at this is that we > might not need to set -isysroot explicitly at all, which would then > lead to the compiler using its default sysroot automatically. > In some experimentation, it seems like what we need PG_SYSROOT for > is just for configure to be able to find tclConfig.sh and the Perl > header files. So at this point I'm tempted to try ripping that > out altogether. If you remove the lines in src/template/darwin > that inject PG_SYSROOT into CPPFLAGS and LDFLAGS, do things > work for you? Yes, it works fine.