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

pkg_config always adds system-wide path to rustc-link-search #49

Closed
rinon opened this issue Feb 7, 2019 · 4 comments
Closed

pkg_config always adds system-wide path to rustc-link-search #49

rinon opened this issue Feb 7, 2019 · 4 comments

Comments

@rinon
Copy link
Contributor

rinon commented Feb 7, 2019

Could we get .print_system_libs(false) added to the pkg_config Config? libz-sys is far down the dependency chain from my package and adds /usr/lib to the search path. This means that the linker grabs another library we want to link against from /usr/lib instead of our non-system search path that we add using rustc-link-search.

This is the same basic issue as sfackler/rust-openssl#447 and rust-lang/pkg-config-rs#11

Thanks!

@rinon rinon changed the title pkg_config always adds system-wise path to rustc-link-search pkg_config always adds system-wide path to rustc-link-search Feb 7, 2019
@alexcrichton
Copy link
Member

Thanks for the report! I don't think the answer is to not print out -lz, but to just not print out -L /usr/.... Currently I don't think there's an easy way to do that.

@rinon
Copy link
Contributor Author

rinon commented Feb 11, 2019

If I understand Config.print_system_libs correctly, it just sets PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 for pkg-config, which just disables stripping of -L /usr/lib according to the man page:

PKG_CONFIG_ALLOW_SYSTEM_LIBS
Don't strip -L/usr/lib out of libs

@alexcrichton
Copy link
Member

Ok seems like it just needs a PR then!

@joshtriplett
Copy link
Member

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants