I have a Rust project blah
that links against a dynamic library libwhatever.so
that's written in C and can be built from source. (There's also a sys crate in between.) I would like to build the dynamic library with -fsanitize=address
, and the Rust project with -Z sanitizer=address
(plus build-std stuff), and have everything work together. So far I mostly get this error:
==364511==Your application is linked against incompatible ASan runtimes.
I think this is because Rust really wants to link its libasan (presumably the LLVM one?) statically, and that doesn't cooperate with the dynamic library from C, whether I link libasan statically or dynamically when building the latter. What is the way out here?