Refactor dlopen() support

Enterprise / PostgreSQL - Peter Eisentraut [gmx.net] - 6 September 2018 09:33 EDT

Nowadays, all platforms except Windows and older HP-UX have standard dlopen() support. So having a separate implementation per platform under src/backend/port/dynloader/ is a bit excessive. Instead, treat dlopen() like other library functions that happen to be missing sometimes and put a replacement implementation under src/port/.

Discussion: https://www.postgresql.org/message-id/flat/e11a49cb-570a-60b7-707d-7084c8de0e61%402ndquadrant.com#54e735ae37476a121abb4e33c2549b03

842cb9fa62 Refactor dlopen() support
configure | 43 +++++++++++--
configure.in | 8 +--
src/backend/Makefile | 2 +-
src/backend/port/.gitignore | 1 -
src/backend/port/Makefile | 2 +-
src/backend/port/dynloader/aix.c | 7 ---
src/backend/port/dynloader/aix.h | 39 ------------
src/backend/port/dynloader/cygwin.c | 3 -
src/backend/port/dynloader/cygwin.h | 36 -----------
src/backend/port/dynloader/darwin.c | 35 -----------
src/backend/port/dynloader/darwin.h | 8 ---
src/backend/port/dynloader/freebsd.c | 7 ---
src/backend/port/dynloader/freebsd.h | 38 ------------
src/backend/port/dynloader/hpux.c | 68 --------------------
src/backend/port/dynloader/hpux.h | 25 --------
src/backend/port/dynloader/linux.c | 7 ---
src/backend/port/dynloader/linux.h | 38 ------------
src/backend/port/dynloader/netbsd.c | 7 ---
src/backend/port/dynloader/netbsd.h | 38 ------------
src/backend/port/dynloader/openbsd.c | 7 ---
src/backend/port/dynloader/openbsd.h | 38 ------------
src/backend/port/dynloader/solaris.c | 7 ---
src/backend/port/dynloader/solaris.h | 38 ------------
src/backend/port/dynloader/win32.h | 19 ------
src/backend/postmaster/postmaster.c | 1 -
src/backend/utils/fmgr/dfmgr.c | 31 +++++-----
src/include/.gitignore | 1 -
src/include/Makefile | 4 +-
src/include/pg_config.h.in | 8 +++
src/include/pg_config.h.win32 | 8 +++
src/include/port.h | 23 +++++++
src/include/utils/dynamic_loader.h | 25 --------
.../port/dynloader/win32.c => port/dlopen.c} | 72 ++++++++++++++++++++--
src/tools/msvc/Install.pm | 5 +-
src/tools/msvc/Mkvcbuild.pm | 5 +-
src/tools/msvc/Solution.pm | 7 ---
src/tools/msvc/clean.bat | 1 -
37 files changed, 172 insertions(+), 540 deletions(-)

Upstream: git.postgresql.org


  • Share