Skip to content

Commit 8d71d24

Browse files
alexBoringssl LUCI CQ
authored and
Boringssl LUCI CQ
committed
Export OPENSSL_NO_* defines in bssl-sys for consumption in rust-openssl
This is currently done by duplicating the list of constants. This was done for two reasons: 1) bindgen doesn't seem to do anything with bare-defines, 2) the list of defines appears to change incredibly rarely. The `links` key is required in `Cargo.toml` to work around rust-lang/cargo#3544 Change-Id: I11dca6e7eb62ab1b04053df654a4061cb5e25723 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/63305 Reviewed-by: David Benjamin <[email protected]> Commit-Queue: David Benjamin <[email protected]>
1 parent a014bda commit 8d71d24

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

include/openssl/opensslconf.h

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef OPENSSL_HEADER_OPENSSLCONF_H
1919
#define OPENSSL_HEADER_OPENSSLCONF_H
2020

21+
/* Keep in sync with the list in rust/bssl-sys/build.rs */
2122

2223
#define OPENSSL_NO_ASYNC
2324
#define OPENSSL_NO_BF

rust/bssl-sys/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ authors = ["Benjamin Brittain <[email protected]>"]
55
edition = "2018"
66
publish = false
77
license = "MIT"
8+
9+
# This exists to workaround a limitation in cargo:
10+
# https://github.com/rust-lang/cargo/issues/3544
11+
links = "bssl"

rust/bssl-sys/build.rs

+53
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,57 @@ use std::env;
1717
use std::path::Path;
1818
use std::path::PathBuf;
1919

20+
// Keep in sync with the list in include/openssl/opensslconf.h
21+
const OSSL_CONF_DEFINES: &[&str] = &[
22+
"OPENSSL_NO_ASYNC",
23+
"OPENSSL_NO_BF",
24+
"OPENSSL_NO_BLAKE2",
25+
"OPENSSL_NO_BUF_FREELISTS",
26+
"OPENSSL_NO_CAMELLIA",
27+
"OPENSSL_NO_CAPIENG",
28+
"OPENSSL_NO_CAST",
29+
"OPENSSL_NO_CMS",
30+
"OPENSSL_NO_COMP",
31+
"OPENSSL_NO_CT",
32+
"OPENSSL_NO_DANE",
33+
"OPENSSL_NO_DEPRECATED",
34+
"OPENSSL_NO_DGRAM",
35+
"OPENSSL_NO_DYNAMIC_ENGINE",
36+
"OPENSSL_NO_EC_NISTP_64_GCC_128",
37+
"OPENSSL_NO_EC2M",
38+
"OPENSSL_NO_EGD",
39+
"OPENSSL_NO_ENGINE",
40+
"OPENSSL_NO_GMP",
41+
"OPENSSL_NO_GOST",
42+
"OPENSSL_NO_HEARTBEATS",
43+
"OPENSSL_NO_HW",
44+
"OPENSSL_NO_IDEA",
45+
"OPENSSL_NO_JPAKE",
46+
"OPENSSL_NO_KRB5",
47+
"OPENSSL_NO_MD2",
48+
"OPENSSL_NO_MDC2",
49+
"OPENSSL_NO_OCB",
50+
"OPENSSL_NO_OCSP",
51+
"OPENSSL_NO_RC2",
52+
"OPENSSL_NO_RC5",
53+
"OPENSSL_NO_RFC3779",
54+
"OPENSSL_NO_RIPEMD",
55+
"OPENSSL_NO_RMD160",
56+
"OPENSSL_NO_SCTP",
57+
"OPENSSL_NO_SEED",
58+
"OPENSSL_NO_SM2",
59+
"OPENSSL_NO_SM3",
60+
"OPENSSL_NO_SM4",
61+
"OPENSSL_NO_SRP",
62+
"OPENSSL_NO_SSL_TRACE",
63+
"OPENSSL_NO_SSL2",
64+
"OPENSSL_NO_SSL3",
65+
"OPENSSL_NO_SSL3_METHOD",
66+
"OPENSSL_NO_STATIC_ENGINE",
67+
"OPENSSL_NO_STORE",
68+
"OPENSSL_NO_WHIRLPOOL",
69+
];
70+
2071
fn get_bssl_build_dir() -> PathBuf {
2172
println!("cargo:rerun-if-env-changed=BORINGSSL_BUILD_DIR");
2273
if let Some(build_dir) = env::var_os("BORINGSSL_BUILD_DIR") {
@@ -54,4 +105,6 @@ fn main() {
54105
bssl_sys_build_dir.display()
55106
);
56107
println!("cargo:rustc-link-lib=static=rust_wrapper");
108+
109+
println!("cargo:conf={}", OSSL_CONF_DEFINES.join(","));
57110
}

0 commit comments

Comments
 (0)