-Wl,--as-needed

Thiago Macieira thiago at kde.org
Sun Apr 24 00:02:29 BST 2005


Thiago Macieira wrote:
>So why doesn't libgsl link to it!?

libgsl is severely broken. I recommend their developers start using 
--no-undefined.

Here are some simple tests demonstrating it is very, very broken:
$ cat > test.c
#include <gsl/gsl_test.h>

main()
{
  gsl_test_summary();
}
$ gcc -o ./test test.c -lgsl -Wl,--allow-shlib-undefined
$ ./test

BUT:
$ LD_BIND_NOW=1 ./test
./test: symbol lookup error: /usr/lib/libgsl.so.0: undefined symbol: 
cblas_dsdot

OR

$ gcc -o ./test test.c -Wl,--as-needed -lgsl -lgslcblas
$ LD_BIND_NOW=1 ./test
./test: symbol lookup error: /usr/lib/libgsl.so.0: undefined symbol: 
cblas_dsdot

OR

$ gcc -o ./test test.c -lgsl
/usr/lib/gcc/i386-conectiva-linux/3.4.3/../../../libgsl.so: undefined 
reference to `cblas_dsdot'
[more undefined reference errors]

Yes, I know about pkg-config and I know about libtool, but I don't care 
about them. They aren't needed.

-- 
  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/09e25bc3/attachment.sig>


More information about the kde-core-devel mailing list