[llvm-commits] [compiler-rt] r160718 - in /compiler-rt/trunk/lib/asan: asan_flags.h asan_rtl.cc
Alexey Samsonov
samsonov at google.com
Wed Jul 25 03:40:57 PDT 2012
Author: samsonov
Date: Wed Jul 25 05:40:57 2012
New Revision: 160718
URL: http://llvm.org/viewvc/llvm-project?rev=160718&view=rev
Log:
[ASan] fixup for r160712: provide a default definition for weak __asan_default_options()
Modified:
compiler-rt/trunk/lib/asan/asan_flags.h
compiler-rt/trunk/lib/asan/asan_rtl.cc
Modified: compiler-rt/trunk/lib/asan/asan_flags.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_flags.h?rev=160718&r1=160717&r2=160718&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_flags.h (original)
+++ compiler-rt/trunk/lib/asan/asan_flags.h Wed Jul 25 05:40:57 2012
@@ -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 {
Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=160718&r1=160717&r2=160718&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Wed Jul 25 05:40:57 2012
@@ -98,6 +98,10 @@
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 @@
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);
More information about the llvm-commits
mailing list