Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide Libs.private in the .pc for static link #719

Closed
yurivict opened this issue Jun 9, 2017 · 7 comments
Closed

Please provide Libs.private in the .pc for static link #719

yurivict opened this issue Jun 9, 2017 · 7 comments

Comments

Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
@yurivict
Copy link
Contributor

@yurivict yurivict commented Jun 9, 2017

pkg-config --static --libs libzstd should return the .a library, like this ``/usr/local/lib/libzstd.a```
For this .pc file should contain such line:

Libs.private: ${libdir}/libzstd.a
@yurivict yurivict changed the title Please provide Libs.private in the .pc for static links Please provide Libs.private in the .pc for static link Jun 9, 2017
@nmathewson
Copy link

@nmathewson nmathewson commented Jun 16, 2017

This issue is a blocker for Tor building statically with zstd support; see also https://trac.torproject.org/projects/tor/ticket/22550

@nmathewson
Copy link

@nmathewson nmathewson commented Jun 16, 2017

I think the diagnosis above may be incorrect, however. The Libs.private line is supposed to contain the list of libraries used by the static library, not the library itself.

@terrelln
Copy link
Contributor

@terrelln terrelln commented Jun 16, 2017

@nmathewson libzstd doesn't have any dependencies by default. There is an option to enable multithreaded compression support, but it isn't enabled by default yet.

@yurivict
Copy link
Contributor Author

@yurivict yurivict commented Jun 17, 2017

It seems from the web search that pkgconfig is broken on the conceptual level, because it doesn't allow static library detection. I didn't realize this when I wrote the OP.

You should develop the cmake module instead, as cmake seems to be more conceptually sound.

@Cyan4973
Copy link
Contributor

@Cyan4973 Cyan4973 commented Jun 17, 2017

Here is what I could gather regarding Links.private :
https://people.freedesktop.org/~dbn/pkg-config-guide.html

Libs.private: The link flags for private libraries required by this package but not exposed to applications.

It seems unrelated to your issue (build statically with zstd).
Maybe we need another solution

@yurivict
Copy link
Contributor Author

@yurivict yurivict commented Jun 17, 2017

Maybe we need another solution

It doesn't appear that .pc can be fixed for the static build. One option is to have two .pc files: zstd.pc and zstd-static.pc.

Tor IMO should use autotools instead of pkgconfig in this instance.

@yurivict
Copy link
Contributor Author

@yurivict yurivict commented Jun 17, 2017

I think I misdiagnosed the problem. /usr/local/lib/libzstd.a is stripped when installed from the centrally built package for some reason. This is why tor failed, not because of pkg-config.

@yurivict yurivict closed this Jun 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment