[llvm-dev] Sanitizers and static linking

David Greene via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 23 10:04:37 PDT 2018


I am guessing that sanitizers are not supported with static linking.
The AddressSanitizer document says so explicitly but the others do not.
Yet the interceptors use dlsym to set up certain system calls, so by
definition they can't support static linking.

Given that sanitizers won't work with static linking, why are static
libraries created for them?

Should there be an error check in the interceptor code for dlsym
returning nullptr?  I just spent a bunch of time tracking down a problem
that turned out to be dlsym returning nullptr due to static linking.

It seems like either users should not be able to link sanitizer runtime
when linking statically or there should be a runtime check that dlsym
doesn't return nullptr.  Ideally both.

                          -David


More information about the llvm-dev mailing list