xref: /aosp_15_r20/external/boringssl/src/rust/bssl-sys/README.md (revision 8fb009dc861624b67b6cdb62ea21f0f22d0c584b)
1*8fb009dcSAndroid Build Coastguard Workerbssl-sys
2*8fb009dcSAndroid Build Coastguard Worker============
3*8fb009dcSAndroid Build Coastguard Worker
4*8fb009dcSAndroid Build Coastguard WorkerA low-level binding crate for Rust that moves in lockstop with BoringSSL.
5*8fb009dcSAndroid Build Coastguard Worker
6*8fb009dcSAndroid Build Coastguard Worker### How it works
7*8fb009dcSAndroid Build Coastguard Worker`bssl-sys` uses `bindgen` as part of the cmake build process to generate Rust compatibility shims for the targeted platform. It is important to generate it for the correct platform because `bindgen` uses LLVM information for alignment which varies depending on architecture.
8*8fb009dcSAndroid Build Coastguard Worker
9*8fb009dcSAndroid Build Coastguard Worker### To Use
10*8fb009dcSAndroid Build Coastguard Worker1. Build `boringssl` with `-DRUST_BINDINGS=<rust-triple>`, which should match the [Rust target triple](https://doc.rust-lang.org/nightly/rustc/platform-support.html) when building `bssl-sys`,
11*8fb009dcSAndroid Build Coastguard Worker2. install `bindgen`, and
12*8fb009dcSAndroid Build Coastguard Worker3. install [`cargo-deny`](https://github.com/EmbarkStudios/cargo-deny).
13*8fb009dcSAndroid Build Coastguard Worker
14*8fb009dcSAndroid Build Coastguard WorkerAfter that, the `bssl-sys` crate can be built. By default, it looks for `bindgen` output and BoringSSL static libraries in the `build` directory. This can be reconfigured with `BORINGSSL_BUILD_DIR` environment variable. Note the environment variable is evaluated relative to `rust/bssl-sys/src`, so using an absolute path may be more convenient.
15