[LLVMdev] Sanitizers libs in Compiler-RT

David Chisnall David.Chisnall at cl.cam.ac.uk
Mon Feb 3 00:39:45 PST 2014


On 3 Feb 2014, at 08:32, Evgeniy Stepanov <eugenis at google.com> wrote:

>> For us, the sanitizers contain behaviors/syscalls that are not valid on
>> consumer hardware. They perform "debug" functionality and thus can only
>> operate on special developer kits. Additionally, we need to put this type of
>> code into a dynamic library instead of a static library to avoid versioning
>> problems.
> 
> Could you elaborate on this? I can't imagine how making sanitizer
> runtime a shared library would help with the versioning problems,
> other than create them. As a static library it is always in sync with
> the compiler (unless someone wants to distribute them with an OS, of
> course).

There are two issues with compatibility in the sanitiser libraries:

- Compiler-Runtime interfaces
- Runtime-OS interfaces

The first is made easier with a static library, the latter is made much harder because modifying the OS (including libc and system calls) can break the static library.

Both are made easy with a shared library.  The first can be addressed using symbol versioning, the second by updating the shared library whenever the underlying interfaces change.  

David





More information about the llvm-dev mailing list