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

Linkage of static library from /usr/lib64 ignored with -L flag warning #54

Open
drahnr opened this issue Jan 8, 2018 · 4 comments
Open

Comments

@drahnr
Copy link

drahnr commented Jan 8, 2018

Using fedora 27, openssl-static provides /usr/lib64/libssl.so and /usr/lib64/libcrypto.so.

The below commit prevents this from linking properly.

9a57960

Expectation: If I set OPENSSL_STATIC I'd either expect the whole thing to fail, print a very descriptive warning with a hint on how to fix this.
What happens actually: a) Missing -L flag warning, b) links dynamically (which I explicitly want to prevent (need to share this from Ubuntu 16.04 over Arch to Fedora Rawhide)

I also opend a topic: https://users.rust-lang.org/t/how-to-link-openssl-statically/14912/2
Also filed: sfackler/rust-openssl#825 (comment)
Possibly related: #37

@drahnr drahnr changed the title Linkage of static library from /usr/lib64 fails Linkage of static library from /usr/lib64 ignored Jan 8, 2018
@drahnr drahnr changed the title Linkage of static library from /usr/lib64 ignored Linkage of static library from /usr/lib64 ignored with -L flag warning Jan 8, 2018
@alexcrichton
Copy link
Member

Thanks for the report!

Unfortunately I don't know a great way to solve this. This was added in place because you typically don't want to statically link system libraries (even with pkg-config --static), but instead you only want to link a library you just compiled or something like that. Threading that needle I think would be pretty difficult.

@drahnr
Copy link
Author

drahnr commented Jan 10, 2018

I think there should be at least (another?) env var (SYSTEM_LIB_FORCE_STATIC_LINK) which can force this behaviour. I am not questioning the default behaviour.

Another issue: Dependent libs like -lz fail to link ( https://users.rust-lang.org/t/how-to-link-openssl-statically/14912/2 ), but that might be a separate issue.

@alexcrichton
Copy link
Member

Perhaps? That may or may not work, it'd be good to test if it actually does. I've never had success statically linking from system-installed versions, I've personally found that you basically always need to compile your own version for various reasons.

@drahnr
Copy link
Author

drahnr commented Mar 29, 2018

I understand that this might be the case, but it might also be not - right now the only thing that comes to my mind (i.e. for openssl) is the set of config options selected by the distribution. Maybe I am missing something obvious.

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

2 participants