Skip to content

Commit

Permalink
bump BoringSSL
Browse files Browse the repository at this point in the history
This is apparently needed to fix a build failure on Windows x86.

Also fixes linking to C++ runtime for BoringSSL
(also see https://boringssl-review.googlesource.com/c/boringssl/+/67147).

Fixes #1761.
  • Loading branch information
ghedo committed May 8, 2024
1 parent 70b67f9 commit 16cff84
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion quiche/deps/boringssl
Submodule boringssl updated 10250 files
25 changes: 25 additions & 0 deletions quiche/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,27 @@ fn get_boringssl_cmake_config() -> cmake::Config {
}
}

/// Returns the C++ runtime library.
///
/// This is required because BoringSSL requires linking to the C++ runtime.
fn get_cpp_runtime_lib() -> Option<String> {
println!("cargo:rerun-if-env-changed=BORINGSSL_RUST_CPPLIB");

if let Ok(cpp_lib) = std::env::var("BORINGSSL_RUST_CPPLIB") {
return Some(cpp_lib);
}

if std::env::var_os("CARGO_CFG_UNIX").is_some() {
match std::env::var("CARGO_CFG_TARGET_OS").unwrap().as_ref() {
"macos" => Some("c++".into()),

_ => Some("stdc++".into()),
}
} else {
None
}
}

fn write_pkg_config() {
use std::io::prelude::*;

Expand Down Expand Up @@ -248,6 +269,10 @@ fn main() {
.unwrap_or("static".to_string());
println!("cargo:rustc-link-lib={bssl_link_kind}=ssl");
println!("cargo:rustc-link-lib={bssl_link_kind}=crypto");

if let Some(cpp_lib) = get_cpp_runtime_lib() {
println!("cargo:rustc-link-lib={}", cpp_lib);
}
}

if cfg!(feature = "boringssl-boring-crate") {
Expand Down

0 comments on commit 16cff84

Please sign in to comment.