Use --allowlist-file in bssl-sys
bindgen, by default, will bind every random symbol in the libc, which is
clearly unreasonable. Now that --allowlist-file exists, we can switch to
doing what it should have done from the beginning.
This produces a pretty large diff in the bindgen output, but it's all to
exclude miscellaneous bits of libc.
Change-Id: I9a35fda10ff6f1b82449919f9fcc2ea86ad5b802
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/57325
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Alex Gaynor <alex.gaynor@gmail.com>
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
diff --git a/rust/CMakeLists.txt b/rust/CMakeLists.txt
index 344d80f..019976b 100644
--- a/rust/CMakeLists.txt
+++ b/rust/CMakeLists.txt
@@ -12,23 +12,8 @@
--size_t-is-usize
--default-macro-constant-type="signed"
--rustified-enum="point_conversion_form_t"
- # These are not BoringSSL symbols, they are from glibc
- # and are not relevant to the build besides throwing warnings
- # about their 'long double' (aka u128) not being FFI safe.
- # We block those functions so that the build doesn't
- # spam warnings.
- #
- # https://github.com/rust-lang/rust-bindgen/issues/1549 describes the current problem
- # and other folks' solutions.
- #
- # We will explore migrating to https://github.com/rust-lang/rust-bindgen/pull/2122
- # when it lands
- --blocklist-function="strtold"
- --blocklist-function="qecvt"
- --blocklist-function="qecvt_r"
- --blocklist-function="qgcvt"
- --blocklist-function="qfcvt"
- --blocklist-function="qfcvt_r"
+ --allowlist-file=".*/include/openssl/.*\\.h"
+ --allowlist-file=".*/rust_wrapper\\.h"
-- # these are LLVM arg passthroughs
-I../include
# https://doc.rust-lang.org/nightly/rustc/platform-support.html