ID:               48575
 Updated by:       scott...@php.net
 Reported By:      php at group dot apple dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         *Compile Issues
 Operating System: Mac OS X
 PHP Version:      5.3.0RC3
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to