diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-07-25 10:40:57 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-07-25 10:40:57 +0000 |
commit | c145b026072a9eb7d62cb726c90b8f40e8194ecd (patch) | |
tree | cad7c262ce77c27fed59f208f60270def59366b4 | |
parent | f4156d496e902a31e413eed79166d4933f5bc3db (diff) | |
download | bcm5719-llvm-c145b026072a9eb7d62cb726c90b8f40e8194ecd.tar.gz bcm5719-llvm-c145b026072a9eb7d62cb726c90b8f40e8194ecd.zip |
[ASan] fixup for r160712: provide a default definition for weak __asan_default_options()
llvm-svn: 160718
-rw-r--r-- | compiler-rt/lib/asan/asan_flags.h | 11 | ||||
-rw-r--r-- | compiler-rt/lib/asan/asan_rtl.cc | 16 |
2 files changed, 13 insertions, 14 deletions
diff --git a/compiler-rt/lib/asan/asan_flags.h b/compiler-rt/lib/asan/asan_flags.h index 43aa3a334d2..ca9cf84ba6c 100644 --- a/compiler-rt/lib/asan/asan_flags.h +++ b/compiler-rt/lib/asan/asan_flags.h @@ -19,15 +19,14 @@ // ASan flag values can be defined in three ways: // 1) initialized with default values at startup. -// 2) overriden from user-specified string __asan_default_options. +// 2) overriden from string returned by user-specified function +// __asan_default_options(). // 3) overriden from env variable ASAN_OPTIONS. extern "C" { -#if !defined(_WIN32) - // We do not need to redefine the defaults right now on Windows. - const char *__asan_default_options() SANITIZER_WEAK_ATTRIBUTE; -#endif -} +// Can be overriden by user. +const char *__asan_default_options() SANITIZER_WEAK_ATTRIBUTE; +} // extern "C" namespace __asan { diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index 2f15445cc0c..5e6e8154718 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/lib/asan/asan_rtl.cc @@ -98,6 +98,10 @@ static void ParseFlagsFromString(Flags *f, const char *str) { ParseFlag(str, &f->disable_core, "disable_core"); } +extern "C" { +const char* WEAK __asan_default_options() { return ""; } +} // extern "C" + void InitializeFlags(Flags *f, const char *env) { internal_memset(f, 0, sizeof(*f)); @@ -126,15 +130,11 @@ void InitializeFlags(Flags *f, const char *env) { f->disable_core = (__WORDSIZE == 64); // Override from user-specified string. -#if !defined(_WIN32) - if (__asan_default_options) { - ParseFlagsFromString(f, __asan_default_options()); - if (flags()->verbosity) { - Report("Using the defaults from __asan_default_options: %s\n", - __asan_default_options()); - } + ParseFlagsFromString(f, __asan_default_options()); + if (flags()->verbosity) { + Report("Using the defaults from __asan_default_options: %s\n", + __asan_default_options()); } -#endif // Override from command line. ParseFlagsFromString(f, env); |