php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57216 -ldl flag prevents extension from compiling
Submitted: 2006-09-01 16:32 UTC Modified: 2009-01-11 13:51 UTC
From: potsofdirt at yahoo dot com Assigned:
Status: Closed Package: ssh2 (PECL)
PHP Version: 5.1.6 OS: FreeBSD 6.0
Private report: No CVE-ID: None
 [2006-09-01 16:32 UTC] potsofdirt at yahoo dot com
Description:
------------
ssh2-0.10

When I try to install via PEAR, or if I try to compile it into php as a static extension I get an error about not having libssh2 0.4 or above even though libssh2 0.14 is installed. 

Per recommendation of http://us3.php.net/manual/en/ref.ssh2.php#68806 I removed the -ldl flag from the config.m4 file in the extension and it compiled fine through pear. To compile it as a static extension into php I had to remove the same flag from configure. I am not familiar enough with how configure is built to know why it was not removed even after I performed `rm configure` and `./buildconf --force`.

After removal of this flag, everything seems to work fine.

Reproduce code:
---------------
./configure --with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-pgsql=/usr/local/pgsql \
--enable-calendar \
--enable-trans-sid \
--with-curl=/usr/local \
--with-sybase=/usr/local/freetds \
--enable-ftp \
--with-mcrypt \
--with-pspell \
--with-xdiff \
--with-zlib \
--with-openssl \
--enable-soap \
--with-ssh2

Expected result:
----------------
Php should have configured correctly

Actual result:
--------------
checking for libssh2_banner_set in -lssh2... no
configure: error: libssh2 version >= 0.4 not found

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-21 09:14 UTC] potsofdirt at yahoo dot com
I created the following patch for config.m4 that should solve compilation issues on systems without libdl:

--- old/config.m4	Thu Sep 21 08:55:10 2006
+++ new/config.m4	Thu Sep 21 08:56:13 2006
@@ -29,6 +29,11 @@
   LIBNAME=ssh2
   LIBSYMBOL=libssh2_banner_set
 
+  EXTRA_LIBS="-lm"
+  AC_CHECK_LIB(dl, dlopen, [
+    EXTRA_LIBS="$EXTRA_LIBS -ldl"
+  ])
+
   PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
   [
     PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SSH2_DIR/lib, SSH2_SHARED_LIBADD)
@@ -36,7 +41,7 @@
   ],[
     AC_MSG_ERROR([libssh2 version >= 0.4 not found])
   ],[
-    -L$SSH2_DIR/lib -lm -ldl
+    -L$SSH2_DIR/lib $EXTRA_LIBS
   ])
 
   PHP_CHECK_LIBRARY($LIBNAME,libssh2_channel_forward_listen_ex,
 [2009-01-11 13:51 UTC] mikesul@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/ssh2

This was actually already fixed in CVS when you reported it -- looks like the libdl dependency wasn't needed at all.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 22:01:27 2024 UTC