-Wl,--as-needed

Thiago Macieira thiago at kde.org
Sat Apr 23 23:57:54 BST 2005


Thiago Macieira wrote:
>The linker adds the NEEDED symbol only for what the resulting binary
>requires *directly*. If your plugin doesn't need anything from gslcblas,
>it won't be listed in the NEEDED section. It doesn't matter if a library
>you use needs stuff from it --- the dependency isn't direct.
>
>What probably is wrong is gsl and gslcblas themselves. I have seen many
>libraries that fail to link to their required dependencies, and in turn
>expect the final program to do that.

Here's the confirmation:

$ nm -D /usr/lib/libgsl.so.0 | grep -c ' U cblas_'
106
$ nm -D /usr/lib/libgslcblas.so.0 | grep -c ' U gsl'
0

So libgsl depends on libgslcblas, right?

$ objdump -p /usr/lib/libgsl.so.0 | grep -c cblas
0
$ ldd /usr/lib/libgsl.so.0 | grep -c cblas
0

So why doesn't libgsl link to it!?

-- 
  Thiago Macieira  -  thiago (AT) macieira (DOT) info
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

3. Ac seo woruld wearð geborod, swá se Scieppend cweað "Gewurde Unix" and 
wundor fremede and him "Unix" genemned, þæt is se rihtendgesamnung.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050423/9d3163a9/attachment.sig>


More information about the kde-core-devel mailing list