mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
add --enable-rtld-now build option to change dlopen behavior
This commit is contained in:
parent
b003e0a0f5
commit
d633cbac1c
@ -139,12 +139,18 @@
|
||||
# define RTLD_GLOBAL 0
|
||||
# endif
|
||||
|
||||
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
|
||||
# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__)
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
|
||||
# ifdef PHP_USE_RTLD_NOW
|
||||
# define PHP_RTLD_MODE RTLD_NOW
|
||||
# else
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
|
||||
# define PHP_RTLD_MODE RTLD_LAZY
|
||||
# endif
|
||||
|
||||
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
|
||||
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
|
||||
# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__)
|
||||
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND)
|
||||
# else
|
||||
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL)
|
||||
# endif
|
||||
# define DL_UNLOAD dlclose
|
||||
# if defined(DLSYM_NEEDS_UNDERSCORE)
|
||||
|
11
configure.ac
11
configure.ac
@ -927,6 +927,17 @@ else
|
||||
ZEND_DEBUG=no
|
||||
fi
|
||||
|
||||
PHP_ARG_ENABLE([rtld-now],
|
||||
[whether to dlopen extensions with RTLD_NOW instead of RTLD_LAZY],
|
||||
[AS_HELP_STRING([--enable-rtld-now],
|
||||
[Use dlopen with RTLD_NOW instead of RTLD_LAZY])],
|
||||
[no],
|
||||
[no])
|
||||
|
||||
if test "$PHP_RTLD_NOW" = "yes"; then
|
||||
AC_DEFINE(PHP_USE_RTLD_NOW, 1, [ Use dlopen with RTLD_NOW instead of RTLD_LAZY ])
|
||||
fi
|
||||
|
||||
PHP_ARG_WITH([layout],
|
||||
[layout of installed files],
|
||||
[AS_HELP_STRING([--with-layout=TYPE],
|
||||
|
Loading…
Reference in New Issue
Block a user