Switch to bindgen's static inline support
This removes the need to hand-write rust_wrapper.c, because bindgen can
generate it for us. bindgen 0.65 or later is needed. Earlier versions of
this were buggy.
I've also removed the claim that bssl-sys is somehow a solution for
version skew. That was the original thinking from Android, but it hasn't
worked out. The version skew solution is simply "use bindgen, don't
handwrite bindings".
Android are quite behind their originaly July timeline for adding the
build half of this mechanism, but as this is now in the way of other
work, we're going to proceed with using this now. There is now a
unsupported_inline_wrappers cfg that Android can set to use the old
mechanism.
Update-Note: Rust support now requires your build correctly handle
--wrap-static-fns. On Android, you will need to enable the
unsupported_inline_wrappers cfg option until b/290347127 is fixed.
Chromium doesn't actually use any of the inline functions yet, so we can
handle --wrap-static-fns asynchronously, but I have a CL ready to enable
that.
Fixed: 596
Change-Id: I51fd1108a8c17a06f1bdd9171ebf352cea871723
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/58985
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
diff --git a/rust/bssl-sys/rust_wrapper.h b/rust/bssl-sys/rust_wrapper.h
index 632622a..55d5a6f 100644
--- a/rust/bssl-sys/rust_wrapper.h
+++ b/rust/bssl-sys/rust_wrapper.h
@@ -23,8 +23,10 @@
// The following functions are wrappers over inline functions and macros in
-// BoringSSL, which bindgen cannot currently correctly bind. These wrappers
-// ensure changes to the functions remain in lockstep with the Rust versions.
+// BoringSSL. These are not necessary, as bindgen has long supported
+// --wrap-static-fns, however Android is still missing support for this. (See
+// b/290347127.) These manual wrappers are, temporarily, retained for Android,
+// but this codepath is no longer tested or supported by BoringSSL.
int ERR_GET_LIB_RUST(uint32_t packed_error);
int ERR_GET_REASON_RUST(uint32_t packed_error);
int ERR_GET_FUNC_RUST(uint32_t packed_error);