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

windows vendored openssl doesn't statically link #82

Open
molleafauss opened this issue Dec 30, 2020 · 3 comments
Open

windows vendored openssl doesn't statically link #82

molleafauss opened this issue Dec 30, 2020 · 3 comments

Comments

@molleafauss
Copy link
Contributor

molleafauss commented Dec 30, 2020

Moving here discussion from sfackler/rust-openssl#1398

Seems that on MSVC windows the library are always built as dlls, unless the crt-static feature is enabled. This piece of code is omitting the no-shared configuration argument to the Configure script, resulting in dll being built and binaries linked against openssl-sys still requiring dll to be installed or available in PATH.

Forcing that no-static argument, allows vendored openssl to link correctly.

I don't think that the above linked configuration is correct: from what I read, crt-static is something related to the base windows libraries and should not affect the linking of a library such as openssl; besides, openssl-sys already takes care of telling cargo to link correctly the windows runtime by properly adding:

cargo:rustc-link-lib=static=libssl
cargo:rustc-link-lib=static=libcrypto
cargo:rustc-link-lib=dylib=gdi32
cargo:rustc-link-lib=dylib=user32
cargo:rustc-link-lib=dylib=crypt32
cargo:rustc-link-lib=dylib=ws2_32
cargo:rustc-link-lib=dylib=advapi32
@alexcrichton
Copy link
Owner

Seems reasonable to me to always statically link OpenSSL, I'm not entirely sure why configuration was left in to build openssl dylibs, that's not really ever desired when using this crate I think.

@molleafauss
Copy link
Contributor Author

I can open a PR for this if you want.

@alexcrichton
Copy link
Owner

That'd be great!

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