#50303 [Bgs]: A few different autotools issues
ID: 50303 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl Status: Bogus Bug Type: Compile Failure Operating System: Linux PHP Version: 5.2.11 New Comment: As for 1 - I could quote a part of autoconf info page at you once again, but ...oh,well As for 2 - in ext/curl/interface.c you have: # if defined(HAVE_GCRYPT_H) #define PHP_CURL_NEED_GNUTLS_TSL #include gcrypt.h # else ... # endif But if you use AC_CHECK_HEADER, HAVE_GCRYPT_H never gets defined, even if the header gets properly detected. And I don't see how any of AC_TRY_RUN in ext/curl/config.m4 could succeed without libcurl being added to LIBS for those tests. Previous Comments: [2009-11-26 10:05:46] j...@php.net 1. Wont fix 2. No idea what bug that is. And last but not least: DO NOT report multiple issues in one report. [2009-11-26 00:35:42] galtgendo at o2 dot pl Description: Seeing that bug 50291 got accepted, I'd like to readdress a few issues, some of which I already address here (some of them were bogus, other were not). 1. Gentoo bug 151444 - '--as-needed' problem a.k.a. using LDFLAGS instead of libs while Gentoo is using a different fix now, I still keep a patch (quite a bit reduced, compared to the one in the bug), that modifies PHP_CHECK_LIBRARY to use LIBS instead of LDFLAGS - it modifies a few other ext specific macros too; it works for me for over a year now, but I'm not building all exts, so it could use some polishing 2. Gentoo bug 275240 - curl.m4 while changing from curl-config to pkg-config is just an idea (curl, just as php needs to be kept up to date, due to security, so it shouldn't be a big problem), AC_CHECK_HEADER - AC_CHECK_HEADERS is required for things to work -- Edit this bug report at http://bugs.php.net/?id=50303edit=1
#50303 [Bgs]: A few different autotools issues
ID: 50303 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl Status: Bogus Bug Type: Compile Failure Operating System: Linux PHP Version: 5.2.11 New Comment: As for pkg-config, it's just an idea, but: - it's cleaner - what if curl does the same thing that gnutls did - drops it's custom script ? Previous Comments: [2009-11-26 11:07:28] galtgendo at o2 dot pl As for 1 - I could quote a part of autoconf info page at you once again, but ...oh,well As for 2 - in ext/curl/interface.c you have: # if defined(HAVE_GCRYPT_H) #define PHP_CURL_NEED_GNUTLS_TSL #include gcrypt.h # else ... # endif But if you use AC_CHECK_HEADER, HAVE_GCRYPT_H never gets defined, even if the header gets properly detected. And I don't see how any of AC_TRY_RUN in ext/curl/config.m4 could succeed without libcurl being added to LIBS for those tests. [2009-11-26 10:05:46] j...@php.net 1. Wont fix 2. No idea what bug that is. And last but not least: DO NOT report multiple issues in one report. [2009-11-26 00:35:42] galtgendo at o2 dot pl Description: Seeing that bug 50291 got accepted, I'd like to readdress a few issues, some of which I already address here (some of them were bogus, other were not). 1. Gentoo bug 151444 - '--as-needed' problem a.k.a. using LDFLAGS instead of libs while Gentoo is using a different fix now, I still keep a patch (quite a bit reduced, compared to the one in the bug), that modifies PHP_CHECK_LIBRARY to use LIBS instead of LDFLAGS - it modifies a few other ext specific macros too; it works for me for over a year now, but I'm not building all exts, so it could use some polishing 2. Gentoo bug 275240 - curl.m4 while changing from curl-config to pkg-config is just an idea (curl, just as php needs to be kept up to date, due to security, so it shouldn't be a big problem), AC_CHECK_HEADER - AC_CHECK_HEADERS is required for things to work -- Edit this bug report at http://bugs.php.net/?id=50303edit=1
#50303 [NEW]: A few different autotools issues
From: galtgendo at o2 dot pl Operating system: Linux PHP version: 5.2.11 PHP Bug Type: *Compile Issues Bug description: A few different autotools issues Description: Seeing that bug 50291 got accepted, I'd like to readdress a few issues, some of which I already address here (some of them were bogus, other were not). 1. Gentoo bug 151444 - '--as-needed' problem a.k.a. using LDFLAGS instead of libs while Gentoo is using a different fix now, I still keep a patch (quite a bit reduced, compared to the one in the bug), that modifies PHP_CHECK_LIBRARY to use LIBS instead of LDFLAGS - it modifies a few other ext specific macros too; it works for me for over a year now, but I'm not building all exts, so it could use some polishing 2. Gentoo bug 275240 - curl.m4 while changing from curl-config to pkg-config is just an idea (curl, just as php needs to be kept up to date, due to security, so it shouldn't be a big problem), AC_CHECK_HEADER - AC_CHECK_HEADERS is required for things to work -- Edit bug report at http://bugs.php.net/?id=50303edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50303r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50303r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50303r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50303r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50303r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50303r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50303r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50303r=needscript Try newer version: http://bugs.php.net/fix.php?id=50303r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50303r=support Expected behavior: http://bugs.php.net/fix.php?id=50303r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50303r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50303r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50303r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50303r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=50303r=dst IIS Stability: http://bugs.php.net/fix.php?id=50303r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50303r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50303r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50303r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50303r=mysqlcfg
#47153 [Com]: Problem in config.m4
ID: 47153 Comment by: galtgendo at o2 dot pl Reported By: mmarkus69 at hotmail dot com Status: No Feedback Bug Type: cURL related Operating System: Ubuntu 8.04 PHP Version: 5.2.8 New Comment: Perhaps (just a guess), reporter run autoreconf. With a fairly recent autoconf, certain assumption of this macro is incorrect: AC_CHECK_HEADER (as opposed to AC_CHECK_HEADERS) does NOT define HAVE_HEADER_H for the header it checks. Previous Comments: [2009-01-28 01:00:03] 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. [2009-01-20 01:56:50] mmarkus69 at hotmail dot com apt-get -y install libcurl4-gnutls-dev Anyway, this is a logical error in interface.c that falls under the heading: /* {{{ cruft for thread safe SSL crypto locks */ Thus, you need to compile a thread-safe version (zts) of PHP to see the warning. Here are the options that I used: ./configure \ --disable-cli \ --enable-embed=static \ --disable-cgi \ --disable-ipv6 \ --enable-maintainer-zts \ --disable-shared \ --enable-static \ --with-config-file-path=. \ --with-zlib \ --with-curl \ --without-pear \ --with-tsrm-pthreads Let me know if you still have problems replicating this issue and thanks for taking the time to look into it. [2009-01-20 01:03:15] j...@php.net So what did you do wrong? The same configure works fine for me on several installation. Did you go and compile curl yourself? I bet you have 2 (or more) installations there that conflict which each other.. [2009-01-19 20:45:32] mmarkus69 at hotmail dot com Description: When compiling using --with-curl, the following error appears: php-5.2.8/ext/curl/interface.c:68:6: warning: #warning libcurl was compiled with GnuTLS support, but configure could not find gcrypt.h; thus no SSL crypto locking callbacks will be set, which may cause random crashes on SSL requests However, configure does report that it has found gcrypt.h when it runs. The problem seems to be in ext/curl/config.m4 since it never defines HAVE_GCRYPT_H after checking for the aforementioned header file. This then causes the warning in interface.c which does check that HAVE_GCRYPT_H is defined. A similar problem seems to occur with HAVE_OPENSSL_CRYPTO_H although I have not investigated the situation in depth. Proposed solution (in the form of a diff patch): --- ext/curl/config.m4 2008-11-07 15:18:45.0 -0600 +++ config.m4 2009-01-19 13:59:57.0 -0600 @@ -98,8 +98,9 @@ } ], [ AC_MSG_RESULT([yes]) +AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support]) AC_CHECK_HEADER([gcrypt.h], [ - AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support]) + AC_DEFINE([HAVE_GCRYPT_H], [1], [Found gcrypt.h]) ]) ], [ AC_MSG_RESULT([no]) -- Edit this bug report at http://bugs.php.net/?id=47153edit=1
#42374 [Asn]: --as-needed causes configure failures
ID: 42374 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl Status: Assigned Bug Type: Feature/Change Request Operating System: Gentoo PHP Version: 5.2CVS-2007-08-23 Assigned To: jani New Comment: OK, I did some more reading on autotools. A quote from autoconf info page: -- Variable: LDFLAGS ... This variable's contents should contain options like `-s' and `-L' that affect only the behavior of the linker. ... Don't use this variable to pass library names (`-l') to the linker; use `LIBS' instead. So title of this bug should be something along the lines of: 'rewrite your macros to conform to specs instead of simply work' While doing that it may be a good idea to split all those libraries into groups, so every extension (and php itself) doesn't get linked with every libs needed for other extentions. Previous Comments: [2007-11-06 12:26:45] galtgendo at o2 dot pl Please disregard most of my last comment, I misunderstood something. I thought that --as-needed prevents linking with unused libraries, but it only marks them as unused, so above listings of ldd -u mean that it actually works, not the opposite. Anyway, what was exactly the problem that --preserve-dup-defs works around, cause the note in configure.in says only that there was a problem with older libtool, not what was it ? [2007-11-05 22:49:15] galtgendo at o2 dot pl There's a funny thing, though. Command that built in example tidy.so was : /bin/sh /var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p2007091 4/libtool --silent --preserve-dup-deps --mode=link /var/tmp/portage/dev-lang/php -5.2.4_p20070914-r2/work/php-5.2.4_p20070914/meta_ccld -DPHP_ATOM_INC -I/var/tmp /portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/include -I/var /tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/main -I/va r/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914 -I/usr/in clude/libxml2 -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_ p20070914/ext/date/lib -I/usr/include/freetype2 -I/usr/include/imap -I/var/tmp/p ortage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/ext/mbstring/oni guruma -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p200709 14/ext/mbstring/libmbfl -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/ php-5.2.4_p20070914/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/includ e/postgresql/libpq-4 -I/usr/include/pspell -I/var/tmp/portage/dev-lang/php-5.2.4 _p20070914-r2/work/php-5.2.4_p20070914/TSRM -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/Zend -D_REENTRANT -I/usr/include -O2 -march=athlon -mtune=athlon -pipe -pthread -DZTS -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -o ext/tidy/tidy.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/modules -avoid-version -module ext/tidy/tidy.lo -ltidy -lcrypt -lcrypt -lsqlite -lhistory -lreadline -lncurses -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lgssapi -lkrb5 -lcom_err -lssl -lcrypto -ldl -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt so theoretically it should not have those dependencies, unless --preserve-dup-deps messes that up. I think I'll test this theory. Of course, this is a completely separate issue to the one this bug is about. [2007-11-05 21:39:39] galtgendo at o2 dot pl This may seem like nagging, but I wonder how are things comming along. And to add my 2c: ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/tidy.so Unused direct dependencies: /usr/lib/libtidy-0.99.so.0 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 /lib/libz.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/zlib.so Unused direct dependencies: /lib/libz.so.1 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib
#42374 [Asn]: --as-needed causes configure failures
ID: 42374 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl Status: Assigned Bug Type: Feature/Change Request Operating System: Gentoo PHP Version: 5.2CVS-2007-08-23 Assigned To: jani New Comment: Please disregard most of my last comment, I misunderstood something. I thought that --as-needed prevents linking with unused libraries, but it only marks them as unused, so above listings of ldd -u mean that it actually works, not the opposite. Anyway, what was exactly the problem that --preserve-dup-defs works around, cause the note in configure.in says only that there was a problem with older libtool, not what was it ? Previous Comments: [2007-11-05 22:49:15] galtgendo at o2 dot pl There's a funny thing, though. Command that built in example tidy.so was : /bin/sh /var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p2007091 4/libtool --silent --preserve-dup-deps --mode=link /var/tmp/portage/dev-lang/php -5.2.4_p20070914-r2/work/php-5.2.4_p20070914/meta_ccld -DPHP_ATOM_INC -I/var/tmp /portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/include -I/var /tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/main -I/va r/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914 -I/usr/in clude/libxml2 -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_ p20070914/ext/date/lib -I/usr/include/freetype2 -I/usr/include/imap -I/var/tmp/p ortage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/ext/mbstring/oni guruma -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p200709 14/ext/mbstring/libmbfl -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/ php-5.2.4_p20070914/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/includ e/postgresql/libpq-4 -I/usr/include/pspell -I/var/tmp/portage/dev-lang/php-5.2.4 _p20070914-r2/work/php-5.2.4_p20070914/TSRM -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/Zend -D_REENTRANT -I/usr/include -O2 -march=athlon -mtune=athlon -pipe -pthread -DZTS -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -o ext/tidy/tidy.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/modules -avoid-version -module ext/tidy/tidy.lo -ltidy -lcrypt -lcrypt -lsqlite -lhistory -lreadline -lncurses -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lgssapi -lkrb5 -lcom_err -lssl -lcrypto -ldl -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt so theoretically it should not have those dependencies, unless --preserve-dup-deps messes that up. I think I'll test this theory. Of course, this is a completely separate issue to the one this bug is about. [2007-11-05 21:39:39] galtgendo at o2 dot pl This may seem like nagging, but I wonder how are things comming along. And to add my 2c: ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/tidy.so Unused direct dependencies: /usr/lib/libtidy-0.99.so.0 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 /lib/libz.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/zlib.so Unused direct dependencies: /lib/libz.so.1 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 And for comparison: ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/gd.so Unused direct dependencies: /usr/lib/libfreetype.so.6 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 /lib/libz.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 ldd -u /usr/bin/php Unused direct dependencies
#42374 [Asn]: --as-needed causes configure failures
ID: 42374 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl Status: Assigned Bug Type: Feature/Change Request Operating System: Gentoo PHP Version: 5.2CVS-2007-08-23 Assigned To: jani New Comment: This may seem like nagging, but I wonder how are things comming along. And to add my 2c: ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/tidy.so Unused direct dependencies: /usr/lib/libtidy-0.99.so.0 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 /lib/libz.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/zlib.so Unused direct dependencies: /lib/libz.so.1 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 And for comparison: ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/gd.so Unused direct dependencies: /usr/lib/libfreetype.so.6 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 /lib/libz.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 ldd -u /usr/bin/php Unused direct dependencies: /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libm.so.6 /lib/libdl.so.2 /usr/lib/libroken.so.18 /lib/libresolv.so.2 /lib/libpthread.so.0 /usr/lib/libssl.so.0.9.8 Previous Comments: [2007-08-24 07:44:54] [EMAIL PROTECTED] And we're not trying to fix the faulty 3rd party libraries here, are we? :) [2007-08-24 03:11:40] crrodriguez at suse dot de a) it seems to be experimental yes, but it usually work. b) might cause problems in dynamic loading such as our shared extensions, f.e. php - pdo - pdo driver (haven't tested yet :) I have tested it with some extensions and seem to work fine, except that the IMAP extension does not compile because configure checks fail for the same reason the reporter is showing here. d) PHP build system does not link with anything else than what is actually needed anyway (AFAIK) ldd -u -r /usr/bin/php Unused direct dependencies: /lib/libnsl.so.1 /lib/libz.so.1 ldd -u -r xmlreader.so /lib/libz.so.1 /lib/libm.so.6 dom.so Unused direct dependencies: /lib/libz.so.1 /lib/libm.so.6 gd.so Unused direct dependencies: /usr/lib/libX11.so.6 although in most cases the guilty stuff is foobar_config scripts or pkgconfig scripts that inject uneeded dependencies (uneeded at least on linux) [2007-08-23 23:01:01] [EMAIL PROTECTED] After some investigation to this flag I'm leaning towards simply filtering it out totally if someone tries to use it. Reasons being: a) it seems to be experimental b) might cause problems in dynamic loading such as our shared extensions, f.e. php - pdo - pdo driver (haven't tested yet :) c) requires that pretty much everything in the system has to be compiled using it d) PHP build system does not link with anything else than what is actually needed anyway (AFAIK) [2007-08-23 15:30:49] galtgendo at o2 dot pl For a simple test case: #include glib.h int main() { g_print(test done\n); return 0; } gcc -o minitest -Wl,--as-needed `pkg-config glib-2.0 --cflags` minitest.c `pkg-config glib-2.0 --libs` - compiles fine gcc -o minitest -Wl,--as-needed `pkg-config glib-2.0 --cflags` `pkg-config glib-2.0 --libs` minitest.c - gives /tmp/ccKZrHDW.o: In function `main': minitest.c:(.text+0x19): undefined reference to `g_print' collect2: ld returned 1 exit status
#42374 [Asn]: --as-needed causes configure failures
ID: 42374 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl Status: Assigned Bug Type: Feature/Change Request Operating System: Gentoo PHP Version: 5.2CVS-2007-08-23 Assigned To: jani New Comment: There's a funny thing, though. Command that built in example tidy.so was : /bin/sh /var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p2007091 4/libtool --silent --preserve-dup-deps --mode=link /var/tmp/portage/dev-lang/php -5.2.4_p20070914-r2/work/php-5.2.4_p20070914/meta_ccld -DPHP_ATOM_INC -I/var/tmp /portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/include -I/var /tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/main -I/va r/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914 -I/usr/in clude/libxml2 -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_ p20070914/ext/date/lib -I/usr/include/freetype2 -I/usr/include/imap -I/var/tmp/p ortage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/ext/mbstring/oni guruma -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p200709 14/ext/mbstring/libmbfl -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/ php-5.2.4_p20070914/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/includ e/postgresql/libpq-4 -I/usr/include/pspell -I/var/tmp/portage/dev-lang/php-5.2.4 _p20070914-r2/work/php-5.2.4_p20070914/TSRM -I/var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/Zend -D_REENTRANT -I/usr/include -O2 -march=athlon -mtune=athlon -pipe -pthread -DZTS -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -o ext/tidy/tidy.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/portage/dev-lang/php-5.2.4_p20070914-r2/work/php-5.2.4_p20070914/modules -avoid-version -module ext/tidy/tidy.lo -ltidy -lcrypt -lcrypt -lsqlite -lhistory -lreadline -lncurses -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lgssapi -lkrb5 -lcom_err -lssl -lcrypto -ldl -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt so theoretically it should not have those dependencies, unless --preserve-dup-deps messes that up. I think I'll test this theory. Of course, this is a completely separate issue to the one this bug is about. Previous Comments: [2007-11-05 21:39:39] galtgendo at o2 dot pl This may seem like nagging, but I wonder how are things comming along. And to add my 2c: ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/tidy.so Unused direct dependencies: /usr/lib/libtidy-0.99.so.0 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 /lib/libz.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/zlib.so Unused direct dependencies: /lib/libz.so.1 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 And for comparison: ldd -u /usr/lib/php5/lib/php/extensions/no-debug-zts-20060613/gd.so Unused direct dependencies: /usr/lib/libfreetype.so.6 /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libreadline.so.5 /lib/libncurses.so.5 /lib/libresolv.so.2 /lib/libm.so.6 /lib/libdl.so.2 /lib/libnsl.so.1 /lib/libz.so.1 libgssapi.so.1 /usr/lib/libkrb5.so.22 /lib/libcom_err.so.2 /usr/lib/libssl.so.0.9.8 /usr/lib/libcrypto.so.0.9.8 /usr/lib/libxml2.so.2 /lib/libpthread.so.0 ldd -u /usr/bin/php Unused direct dependencies: /lib/libcrypt.so.1 /usr/lib/libsqlite.so.0 /lib/libhistory.so.5 /lib/libm.so.6 /lib/libdl.so.2 /usr/lib/libroken.so.18 /lib/libresolv.so.2 /lib/libpthread.so.0 /usr/lib/libssl.so.0.9.8 [2007-08-24 07:44:54] [EMAIL PROTECTED] And we're not trying to fix the faulty 3rd party libraries here, are we? :) [2007-08-24
#42374 [Fbk-Opn]: --as-needed bug - follow-up
ID: 42374 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl -Status: Feedback +Status: Open Bug Type: Compile Failure Operating System: gentoo linux PHP Version: 5.2.3 New Comment: Well, that's incorrect. PHP_CHECK_LIBRARY calls AC_CHECK_LIB. without -Wl,--as-needed it does not matter whether libs are in LDFLAGS or in LIBS, with that flag however all dependent libraries must appear after the objects. AC_CHECK_LIB does something like i686-pc-linux-gnu-gcc -o conftest ${CFLAGS} ${LDFLAGS} conftest.c ${LIBS} (more or less) that check fails with --as-needed flag if lib is added to LDFLAGS so it does not matter if it gets restored, cause the check already failed - those are the false negatives I'm talking about. All the other macros from the patch seem to do this, so that's why I changed them. I'm not sure if something got broken, however it was correct for the ext/ldap/config.m4 so there's at least a chance it will work for the rest. Previous Comments: [2007-08-23 10:38:24] [EMAIL PROTECTED] PHP_CHECK_LIBRARY restores the LDFLAGS after doing the test so it shouldn't be any problem? And bug #41973 was about ext/ldap and that was fixed. I'd fix these case by case rather than blindly changing places unlikely to even cause any problems. [2007-08-22 15:40:41] galtgendo at o2 dot pl Well, I'm not 100%, if I was, I would mentioned it, not asked for futher testing. And AFAIK that commit from bug #41973 was only http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/config.m4?r1=1.44r2=1.45diff_format=u so only about ext/ldap/config.m4 (as in my patch). What's more, although I can't recall if it made any difference you should consider changes in acinclude.m4, cause in PHP_CHECK_LIBRARY macro you were adding libraries to LDFLAGS instead of LIBS and that's most common source of --as-needed bugs. That's why I'm talking about false negatives - standard configure check would put those libraries in wrong place and check would fail even if the library was OK. [2007-08-22 14:46:27] [EMAIL PROTECTED] And have you even tested what was committed in our CVS? [2007-08-22 14:45:33] [EMAIL PROTECTED] FYI: this is not bugzilla and it's not annoying. It's just old. :) And about your patch..are you really sure you need to change all those places? [2007-08-22 10:30:40] galtgendo at o2 dot pl As I don't see a way to attach anything here, I'll give you a link to an old gentoo bug with my patch. It's http://bugs.gentoo.org/show_bug.cgi?id=151444 It's an old bug so it still covers the part from the closed bug. BTW your bugzilla is REALLY annoying. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/42374 -- Edit this bug report at http://bugs.php.net/?id=42374edit=1
#42374 [Opn]: --as-needed bug - follow-up
ID: 42374 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl Status: Open Bug Type: Compile Failure Operating System: gentoo linux PHP Version: 5.2.3 New Comment: For a simple test case: #include glib.h int main() { g_print(test done\n); return 0; } gcc -o minitest -Wl,--as-needed `pkg-config glib-2.0 --cflags` minitest.c `pkg-config glib-2.0 --libs` - compiles fine gcc -o minitest -Wl,--as-needed `pkg-config glib-2.0 --cflags` `pkg-config glib-2.0 --libs` minitest.c - gives /tmp/ccKZrHDW.o: In function `main': minitest.c:(.text+0x19): undefined reference to `g_print' collect2: ld returned 1 exit status Previous Comments: [2007-08-23 15:21:10] galtgendo at o2 dot pl Well, that's incorrect. PHP_CHECK_LIBRARY calls AC_CHECK_LIB. without -Wl,--as-needed it does not matter whether libs are in LDFLAGS or in LIBS, with that flag however all dependent libraries must appear after the objects. AC_CHECK_LIB does something like i686-pc-linux-gnu-gcc -o conftest ${CFLAGS} ${LDFLAGS} conftest.c ${LIBS} (more or less) that check fails with --as-needed flag if lib is added to LDFLAGS so it does not matter if it gets restored, cause the check already failed - those are the false negatives I'm talking about. All the other macros from the patch seem to do this, so that's why I changed them. I'm not sure if something got broken, however it was correct for the ext/ldap/config.m4 so there's at least a chance it will work for the rest. [2007-08-23 10:38:24] [EMAIL PROTECTED] PHP_CHECK_LIBRARY restores the LDFLAGS after doing the test so it shouldn't be any problem? And bug #41973 was about ext/ldap and that was fixed. I'd fix these case by case rather than blindly changing places unlikely to even cause any problems. [2007-08-22 15:40:41] galtgendo at o2 dot pl Well, I'm not 100%, if I was, I would mentioned it, not asked for futher testing. And AFAIK that commit from bug #41973 was only http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/config.m4?r1=1.44r2=1.45diff_format=u so only about ext/ldap/config.m4 (as in my patch). What's more, although I can't recall if it made any difference you should consider changes in acinclude.m4, cause in PHP_CHECK_LIBRARY macro you were adding libraries to LDFLAGS instead of LIBS and that's most common source of --as-needed bugs. That's why I'm talking about false negatives - standard configure check would put those libraries in wrong place and check would fail even if the library was OK. [2007-08-22 14:46:27] [EMAIL PROTECTED] And have you even tested what was committed in our CVS? [2007-08-22 14:45:33] [EMAIL PROTECTED] FYI: this is not bugzilla and it's not annoying. It's just old. :) And about your patch..are you really sure you need to change all those places? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/42374 -- Edit this bug report at http://bugs.php.net/?id=42374edit=1
#42374 [NEW]: --as-needed bug - follow-up
From: galtgendo at o2 dot pl Operating system: gentoo linux PHP version: 5.2.3 PHP Bug Type: Compile Failure Bug description: --as-needed bug - follow-up Description: Recently closed bug #41973 may not cover all the issues. I have a patch that doesn't seem to break anything for me and AFAIK solves all potential issues. The --as-needed bugs happen mostly when you use libtool and add -L and -l to LDFLAGS instead of LIBS. So by the use of grep I tried to change all the macros that seem to do that. I hope I didn't break anything, however somebody should check that, cause 'works for me'!='it works'. At least look at acinclude.m4, cause that one may lead to false negatives with library detection. -- Edit bug report at http://bugs.php.net/?id=42374edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42374r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42374r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42374r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42374r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42374r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42374r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=42374r=needscript Try newer version:http://bugs.php.net/fix.php?id=42374r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42374r=support Expected behavior:http://bugs.php.net/fix.php?id=42374r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42374r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42374r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42374r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42374r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42374r=dst IIS Stability:http://bugs.php.net/fix.php?id=42374r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42374r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42374r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42374r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=42374r=mysqlcfg
#42374 [Fbk-Opn]: --as-needed bug - follow-up
ID: 42374 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl -Status: Feedback +Status: Open Bug Type: Compile Failure Operating System: gentoo linux PHP Version: 5.2.3 New Comment: Well, I'm not 100%, if I was, I would mentioned it, not asked for futher testing. And AFAIK that commit from bug #41973 was only http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/config.m4?r1=1.44r2=1.45diff_format=u so only about ext/ldap/config.m4 (as in my patch). What's more, although I can't recall if it made any difference you should consider changes in acinclude.m4, cause in PHP_CHECK_LIBRARY macro you were adding libraries to LDFLAGS instead of LIBS and that's most common source of --as-needed bugs. That's why I'm talking about false negatives - standard configure check would put those libraries in wrong place and check would fail even if the library was OK. Previous Comments: [2007-08-22 14:46:27] [EMAIL PROTECTED] And have you even tested what was committed in our CVS? [2007-08-22 14:45:33] [EMAIL PROTECTED] FYI: this is not bugzilla and it's not annoying. It's just old. :) And about your patch..are you really sure you need to change all those places? [2007-08-22 10:30:40] galtgendo at o2 dot pl As I don't see a way to attach anything here, I'll give you a link to an old gentoo bug with my patch. It's http://bugs.gentoo.org/show_bug.cgi?id=151444 It's an old bug so it still covers the part from the closed bug. BTW your bugzilla is REALLY annoying. [2007-08-22 09:57:33] galtgendo at o2 dot pl Description: Recently closed bug #41973 may not cover all the issues. I have a patch that doesn't seem to break anything for me and AFAIK solves all potential issues. The --as-needed bugs happen mostly when you use libtool and add -L and -l to LDFLAGS instead of LIBS. So by the use of grep I tried to change all the macros that seem to do that. I hope I didn't break anything, however somebody should check that, cause 'works for me'!='it works'. At least look at acinclude.m4, cause that one may lead to false negatives with library detection. -- Edit this bug report at http://bugs.php.net/?id=42374edit=1
#42374 [Opn]: --as-needed bug - follow-up
ID: 42374 User updated by: galtgendo at o2 dot pl Reported By: galtgendo at o2 dot pl Status: Open Bug Type: Compile Failure Operating System: gentoo linux PHP Version: 5.2.3 New Comment: As I don't see a way to attach anything here, I'll give you a link to an old gentoo bug with my patch. It's http://bugs.gentoo.org/show_bug.cgi?id=151444 It's an old bug so it still covers the part from the closed bug. BTW your bugzilla is REALLY annoying. Previous Comments: [2007-08-22 09:57:33] galtgendo at o2 dot pl Description: Recently closed bug #41973 may not cover all the issues. I have a patch that doesn't seem to break anything for me and AFAIK solves all potential issues. The --as-needed bugs happen mostly when you use libtool and add -L and -l to LDFLAGS instead of LIBS. So by the use of grep I tried to change all the macros that seem to do that. I hope I didn't break anything, however somebody should check that, cause 'works for me'!='it works'. At least look at acinclude.m4, cause that one may lead to false negatives with library detection. -- Edit this bug report at http://bugs.php.net/?id=42374edit=1