#1325 `curl-config --libs` includes -lrtmp (and others) not needed for dynamic linking

closed-invalid
None
5
2014-05-05
2014-01-13
No

When curl is built with rtmp support, curl-config --libs give -lrtmp for the linker line when dynamically linking. But this is wrong, it is only needed when statically linking. The problem extends to other libraries as well, eg -lgnutls. In fact, libcurl.pc has it correct:

Libs: -L${libdir} -lcurl
Libs.private: -lrtmp -lz -lgnutls -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -llber -lldap -lz

and yet

curl-config --libs gives

-lcurl -lrtmp -lz -lgnutls -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -llber -lldap -lz

This was hit on a Gentoo system. The downstream report is at

https://bugs.gentoo.org/show_bug.cgi?id=497956

by Nikoli nikoli@gmx.us.

Discussion

  • Dan Fandrich
    Dan Fandrich
    2014-01-13

    curl-config should only list the full set of libraries if libtool indicates that the target system requires that. What is the output of:

    libtool --config | grep link_all_deplibs

    on this system? If it's anything other than "link_all_deplibs=no" then curl is doing the right thing, according to libtool.

     
  • Actually we get

    $ libtool --config | grep link_all_deplibs
    link_all_deplibs=unknown
    

    on gentoo. Interesting! I never knew this. I think the solution may be to get our other packages using libcurl.pc.

     
    • status: open --> pending
    • assigned_to: Daniel Stenberg
     
    • status: pending --> closed-invalid