From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
Cc: Dave Page <dpage@pgadmin.org>
Cc: James Hilliard <james.hilliard1@gmail.com>
Cc: David Steele <david@pgmasters.net>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Sergey Shinderuk <s.shinderuk@postgrespro.ru>
Subject: Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.
Date: Tue, 06 Jul 2021 16:34:09 -0400
Message-ID: <1749830.1625603649@sss.pgh.pa.us> (raw)
In-Reply-To: <6ac601c7-9a72-d354-cfaa-03a66108c778@enterprisedb.com>
References: <20210122193230.25295-1-james.hilliard1@gmail.com>
<CADvTj4pZy=BNW00dtOA5LTBDiSMo2bXaea_gh8UQSLOsn+mRNQ@mail.gmail.com>
<ef0dbb86-511d-94a0-de54-ce526c505a4a@pgmasters.net>
<CADvTj4qwmJgqWB5zStrPAxRL2DsPThtwOubAAUPUSh0XSY0JTw@mail.gmail.com>
<CA+hUKGJ9Fsy3Hdgs8BpgBd+J06qo9=4LdGBK5sWxzBt08fENgg@mail.gmail.com>
<CADvTj4oSfH8qN-v_W1ydbA5uJkChxCj8RntwsH-EStytygtALg@mail.gmail.com>
<CA+hUKGJP4nCdi1jKQ5rYJpNwMKVskOA6k=yW36K254ok_6_AZg@mail.gmail.com>
<2781003.1617083917@sss.pgh.pa.us>
<CA+OCxoxNysU7U7VsR2aos5PnapRU6VPWcwGjE7A_aL0ibk4K2w@mail.gmail.com>
<CANFyU95MMxUDF7k4TqhPLMQ9KDyZeET26ocpvmbr8tzawrC1nQ@mail.gmail.com>
<CA+hUKGK6jGpC0dvkWxGDeuMtJo8qhN-a9Dmd40Esnovq7N=eBQ@mail.gmail.com>
<6ac601c7-9a72-d354-cfaa-03a66108c778@enterprisedb.com>
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> I think this change is perfectly appropriate (modulo some small cleanups).
I think there are a couple of issues here.
1. People who are already using MACOSX_DEPLOYMENT_TARGET to control
their builds would like to keep on doing so, but the AC_CHECK_FUNCS
probe doesn't work with that. James' latest patch seems like a
reasonable fix for that (it's a lot less invasive than where we
started from). There is a worry about side-effects on other
platforms, but I don't see an answer to that that's better than
"throw it on the buildfarm and see if anything breaks".
However ...
2. We'd really like to use preadv/pwritev where available. I
maintain that MACOSX_DEPLOYMENT_TARGET is not only not the right
approach to that, but it's actually counterproductive. It forces
you to build for the lowest common denominator, ie the oldest macOS
release you want to support. Even when running on a release that
has pwritev, your build will never use it.
As far as I can tell, the only way to really deal with #2 is to
perform a runtime dlsym() probe to see whether pwritev exists, and
then fall back to our src/port/ implementation if not. This does
not look particularly hard (especially since the lookup code only
needs to work on macOS), though I admit I've not tried to code it.
What's unclear to me at the moment is whether #1 and #2 interact,
ie is there still any point in changing configure's probes if
we put in a runtime check on Darwin? I think that we might want
to pay no attention to what the available header files say about
pwritev, as long as we can get the correct 'struct iovec'
declaration from them.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com, thomas.munro@gmail.com, sandeep.thakkar@enterprisedb.com, dpage@pgadmin.org, james.hilliard1@gmail.com, david@pgmasters.net, pgsql-hackers@lists.postgresql.org, s.shinderuk@postgrespro.ru
Subject: Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.
In-Reply-To: <1749830.1625603649@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox