Commit Graph

9 Commits

Author SHA1 Message Date
Chandler Carruth 1aa4fef601 Relocate the external headers provided by ASan and the common sanitizer
library.

These headers are intended to be available to user code when built with
AddressSanitizer (or one of the other sanitizer's in the future) to
interface with the runtime library. As such, they form stable external
C interfaces, and the headers shouldn't be located within the
implementation.

I've pulled them out into what seem like fairly obvious locations and
names, but I'm wide open to further bikeshedding of these names and
locations.

I've updated the code and the build system to cope with the new
locations, both CMake and Makefile. Please let me know if this breaks
anyone's build.

The eventual goal is to install these headers along side the Clang
builtin headers when we build the ASan runtime and install it. My
current thinking is to locate them at:

  <prefix>/lib/clang/X.Y/include/sanitizer/common_interface_defs.h
  <prefix>/lib/clang/X.Y/include/sanitizer/asan_interface.h
  <prefix>/lib/clang/X.Y/include/sanitizer/...

But maybe others have different suggestions?

Fixing the style of the #include between these headers at least unblocks
experimentation with installing them as they now should work when
installed in these locations.

llvm-svn: 162822
2012-08-29 02:27:54 +00:00
Alexander Potapenko fefc1e989c If the program is linked to a dynamic ASan runtime which is not present in DYLD_INSERT_LIBRARIES
(which, in turn, is required for our interceptors to take effect), re-exec the program with
DYLD_INSERT_LIBRARIES set.

llvm-svn: 162547
2012-08-24 09:22:05 +00:00
Kostya Serebryany 676bcdb838 [asan] run-time part of the initialization order checker. Patch by Reid Watson with some bits from kcc. The sub-pass is off by default for now. On simple tests it works fine.
llvm-svn: 162278
2012-08-21 14:10:25 +00:00
Alexey Samsonov 682a07cbe1 [ASan] move declaration of __asan_default_options to interface header
llvm-svn: 161932
2012-08-15 07:11:14 +00:00
Alexey Samsonov eb39adc9fa [ASan] make sure __asan_default_options gets default visibility, port corresponding test to lit
llvm-svn: 161869
2012-08-14 13:54:28 +00:00
Alexey Samsonov 0295edbfd5 [ASan] add new ASan option 'strip_path_prefix' to remove useless prefices from filenames in stack traces
llvm-svn: 161321
2012-08-06 13:00:21 +00:00
Alexey Samsonov c145b02607 [ASan] fixup for r160712: provide a default definition for weak __asan_default_options()
llvm-svn: 160718
2012-07-25 10:40:57 +00:00
Alexander Potapenko 9bac1cedbc Make __asan_default_options a weak function that returns a const char*.
Users may define it to override the default ASan options.
This function has to be marked with __attribute__((no_address_safety_analysis)), because it is called before ASan is fully initialized.

Add an output test checking the __asan_default_options functionality.

llvm-svn: 160712
2012-07-25 09:18:43 +00:00
Alexey Samsonov 9f666ea6ca [ASan] move flags description to separate header, add comments about them.
llvm-svn: 159985
2012-07-10 07:41:27 +00:00