Edit report at http://bugs.php.net/bug.php?id=51276&edit=1
ID: 51276
Comment by: richard at webdezign dot co dot uk
Reported by: tsteiner at nerdclub dot net
Summary: php_load_extension is called when HAVE_LIBDL is not
defined.
Status: Open
Type: Bug
Package: Compile Failure
Operating System: Linux
PHP Version: 5.3.2
New Comment:
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?
Previous Comments:
------------------------------------------------------------------------
[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