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

------------------------------------------------------------------------

[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.

------------------------------------------------------------------------

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=42374&edit=1

Reply via email to