diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index a202abe4c89d..04d1850e2199 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/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/compiler-rt/lib/asan/lit_tests/TestCases/Linux/initialization-bug-any-order.cc b/compiler-rt/lib/asan/lit_tests/TestCases/Linux/initialization-bug-any-order.cc index 2787fc5c21ac..042a07e428d9 100644 --- a/compiler-rt/lib/asan/lit_tests/TestCases/Linux/initialization-bug-any-order.cc +++ b/compiler-rt/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/compiler-rt/lib/asan/lit_tests/TestCases/init-order-atexit.cc b/compiler-rt/lib/asan/lit_tests/TestCases/init-order-atexit.cc index b5551dfc8eff..e38cdd273d58 100644 --- a/compiler-rt/lib/asan/lit_tests/TestCases/init-order-atexit.cc +++ b/compiler-rt/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 #include diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/init-order-dlopen.cc b/compiler-rt/lib/asan/lit_tests/TestCases/init-order-dlopen.cc index 90f099d3f2e1..d30d11999246 100644 --- a/compiler-rt/lib/asan/lit_tests/TestCases/init-order-dlopen.cc +++ b/compiler-rt/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 #include #include diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/init-order-pthread-create.cc b/compiler-rt/lib/asan/lit_tests/TestCases/init-order-pthread-create.cc index a75d1ebb8b6c..52031216d5bb 100644 --- a/compiler-rt/lib/asan/lit_tests/TestCases/init-order-pthread-create.cc +++ b/compiler-rt/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 #include