mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
Remove obsolete linux dynloader code
This has been obsolete probably since the late 1990s.
This commit is contained in:
parent
b5d29299cc
commit
351855fc4e
2
configure
vendored
2
configure
vendored
@ -12495,7 +12495,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
|
||||
fi
|
||||
|
||||
|
||||
for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
|
||||
for ac_header in atomic.h crypt.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
|
||||
do :
|
||||
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
|
||||
|
@ -1260,7 +1260,7 @@ AC_SUBST(UUID_LIBS)
|
||||
|
||||
AC_HEADER_STDBOOL
|
||||
|
||||
AC_CHECK_HEADERS([atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h])
|
||||
AC_CHECK_HEADERS([atomic.h crypt.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h])
|
||||
|
||||
# On BSD, test for net/if.h will fail unless sys/socket.h
|
||||
# is included first.
|
||||
|
@ -1,133 +1,7 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
/*
|
||||
* src/backend/port/dynloader/linux.c
|
||||
*
|
||||
* linux.c
|
||||
* Dynamic Loader for Postgres for Linux, generated from those for
|
||||
* Ultrix.
|
||||
* Dummy file used for nothing at this point
|
||||
*
|
||||
* You need to install the dld library on your Linux system!
|
||||
*
|
||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* src/backend/port/dynloader/linux.c
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
* see linux.h
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#ifdef HAVE_DLD_H
|
||||
#include <dld.h>
|
||||
#endif
|
||||
|
||||
#include "dynloader.h"
|
||||
#include "miscadmin.h"
|
||||
|
||||
|
||||
#ifndef HAVE_DLOPEN
|
||||
|
||||
void *
|
||||
pg_dlopen(const char *filename)
|
||||
{
|
||||
#ifndef HAVE_DLD_H
|
||||
elog(ERROR, "dynamic load not supported");
|
||||
return NULL;
|
||||
#else
|
||||
static int dl_initialized = 0;
|
||||
|
||||
/*
|
||||
* initializes the dynamic loader with the executable's pathname. (only
|
||||
* needs to do this the first time pg_dlopen is called.)
|
||||
*/
|
||||
if (!dl_initialized)
|
||||
{
|
||||
if (dld_init(dld_find_executable(my_exec_path)))
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* if there are undefined symbols, we want dl to search from the
|
||||
* following libraries also.
|
||||
*/
|
||||
dl_initialized = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* link the file, then check for undefined symbols!
|
||||
*/
|
||||
if (dld_link(filename))
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* If undefined symbols: try to link with the C and math libraries! This
|
||||
* could be smarter, if the dynamic linker was able to handle shared libs!
|
||||
*/
|
||||
if (dld_undefined_sym_count > 0)
|
||||
{
|
||||
if (dld_link("/usr/lib/libc.a"))
|
||||
{
|
||||
elog(WARNING, "could not link C library");
|
||||
return NULL;
|
||||
}
|
||||
if (dld_undefined_sym_count > 0)
|
||||
{
|
||||
if (dld_link("/usr/lib/libm.a"))
|
||||
{
|
||||
elog(WARNING, "could not link math library");
|
||||
return NULL;
|
||||
}
|
||||
if (dld_undefined_sym_count > 0)
|
||||
{
|
||||
int count = dld_undefined_sym_count;
|
||||
char **list = dld_list_undefined_sym();
|
||||
|
||||
/* list the undefined symbols, if any */
|
||||
do
|
||||
{
|
||||
elog(WARNING, "\"%s\" is undefined", *list);
|
||||
list++;
|
||||
count--;
|
||||
} while (count > 0);
|
||||
|
||||
dld_unlink_by_file(filename, 1);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (void *) strdup(filename);
|
||||
#endif
|
||||
}
|
||||
|
||||
PGFunction
|
||||
pg_dlsym(void *handle, const char *funcname)
|
||||
{
|
||||
#ifndef HAVE_DLD_H
|
||||
return NULL;
|
||||
#else
|
||||
return (PGFunction) dld_get_func((funcname));
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
pg_dlclose(void *handle)
|
||||
{
|
||||
#ifndef HAVE_DLD_H
|
||||
#else
|
||||
dld_unlink_by_file(handle, 1);
|
||||
free(handle);
|
||||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
pg_dlerror(void)
|
||||
{
|
||||
#ifndef HAVE_DLD_H
|
||||
return "dynaloader unsupported";
|
||||
#else
|
||||
return dld_strerror(dld_errno);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* !HAVE_DLOPEN */
|
||||
|
@ -15,12 +15,7 @@
|
||||
#define PORT_PROTOS_H
|
||||
|
||||
#include "utils/dynamic_loader.h" /* pgrminclude ignore */
|
||||
#ifdef HAVE_DLOPEN
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
|
||||
/*
|
||||
* In some older systems, the RTLD_NOW flag isn't defined and the mode
|
||||
@ -39,6 +34,5 @@
|
||||
#define pg_dlsym dlsym
|
||||
#define pg_dlclose dlclose
|
||||
#define pg_dlerror dlerror
|
||||
#endif /* HAVE_DLOPEN */
|
||||
|
||||
#endif /* PORT_PROTOS_H */
|
||||
|
@ -186,9 +186,6 @@
|
||||
don't. */
|
||||
#undef HAVE_DECL_VSNPRINTF
|
||||
|
||||
/* Define to 1 if you have the <dld.h> header file. */
|
||||
#undef HAVE_DLD_H
|
||||
|
||||
/* Define to 1 if you have the `dlopen' function. */
|
||||
#undef HAVE_DLOPEN
|
||||
|
||||
|
@ -143,9 +143,6 @@
|
||||
don't. */
|
||||
#define HAVE_DECL_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the <dld.h> header file. */
|
||||
/* #undef HAVE_DLD_H */
|
||||
|
||||
/* Define to 1 if you have the `dlopen' function. */
|
||||
/* #undef HAVE_DLOPEN */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user