I'm developing a Rust library (on MacOS) that uses Rust's FFI to call out to a C library.
I'm using a Homebrew-installed version of llvm/clang to build the C library and I'd like to take advantage of the clang sanitizers (e.g. -fsanitize=address -fsanitize=undefined) where possible.
I have no problem building the shared C library with the sanitizers enabled but they also require link-time support and of course when I build the Rust library Cargo can't find sanitizer symbols (e.g. dyld: Symbol not found: ___ubsan_vptr_type_cache).
How can I persuade Cargo to look for the right Homebrew-installed support libraries on MacOS? Or, does someone have an example Rust FFI project I could look at that makes use of the Homebrew-installed llvm/clang?
Thanks!
Stu