configure can report this:
configure: WARNING:
*** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
*** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
*** also uses LDAP will crash on exit.
The source code also says
# PostgreSQL sometimes loads libldap_r and plain libldap into the same
# process. Check for OpenLDAP versions known not to tolerate doing so;
assume
# non-OpenLDAP implementations are safe. The dblink test suite
exercises the
# hazardous interaction directly.
The libldap installation that comes with the macOS operating system
reports itself as version 2.4.28, so this warning comes up every time,
but the dblink test suite passes without problem.
I looked into this a bit further. I checked by installing openldap
2.4.31 from source on an centos 7 instance, and indeed the dblink test
suite crashes right away. So the test is still good. I think it's very
likely that Apple has patched around in their libldap code without
changing the version.
I wonder whether we can do something to not make this warning appear
when it's not necessary. The release of openldap 2.4.32 (the first good
one) is now ten years ago, so seeing faulty versions in the wild should
be very rare. I'm tempted to suggest that we can just remove the
warning and rely on the dblink test to catch any stragglers. We could
also disable the test on macOS only. Thoughts?