diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-11-06 04:27:09 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-11-06 04:27:09 +0000 |
commit | e9e2b7f964413dccf4c724eb9ca39d2686cc29d4 (patch) | |
tree | 78f6b203ac9bba645e753c9ef3ab38d1fe020cf4 | |
parent | 4b9f050c2acab536356342ab96e6cc76c281ac24 (diff) | |
download | compiler-rt-e9e2b7f964413dccf4c724eb9ca39d2686cc29d4.tar.gz |
[ASan] Disable back init-order checker. Make strict_init_order imply check_initialization_order
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194125 91177308-0d34-0410-b5e6-96231b3b80d8
5 files changed, 12 insertions, 8 deletions
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc index a202abe4c..04d1850e2 100644 --- a/lib/asan/asan_rtl.cc +++ b/lib/asan/asan_rtl.cc @@ -148,7 +148,7 @@ void InitializeFlags(Flags *f, const char *env) { f->redzone = 16; f->debug = false; f->report_globals = 1; - f->check_initialization_order = true; + f->check_initialization_order = false; f->replace_str = true; f->replace_intrin = true; f->mac_ignore_invalid_free = false; @@ -199,6 +199,12 @@ void InitializeFlags(Flags *f, const char *env) { cf->detect_leaks = false; } #endif + + // Make "strict_init_order" imply "check_initialization_order". + // TODO(samsonov): Use a single runtime flag for an init-order checker. + if (f->strict_init_order) { + f->check_initialization_order = true; + } } // -------------------------- Globals --------------------- {{{1 diff --git a/lib/asan/lit_tests/TestCases/Linux/initialization-bug-any-order.cc b/lib/asan/lit_tests/TestCases/Linux/initialization-bug-any-order.cc index 2787fc5c2..042a07e42 100644 --- a/lib/asan/lit_tests/TestCases/Linux/initialization-bug-any-order.cc +++ b/lib/asan/lit_tests/TestCases/Linux/initialization-bug-any-order.cc @@ -4,11 +4,9 @@ // strict init-order checking). // RUN: %clangxx_asan -O0 %s %p/../Helpers/initialization-bug-extra.cc -o %t -// RUN: ASAN_OPTIONS=check_initialization_order=true:strict_init_order=true not %t 2>&1 \ -// RUN: | FileCheck %s +// RUN: ASAN_OPTIONS=strict_init_order=true not %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -O0 %p/../Helpers/initialization-bug-extra.cc %s -o %t -// RUN: ASAN_OPTIONS=check_initialization_order=true:strict_init_order=true not %t 2>&1 \ -// RUN: | FileCheck %s +// RUN: ASAN_OPTIONS=strict_init_order=true not %t 2>&1 | FileCheck %s // Do not test with optimization -- the error may be optimized away. diff --git a/lib/asan/lit_tests/TestCases/init-order-atexit.cc b/lib/asan/lit_tests/TestCases/init-order-atexit.cc index b5551dfc8..e38cdd273 100644 --- a/lib/asan/lit_tests/TestCases/init-order-atexit.cc +++ b/lib/asan/lit_tests/TestCases/init-order-atexit.cc @@ -5,7 +5,7 @@ // We do *not* want to report init-order bug in this case. // RUN: %clangxx_asan -O0 %s %p/Helpers/init-order-atexit-extra.cc -o %t -// RUN: ASAN_OPTIONS=check_initialization_order=true:strict_init_order=true not %t 2>&1 | FileCheck %s +// RUN: ASAN_OPTIONS=strict_init_order=true not %t 2>&1 | FileCheck %s #include <stdio.h> #include <stdlib.h> diff --git a/lib/asan/lit_tests/TestCases/init-order-dlopen.cc b/lib/asan/lit_tests/TestCases/init-order-dlopen.cc index 90f099d3f..d30d11999 100644 --- a/lib/asan/lit_tests/TestCases/init-order-dlopen.cc +++ b/lib/asan/lit_tests/TestCases/init-order-dlopen.cc @@ -12,7 +12,7 @@ // FIXME: find a better solution. // RUN: %clangxx_asan -O0 %s -o %t -Wl,--export-dynamic || \ // RUN: %clangxx_asan -O0 %s -o %t -// RUN: ASAN_OPTIONS=check_initialization_order=true:strict_init_order=true %t 2>&1 | FileCheck %s +// RUN: ASAN_OPTIONS=strict_init_order=true %t 2>&1 | FileCheck %s #include <dlfcn.h> #include <pthread.h> #include <stdio.h> diff --git a/lib/asan/lit_tests/TestCases/init-order-pthread-create.cc b/lib/asan/lit_tests/TestCases/init-order-pthread-create.cc index a75d1ebb8..52031216d 100644 --- a/lib/asan/lit_tests/TestCases/init-order-pthread-create.cc +++ b/lib/asan/lit_tests/TestCases/init-order-pthread-create.cc @@ -2,7 +2,7 @@ // called. // RUN: %clangxx_asan %s %p/Helpers/init-order-pthread-create-extra.cc -o %t -// RUN: ASAN_OPTIONS=check_initialization_order=true:strict_init_order=true %t +// RUN: ASAN_OPTIONS=strict_init_order=true %t #include <stdio.h> #include <pthread.h> |