windows vendored openssl doesn't statically link
molleafauss opened this issue · 3 comments
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
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.
I can open a PR for this if you want.
That'd be great!