File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 139
139
# define RTLD_GLOBAL 0
140
140
# endif
141
141
142
+ # ifdef PHP_USE_RTLD_NOW
143
+ # define PHP_RTLD_MODE RTLD_NOW
144
+ # else
145
+ # define PHP_RTLD_MODE RTLD_LAZY
146
+ # endif
147
+
142
148
# if defined(RTLD_GROUP ) && defined(RTLD_WORLD ) && defined(RTLD_PARENT )
143
- # define DL_LOAD (libname ) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
149
+ # define DL_LOAD (libname ) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
144
150
# elif defined(RTLD_DEEPBIND ) && !defined(__SANITIZE_ADDRESS__ )
145
- # define DL_LOAD (libname ) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
151
+ # define DL_LOAD (libname ) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND)
146
152
# else
147
- # define DL_LOAD (libname ) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
153
+ # define DL_LOAD (libname ) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL)
148
154
# endif
149
155
# define DL_UNLOAD dlclose
150
156
# if defined(DLSYM_NEEDS_UNDERSCORE )
Original file line number Diff line number Diff line change @@ -927,6 +927,17 @@ else
927
927
ZEND_DEBUG=no
928
928
fi
929
929
930
+ PHP_ARG_ENABLE([ rtld-now] ,
931
+ [ whether to dlopen extensions with RTLD_NOW instead of RTLD_LAZY] ,
932
+ [ AS_HELP_STRING ( [ --enable-rtld-now] ,
933
+ [ Use dlopen with RTLD_NOW instead of RTLD_LAZY] ) ] ,
934
+ [ no] ,
935
+ [ no] )
936
+
937
+ if test "$PHP_RTLD_NOW" = "yes"; then
938
+ AC_DEFINE ( PHP_USE_RTLD_NOW , 1 , [ Use dlopen with RTLD_NOW instead of RTLD_LAZY ] )
939
+ fi
940
+
930
941
PHP_ARG_WITH([ layout] ,
931
942
[ layout of installed files] ,
932
943
[ AS_HELP_STRING ( [ --with-layout=TYPE] ,
You can’t perform that action at this time.
0 commit comments