google / sanitizers

AddressSanitizer, ThreadSanitizer, MemorySanitizer
Other
11.58k stars 1.04k forks source link

Question on Clang's address sanitizer documentation #1596

Open kuanjen100 opened 2 years ago

kuanjen100 commented 2 years ago

In the Clang document on address sanitizer, under limitations (https://clang.llvm.org/docs/AddressSanitizer.html#limitations), the last bullet reads "Static linking of executables is not supported". That seems to contradict with my understanding that linking an executable with Clang using -fsanitize=address would make the executable statically links in the ASAN runtime library. What am I missing? Thanks.

ckwastra commented 3 weeks ago

The documentation is trying to say that static binaries (i.e., those built with the -static option) are not supported when using AddressSanitizer. See also D55066.