From dd8e53cb0d0934c3387bdd771d9b39e296ad97fe Mon Sep 17 00:00:00 2001 From: Thomas Jespersen Date: Sat, 2 May 2020 12:19:04 +0200 Subject: [PATCH] Fix static build on windows-gnu targets Static builds for *-pc-windows-gnu targets broke, because the linker would look for the incorrect libraries. OpenSSL builds produce libssl.dll rather than ssl.dll which makes the linker unhappy with the normal -lssl -lcrypto [1]. A workaround could be used: export OPENSSL_LIBS="ssl:crypto" but it's arguably better to have the openssl-sys crate do the right thing. [1] http://www.mingw.org/wiki/specify_the_libraries_for_the_linker_to_use --- openssl-sys/build/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openssl-sys/build/main.rs b/openssl-sys/build/main.rs index cc770318..f4ad7171 100644 --- a/openssl-sys/build/main.rs +++ b/openssl-sys/build/main.rs @@ -86,7 +86,7 @@ fn main() { Some(ref v) => v.split(":").collect(), None => match version { Version::Openssl10x if target.contains("windows") => vec!["ssleay32", "libeay32"], - Version::Openssl11x if target.contains("windows") => vec!["libssl", "libcrypto"], + Version::Openssl11x if target.contains("windows-msvc") => vec!["libssl", "libcrypto"], _ => vec!["ssl", "crypto"], }, };