From df3a44c25bda70cdff34b3a285c75ee6d21270c2 Mon Sep 17 00:00:00 2001 From: Yuxiang Cao Date: Mon, 26 Jun 2023 20:04:26 -0700 Subject: [PATCH] build: strict bindgen on static functions --- mbedtls-sys/build/bindgen.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mbedtls-sys/build/bindgen.rs b/mbedtls-sys/build/bindgen.rs index cd13d26c1..cbd2045ce 100644 --- a/mbedtls-sys/build/bindgen.rs +++ b/mbedtls-sys/build/bindgen.rs @@ -100,12 +100,14 @@ impl super::BuildConfig { }; } - + // generate static function wrappers without any other rust related parameters to ensure // correctness of result C code bindgen::builder() .clang_args(cc.get_compiler().args().iter().map(|arg| arg.to_str().unwrap())) .header_contents("bindgen-input.h", &header) + .allowlist_function("^(?i)mbedtls_.*") + .allowlist_function("^(?i)psa_.*") .wrap_static_fns(true) .wrap_static_fns_path(&self.static_wrappers_c) .generate().expect("bindgen error");