From ddd04786155e7c3855e5c3f4303a7d2b8c908d76 Mon Sep 17 00:00:00 2001 From: Alexis Mousset Date: Mon, 17 Jul 2023 01:28:15 +0200 Subject: [PATCH] Update vendored openssl to version 3.1 --- openssl-sys/Cargo.toml | 2 +- openssl-sys/build/main.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/openssl-sys/Cargo.toml b/openssl-sys/Cargo.toml index 9b102fa8dc..f49afa42fe 100644 --- a/openssl-sys/Cargo.toml +++ b/openssl-sys/Cargo.toml @@ -25,7 +25,7 @@ bssl-sys = { version = "0.1.0", optional = true } [build-dependencies] bindgen = { version = "0.64.0", optional = true, features = ["experimental"] } cc = "1.0.61" -openssl-src = { version = "111", optional = true } +openssl-src = { version = "300.1.2", optional = true, features = ["legacy"] } pkg-config = "0.3.9" vcpkg = "0.2.8" diff --git a/openssl-sys/build/main.rs b/openssl-sys/build/main.rs index 21ccf3d037..7122b48627 100644 --- a/openssl-sys/build/main.rs +++ b/openssl-sys/build/main.rs @@ -115,6 +115,16 @@ fn main() { println!("cargo:rustc-link-lib={}={}", kind, lib); } + // https://github.com/openssl/openssl/pull/15086 + if version == Version::Openssl3xx + && kind == "static" + && (env::var("CARGO_CFG_TARGET_OS").unwrap() == "linux" + || env::var("CARGO_CFG_TARGET_OS").unwrap() == "android") + && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32" + { + println!("cargo:rustc-link-lib=dylib=atomic"); + } + if kind == "static" && target.contains("windows") { println!("cargo:rustc-link-lib=dylib=gdi32"); println!("cargo:rustc-link-lib=dylib=user32");