Bug 1118 - libunbound.pc sets strange Libs, Libs.private values
libunbound.pc sets strange Libs, Libs.private values
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.5.10
x86_64 Linux
: P5 minor
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-02 02:20 CEST by Robert Edmonds
Modified: 2016-10-18 15:57 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Edmonds 2016-10-02 02:20:27 CEST
Hi,

When I built unbound 1.5.10 on Debian, the generated libunbound.pc file ended up containing the following lines:

    Libs: -L${libdir} -lunbound -lssl -L/usr/lib -L/usr/lib/python3.5 -lpython3.5m   -lcrypto
    Libs.private:  -Wl,--as-needed -fPIE -pie -Wl,-z,relro -Wl,-z,now

Based on the following substitutions from the libunbound.pc.in file:

    Libs: -L${libdir} -lunbound @SSLLIB@ @LIBS@
    Libs.private: @LDFLAGS@

I think this is not quite right. According to the pkg-config manpage:

       Libs:  This line should give the link flags specific to your package.  Don't add any flags for required packages; pkg-config will add those automatically.

       Libs.private:
              This line should list any private libraries in use.  Private libraries are libraries which are not exposed through your library, but are needed in the case of static linking. This differs from Requires.private in that it references libraries that do not have package files installed.

Probably the libunbound.pc.in file should instead specify something like:

    Libs: -L${libdir} -lunbound
    Libs.private: @SSLLIB@ @LIBS@
Comment 1 Wouter Wijngaards 2016-10-18 15:57:15 CEST
Hi Robert,

Fixed as you suggested.  Thanks for the report!
I hope this works for pkgconfig users.

Best regards, Wouter