#1095·sanitizers

wiki/AddressSanitizerAsDso and -DCOMPILER_RT_BUILD_SHARED_ASAN=ON

Author: dilyanpalauzovCreated May 19, 2019Updated Jan 23, 2026
Labelsdocs-cleanup-2025

https://github.com/google/sanitizers/wiki/AddressSanitizerAsDso says “you can now ask for shared runtime (aka ASAN-DSO) by cmaking with -DCOMPILER_RT_BUILD_SHARED_ASAN=ON (and then compiling your code with -fsanitize=address -shared-libasan)”.

What does this precisely mean, when has this to be passed?

If -DCOMPILER_RT_BUILD_SHARED_ASAN=ON is meant to be passed, when building clang, I build it with ccmakeand am not shown this exact option, so I do not set it. But I do have at the end /usr/local/lib/clang/8.0.0/lib/linux/libclang_rt.asan-x86_64.so.