MAC OS X and DSOs

php.internals

Andi Gutmans

22 years ago
Hi guys, There seem to be some problems with loading shared libraries on the MAC OS X platform. It seems that ./configure on MAC OS X defines HAVE_LIBDL in php_config.h which causes the following code in zend.h not to be used: #elif defined(HAVE_MACH_O_DYLD_H) # define DL_LOAD(libname) zend_mh_bundle_load(libname) # define DL_UNLOAD(handle) zend_mh_bundle_unload(handle) # define DL_FETCH_SYMBOL(h,s) zend_mh_bundle_symbol(h,s) # define DL_ERROR zend_mh_bundle_error # define DL_HANDLE void * # define ZEND_EXTENSIONS_SUPPORT 1 After testing this stuff quite a bit it seems that in order for DSO's to work correctly on MAC OS X they should be defined. I am thinking of changing the following code in zend.h: #if defined(HAVE_LIBDL) to #if defined(HAVE_LIBDL) && !defined(HAVE_MACH_O_DYLD_H) Anyone have additional insight on this? Andi

Dan Kalowsky

22 years ago
This behavior is mostly likely a result of the changes to the included system libraries in 10.3. The truth to the matter is now dlcompat is distributed with OS X (as of 10.3) so most of the library handling code Marko and I wrote probably is no longer necessary for future generations of OS X (please note this is untested). It is necessary though for those running 10.2 (and earlier), and there do seem to be a great many of them still. Looking at your change though, I don't believe it should cause much damage. On Jun 3, 2004, at 9:43 AM, Andi Gutmans wrote: