Edit report at http://bugs.php.net/bug.php?id=51276&edit=1

 ID:               51276
 Updated by:       tony2...@php.net
 Reported by:      tsteiner at nerdclub dot net
 Summary:          php_load_extension is called when HAVE_LIBDL is not
                   defined.
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          Compile Failure
 Operating System: Linux
 PHP Version:      5.3.2
-Assigned To:      
+Assigned To:      tony2001

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------
[2010-06-08 14:54:13] tony2...@php.net

Automatic comment from SVN on behalf of tony2001
Revision: http://svn.php.net/viewvc/?view=revision&revision=300272
Log: fix bug #51276 (php_load_extension() is missing when HAVE_LIBDL is
undefined)

------------------------------------------------------------------------
[2010-03-19 16:42:59] richard at webdezign dot co dot uk

I have this problem too on CentOS 5.3.



I run:

../php-5.3.2/configure --build=x86_64-redhat-linux-gnu
--host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu

make



and get the same error. I do have libdl.so.2 in my lib64 directory.



But if I apply the php-5.3.2-nolibdl-compile-error patch, does that mean
that the PHP I compile will not be able to load extensions dynamically?

------------------------------------------------------------------------
[2010-03-11 18:08:41] tsteiner at nerdclub dot net

Description:
------------
When HAVE_LIBDL is not defined in main/php_config.h, the function
php_load_extension is not compiled in ext/standard/dl.c.  However, the
function php_load_php_extension_cb() will always be compiled with a call
to php_load_extension.  This causes compilation to fail with the
following message:



main/php_ini.o: In function `php_load_php_extension_cb':

[path removed]/main/php_ini.c:350: undefined reference to
`php_load_extension'

collect2: ld returned 1 exit status

make: *** [sapi/cli/php] Error 1



This appears to be the only place php_load_extension is called. 
Furthermore, php_load_php_extension_cb is only referenced by
php_ini_register_extensions(), which is only called in at
main/main.c:2021.  It would seem that on architectures that don't
HAVE_LIBDL, the preceding functions should be inside #if defined()
checks.



I found this bug while cross-compiling from x86_64 to powerpc but I
don't believe it is a cross-compiling issue.

Test script:
---------------
CC=${CROSS_COMPILE}gcc ../php-5.3.2/configure
--host=powerpc-unknown-linux

make

Expected result:
----------------
PHP should compile without errors.

Actual result:
--------------
main/php_ini.o: In function `php_load_php_extension_cb':

[path removed]/main/php_ini.c:350: undefined reference to
`php_load_extension'

collect2: ld returned 1 exit status

make: *** [sapi/cli/php] Error 1


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51276&edit=1

Reply via email to