|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-08-20 16:15 UTC] sbraun at emlix dot com
[2009-08-21 11:37 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
Description: ------------ I cross compile libphp5.so in a i486-pc-linux-gnu chroot, the compiler is an i486-pc-linux-gnu-gcc that produces code for an i686-pc-linux-gnu target (the compile runs as part of an embedded systems build system). When I load the libphp5.so into apache, it fails with: httpd: Syntax error on line 54 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib/apache/libphp5.so into server: /usr/lib/apache/libphp5.so: undefined symbol: php_load_extension php_load_extension from dl.c is guarded by #ifdef HAVE_LIBDL objdump -x libphp5.so: 00000000 *UND* 00000000 php_load_extension In my cross_compile situtation, the #defines for dlopen and libdl are not set, thus HAVE_DLOPEN and HAVE_LIBDL are not in main/php_config.h, yet my system provides dlopen() via dl.so. Naturally, dl.so is there in my chroot and provides dlopen(), and the configure script finds this fact when searching for dlopen() respectively __dlopen(), yet then it throws the findings away, the relevant lines in the configure script are: ------------------ if test "$found" = "yes"; then ac_libs=$LIBS LIBS="$LIBS -ldl" if test "$cross_compiling" = yes; then found=no else ------------------ Later, writing the #defines HAVE_DLOPEN and HAVE_LIBDL is guarded by: ------------------ if test "$found" = "yes"; then ------------------ Reproduce code: --------------- autoconf configure.in > configure build_platform=i486-pc-linux-gnu target_platform=i486-pc-linux-gnu PKG_CONFIG_PATH=${sysroot}/usr/lib/pkgconfig \ ./configure \ --prefix=${_prefix} \ --build=${build_platform} \ --host=${target_platform} \ --target=${target_platform} \ --mandir=${_mandir} \ --with-apxs2="${sysroot}${_sbindir}/apxs" \ --with-libxml-dir="${sysroot}${_prefix}" \ --with-openssl \ --without-iconv \ --disable-cli \ ; start apache with a line in httpd.conf: LoadModule php5_module /usr/lib/apache/libphp5.so you get the error described above Expected result: ---------------- well, it should load and stuff Actual result: -------------- Instead I will provide some bugfix suggestion: I am not so much a friend of autoconf, so i think i am maybe not the right person to provide a patch directly. Maybe there is a reason for the behaviour. I am going to comment the problematic line out in my project, patch would be welcome. # phps configure mysteriously refuses to use found libdl # if test "$cross_compiling" = yes; then # found=no regards Simon Braunschmidt