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 1l1up8-00050H-QA for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jan 2021 17:29:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l1up7-0006bv-Jd for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jan 2021 17:29:45 +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 1l1up7-0006bo-D2 for pgsql-hackers@lists.postgresql.org; Tue, 19 Jan 2021 17:29:45 +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 1l1up1-0004BP-6j for pgsql-hackers@lists.postgresql.org; Tue, 19 Jan 2021 17:29:44 +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 10JHTa3R484264; Tue, 19 Jan 2021 12:29:36 -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: <20210119165435.45411-1-james.hilliard1@gmail.com> References: <20210119165435.45411-1-james.hilliard1@gmail.com> Comments: In-reply-to James Hilliard message dated "Tue, 19 Jan 2021 09:54:35 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <484262.1611077376.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 19 Jan 2021 12:29:36 -0500 Message-ID: <484263.1611077376@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk James Hilliard writes: > Fixes: > fd.c:3661:10: warning: 'pwritev' is only available on macOS 11.0 or newe= r [-Wunguarded-availability-new] It's still missing preadv, and it still has nonzero chance of breaking successful detection of pwritev on platforms other than yours, and it's still really ugly. But the main reason I don't want to go this way is that I don't think it'll stop with preadv/pwritev. If we make it our job to build successfully even when using the wrong SDK version for the target platform, we're going to be in for more and more pain with other kernel APIs. We could, of course, do what Apple wants us to do and try to build executables that work across versions. I do not intend to put up with the sort of invasive, error-prone source-code-level runtime test they recommend ... but given that there is weak linking involved here, I wonder if there is a way to silently sub in src/port/pwritev.c when executing on a pre-11 macOS, by dint of marking it a weak symbol? regards, tom lane