php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71924 phpdbg fails to link with -lreadline
Submitted: 2016-03-30 01:23 UTC Modified: 2016-10-09 04:22 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: bernd at bpj-code dot co dot za Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: 7.0.x OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-03-30 01:23 UTC] bernd at bpj-code dot co dot za
Description:
------------
make recipe fails to include -lreadline (and also -lncurses or whatever readline depends on, for that matter) when building SAPI artifacts.

sapi/phpdbg/config.m4 appears to attempt to link to -lreadline, as PHPDBG_EXTRA_LIBS="$PHP_READLINE_LIBS", but I'm inferring that since sapi/*/config.m4 get config-stubs'ed before ext/*/config.m4, $PHP_READLINE_LIBS is not yet set when the phpdbg configury runs.


Patches

phpdbg-readline-subst.diff (last revision 2016-09-28 12:30 UTC by mike@php.net)
resolve-circular-readline-dependency.diff (last revision 2016-07-09 21:43 UTC by bernd at bpj-code dot co dot za)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-06 19:29 UTC] bernd at bpj-code dot co dot za
My configuration FWIW:

configured by ./configure, generated by GNU Autoconf 2.69,
  with options "'--with-libdir=lib/x86_64-linux-gnu' '--with-apxs2=/usr/bin/apxs2' '--with-config-file-path=/home/bernd/tor-inst/etc/php7' '--with-config-file-scan-dir=/home/bernd/tor-inst/etc/php7/conf.d' '--with-zlib=shared,/usr' '--enable-bcmath' '--with-bz2=shared' '--enable-calendar' '--with-curl=shared,/usr' '--enable-dba=shared' '--with-db4=shared,/usr' '--enable-exif' '--enable-ftp' '--with-openssl=shared,/usr' '--with-iconv=shared' '--with-mysqli=shared,/usr/bin/mysql_config' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--enable-pcntl' '--with-pdo-mysql=shared' '--with-readline=shared,/usr' '--enable-sockets' '--disable-static' '--with-gdbm=shared' '--with-pcre-regex=/usr' '--disable-short-tags' '--enable-phpdbg' '--enable-phpdbg-webhelper' '--enable-fpm'"
 [2016-07-06 19:35 UTC] bernd at bpj-code dot co dot za
-Package: phpdbg +Package: Compile Failure -PHP Version: 7.0.5RC1 +PHP Version: 7.0.x
 [2016-07-06 19:35 UTC] bernd at bpj-code dot co dot za
Same FTBFS in 7.0.8; not specific to 7.0.5, and not really (inherently) unique to phpdbg either.
 [2016-07-09 21:42 UTC] bernd at bpj-code dot co dot za
Updated patch so it actually causes the phpdbg Makefile fragment to get included, and to actually add -lreadline.
 [2016-09-28 12:06 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2016-09-28 12:06 UTC] mike@php.net
The patch looks good to me, as far as I can tell.

Can you give a reasoning why you named the diversion BODY_POSTSELECT?

Also, I don't think we need to link against libreadline's dependencies; does phpdbg use them directly?
 [2016-09-28 12:30 UTC] mike@php.net
The following patch has been added/updated:

Patch Name: phpdbg-readline-subst.diff
Revision:   1475065831
URL:        https://bugs.php.net/patch-display.php?bug=71924&patch=phpdbg-readline-subst.diff&revision=1475065831
 [2016-10-09 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2016-10-09 15:28 UTC] bernd at bpj-code dot co dot za
I could have sworn I provided the requested feedback... and I didn't see Mike's patch either.

I'm not entirely happy with the name I chose for the diversion. Diversion 1000 is BODY, and the BODY_POSTSELECT diversion needs to be undiverted "nearby": after all feature-selection script output, but before generating any output files, since these output files could conceivably need to contain text computed from feature selections.

And worse, autoconf diversions are rather underdocumented.

IIRC libreadline is (was?) special in that it could dynamically link with either libncurses or libterminfo (or something like that) and relied on its client program to choose which indirect dependency to link to.

Unfortunately Mike's patch doesn't work for me, for a different reason: now it's -lz that's missing from the link line. (This time it's mysqlnd that wants -lz. Not too long ago ld(1) would pick up DT_NEEDED: libz.so.N from the many libraries phpdbg does get linked to explicitly, but newer versions use only explicitly named libraries.)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC