From:             php at group dot apple dot com
Operating system: Mac OS X
PHP version:      5.3.0RC3
PHP Bug Type:     *Compile Issues
Bug description:  Darwin / OS X should use dlopen() et al

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 bug report at http://bugs.php.net/?id=48575&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48575&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48575&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48575&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48575&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48575&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48575&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48575&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48575&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48575&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48575&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48575&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48575&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48575&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48575&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48575&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48575&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48575&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48575&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48575&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48575&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48575&r=mysqlcfg

Reply via email to