php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42299 fails to configure with libedit
Submitted: 2007-08-14 17:52 UTC Modified: 2007-08-28 01:00 UTC
From: volkmar dot glauche at uniklinik-freiburg dot de Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: 5.2CVS-2007-08-05 OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: volkmar dot glauche at uniklinik-freiburg dot de
New email:
PHP Version: OS:

 

 [2007-08-14 17:52 UTC] volkmar dot glauche at uniklinik-freiburg dot de
Description:
------------
There are configure checks for (at least) libedit which use -Wl,-rpath /usr/X11R6/lib linker flags. This fails on Gentoo, because /usr/X11R6/lib has only a libedit.so linker script, but no libedit.so ELF library.
I can provide an config.log upon request.

Reproduce code:
---------------
emerge -u php

Expected result:
----------------
build php

Actual result:
--------------
configure stops, because it can not link libedit.so in many tests.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-15 16:54 UTC] jakub at gentoo dot org
Latest CVS snapshot doesn't solve anything, see http://bugs.gentoo.org/show_bug.cgi?id=165633 for downstream bug.
 [2007-08-16 08:12 UTC] volkmar dot glauche at uniklinik-freiburg dot de
This is the latest version I have tested:

5.2.4_pre200708051230-rc2

I don't have the time to create an ebuild for newer snapshots, but I will be happy to test once a new ebuild is in gentoo portage.
 [2007-08-16 08:30 UTC] jani@php.net
I didn't ask you to test some gentoo crap, this is PHP, report bugs in Gentoo to their system.
 [2007-08-16 08:53 UTC] volkmar dot glauche at uniklinik-freiburg dot de
I don't know whether this is just Gentoo specific, but there are numerous occurrences of -Wl,-rpath switches in the top level configure and acinclude.m4 scripts. On my system, these switches force ld.so to look for libedit.so in /usr/X11R6/lib, where it does not find an ELF library but a linker script. With -Wl,-rpath these scripts are not followed, and therefore linking the conftests fails.
 [2007-08-16 10:28 UTC] jani@php.net
Using proper configure line and not defining any LDFLAGS/CFLAGS when not necessary works just fine. And only -Wl, rpath stuff is in configure to check whether compiler supports it or not.

For me configure works just fine under Fedora. If Gentoo chooses to do some hacks of their own, that is none of our business.
 [2007-08-20 09:48 UTC] vapier at gentoo dot org
instead of going into pointless distro bashing, why dont you actually review the issue ... this is not a Gentoo specific problem nor are there any "Gentoo hacks" in place here.

the problem is that the php script incorrectly throws -rpath's into binaries without checking to see if they are actually needed.  it starts with the -lXpm check coming from ext/gd/config.m4 but quickly filters down into PHP_ADD_LIBRARY_WITH_PATH in the acinclude.m4.

that function should really test to see if the -L and/or -rpath is needed in the first place:
 (1) see if the requested -llib works
 (2) see if the requested -llib + -Lpath works
 (3) see if the requested -llib + -Lpath + -Wl,-rpath,path works
 [2007-08-20 10:03 UTC] jani@php.net
So disable it:

[jani@localhost php-5.2]$ ./configure --help |grep rpath
  --disable-rpath         Disable passing additional runtime library

 [2007-08-20 12:47 UTC] volkmar dot glauche at uniklinik-freiburg dot de
This does not seem to work... Attached a snippet from config.log:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.61.  Invocation command line was

  $ ./configure --prefix=/usr/lib/php5 --host=i686-pc-linux-gnu --mandir=/usr/lib/php5/man --infodir=/usr/lib/php5/info --sysconfdir=/etc --cache-file=./config.cache --enable-cli --disable-cgi --with-config-file-path=/etc/php/cli-php5 --with-config-file-scan-dir=/etc/php/cli-php5/ext-active --without-pear --enable-bcmath=shared --with-bz2=shared --enable-calendar=shared --with-curl=shared --with-curlwrappers --enable-dbase=shared --enable-exif=shared --without-fbsql --with-fdftk=shared,/opt/fdftk-6.0 --disable-filter --enable-ftp=shared --with-gettext=shared --with-gmp=shared --disable-hash --disable-json --with-kerberos=/usr --enable-mbstring=shared --with-mcrypt=shared --with-mhash=shared --without-msql --without-mssql --with-ncurses=shared --with-openssl --with-openssl-dir=/usr --enable-pcntl=shared --disable-pdo --without-pgsql --with-pspell=shared --with-recode=shared --disable-reflection --disable-shmop --without-snmp --enable-soap=shared --enable-sockets=shared --without-sybase --without-sybase-ct --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared --with-tidy=shared --disable-wddx --disable-xmlreader --disable-xmlwriter --with-xmlrpc=shared --with-xsl=shared --disable-zip --with-zlib=shared --disable-debug --enable-dba=shared --without-cdb --with-db4 --with-flatfile --with-gdbm --with-inifile --without-qdbm --with-freetype-dir=/usr --with-t1lib=/usr --disable-gd-jis-conv --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --with-gd --with-interbase=/usr --with-ldap=shared --without-ldap-sasl --without-mysqli --without-readline --with-libedit --without-mm --with-sqlite=/usr --enable-sqlite-utf8 --disable-rpath

... snip

configure:4519: checking if compiler supports -Wl,-rpath,
configure:4548: i686-pc-linux-gnu-gcc -o conftest -O2 -pipe -march=pentium4   conftest.c -Wl,-rpath,/usr/lib  >&5
configure:4554: $? = 0
configure:4573: result: yes

... snip (just one of many occurrences of -Wl,-rpath in config.log)

configure:105936: i686-pc-linux-gnu-gcc -o conftest -I/usr/include -O2 -pipe -march=pentium4  -L/usr/lib  -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib conftest.c -ledit -lncurses -lfbclient -lt1 -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm -lgssapi -lkrb5 -lcom_err -lssl -lcrypto -ldl -lxml2 -lz -lm >&5
conftest.c: In function 'main':
conftest.c:370: warning: incompatible implicit declaration of built-in function 'exit'
configure:105939: $? = 0
configure:105945: ./conftest
./conftest: error while loading shared libraries: /usr/X11R6/lib/libedit.so: invalid ELF header
configure:105948: $? = 127
configure: program exited with status 127
 [2007-08-20 13:58 UTC] jani@php.net
Provide the shortest possible configure line which causes this problem. 
 [2007-08-20 14:29 UTC] jani@php.net
I committed a fix for the --disable-rpath in CVS now. No runpath switch will be used when --disable-rpath is used, anywhere.
 [2007-08-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 06:01:27 2025 UTC