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 1l1y6r-00059W-Oo for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jan 2021 21:00:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l1y6q-0000B7-Lz for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jan 2021 21:00:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1y6q-0000B0-FZ for pgsql-hackers@lists.postgresql.org; Tue, 19 Jan 2021 21:00:16 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1y6k-0001OF-E3 for pgsql-hackers@lists.postgresql.org; Tue, 19 Jan 2021 21:00:16 +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 10JL085Y522692; Tue, 19 Jan 2021 16:00:08 -0500 From: Tom Lane To: James Hilliard cc: pgsql-hackers@lists.postgresql.org, Sergey Shinderuk , Thomas Munro Subject: Re: [PATCH v2 1/1] Fix detection of pwritev support for OSX. In-reply-to: References: <20210119165435.45411-1-james.hilliard1@gmail.com> <484263.1611077376@sss.pgh.pa.us> Comments: In-reply-to James Hilliard message dated "Tue, 19 Jan 2021 10:55:46 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <522690.1611090008.1@sss.pgh.pa.us> Date: Tue, 19 Jan 2021 16:00:08 -0500 Message-ID: <522691.1611090008@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk James Hilliard writes: > I also don't think this is a weak symbol. > From the header file it is not have __attribute__((weak_import)): > ssize_t pwritev(int, const struct iovec *, int, off_t) > __DARWIN_NOCANCEL(pwritev) __API_AVAILABLE(macos(11.0), ios(14.0), > watchos(7.0), tvos(14.0)); See the other thread. I found by looking at the asm output that what __API_AVAILABLE actually does is cause the compiler to emit a ".weak_reference" directive when calling a function it thinks might not be available. So there's some sort of weak linking going on, though it's certainly possible that it's not shaped in a way that'd help us do this the way we'd prefer. regards, tom lane