ID: 48575 Comment by: php at group dot apple dot com Reported By: php at group dot apple dot com Status: Feedback Bug Type: *Compile Issues Operating System: Mac OS X PHP Version: 5.3.0RC3 New Comment:
Quoting from: http://developer.apple.com/documentation/DeveloperTools/Reference/Mach OReference /Reference/reference.html "These [dlopen() et al] are the recommended functions to use to interact with the dynamic loader. These functions work in Mac OS X v10.3 and v10.4. However, in Mac OS X v10.4 they are more efficient than other image-loading functions. These functions are declared in /usr/include/dlfcn.h." 10.3 was released on 24 October 2003; 10.2 was released on 24 August 2002, so dropping support entirely means no longer supporting seven year old software. This applies to both Leopard and Snow Leopard. And it builds just fine on Snow Leopard. :-) Previous Comments: ------------------------------------------------------------------------ [2009-06-17 01:58:52] scott...@php.net Do you have any details about what the older versions of OSX are that required the use of the dyld API? On a sidenote, are you testing this on Snow Leopard? We don't currently have an install of this available to test on, things might be broken there. ------------------------------------------------------------------------ [2009-06-17 00:53:32] php at group dot apple dot com Description: ------------ There is a flaw in the logic in the low-level Zend pieces regarding Mac OS X's ability to use dlopen() and its cousins. When available, those standard APIs should _always_ be used in lieu of the deprecated dyld functions. In effect, the #ifdef logic in zend.h should be reversed to use HAVE_MACH_O_DYLD_H only if HAVE_DLFCN_H is undefined. However, that change caused confusion elsewhere, so the patch below is a skanky workaround without applying broader modifications to the Zend core. Ideally, Zend should do the right thing and preferably drop support for those old versions of OS X which needed the dyld APIs; that would obviate the need for this patch. I am writing the bug here because zend.com doesn't have a similar facility and this appears to be an embedded use of their toolkit. Reproduce code: --------------- --- php-5.3.0/acconfig.h 2009-06-10 11:23:33.000000000 -0700 +++ php/acconfig.h 2009-06-16 17:10:25.000000000 -0700 @@ -120,6 +120,15 @@ #endif /* + * Don't use <mach-o/dyld.h> on Mac OS X / Darwin if dl*() functions are available. + * Because this header is processed multiple times during compilation (thanks to lack of + * #ifdef protectors), this logic had to move here. + */ +#if defined(HAVE_DLFCN_H) && defined(HAVE_MACH_O_DYLD_H) +#/* This symbol must be allowed to be cleared. */ undef HAVE_MACH_O_DYLD_H +#endif + +/* * Local variables: * tab-width: 4 * c-basic-offset: 4 --- php-5.3.0RC3/main/php_config.h.in 2009-06-10 11:23:36.000000000 -0700 +++ php/main/php_config.h.in 2009-06-16 17:10:25.000000000 -0700 @@ -2948,6 +2948,15 @@ #endif /* + * Don't use <mach-o/dyld.h> on Mac OS X / Darwin if dl*() functions are available. + * Because this header is processed multiple times during compilation (thanks to lack of + * #ifdef protectors), this logic had to move here. + */ +#if defined(HAVE_DLFCN_H) && defined(HAVE_MACH_O_DYLD_H) +#/* This symbol must be allowed to be cleared. */ undef HAVE_MACH_O_DYLD_H +#endif + +/* * Local variables: * tab-width: 4 * c-basic-offset: 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48575&edit=1