[PATCH] D29148: [compiler-rt] Provide a list of functions from sanitizers's interfaces.
Marcos Pividori via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 27 13:10:13 PST 2017
mpividori added a comment.
@kubamracek @kcc
It is not easy to provide a test for all the platforms, because we expose different interfaces in each case. Of course, we could add some extra files of platform specific interfaces like: `asan_interface_linux.inc` `asan_interface_windows.inc` , etc. But I really don't like that.
In https://reviews.llvm.org/D29229 I fix the tests for Windows. It checks that the list of functions mentioned in `sanitizer_interface.inc` files matches the list of functions exported by asan library. So, after this changes, this continue working as before, if you forget to add a new function to the interface list, only the tests on Windows fail.
I have a new idea that would simplify all of this. We could generate these files automatically, with some cmake code, just after creating the sanitizers libraries. So this is what I propose:
- WEAK SYMBOLS: Instead of the `sanitizer_interface.inc` files, we could have a different file: `sanitizer_weak_interface.inc` that only lists weak symbols. So it can be used by apple, and we also need it to generate the sanitizers main libraries for windows (asan dll, and asan static library) and the `dynamic_runtime_thunks`. Also, we could generate it automatically searching in a sanitizer directory for all the definitions like "WEAK_DEF(....)". We could include that to cmake, and we avoid a lot of problems.
- INTERFACE LIST: We need a list of the functions exported by the sanitizers to generate the `dll_thunk` static library. So, we include some cmake code to list all the symbols exported by the asan library and then use that file to compile `dll_thunk` library.
I will work on this.
Thanks,
https://reviews.llvm.org/D29148
More information about the llvm-commits
mailing list