diff --git a/compiler-rt/lib/asan/asan_flags.h b/compiler-rt/lib/asan/asan_flags.h index 3e37550e0fce..e259f11d63b7 100644 --- a/compiler-rt/lib/asan/asan_flags.h +++ b/compiler-rt/lib/asan/asan_flags.h @@ -23,12 +23,6 @@ // __asan_default_options(). // 3) overriden from env variable ASAN_OPTIONS. -extern "C" { -// Can be overriden by user. -const char *__asan_default_options() - SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; -} // extern "C" - namespace __asan { struct Flags { diff --git a/compiler-rt/lib/asan/asan_interface.h b/compiler-rt/lib/asan/asan_interface.h index c1390ceb8af5..8195c47dad06 100644 --- a/compiler-rt/lib/asan/asan_interface.h +++ b/compiler-rt/lib/asan/asan_interface.h @@ -161,6 +161,11 @@ extern "C" { // Prints accumulated stats to stderr. Used for debugging. void __asan_print_accumulated_stats() SANITIZER_INTERFACE_ATTRIBUTE; -} // namespace + + // This function may be overriden by user to provide a string containing + // ASan runtime options. See asan_flags.h for details. + const char* __asan_default_options() + SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; +} // extern "C" #endif // ASAN_INTERFACE_H diff --git a/compiler-rt/lib/asan/output_tests/test_output.sh b/compiler-rt/lib/asan/output_tests/test_output.sh index fccdb0def6b3..5dd4e9b4c2df 100755 --- a/compiler-rt/lib/asan/output_tests/test_output.sh +++ b/compiler-rt/lib/asan/output_tests/test_output.sh @@ -49,7 +49,7 @@ rm ./a.out echo "Checking the presense of interface symbols in compiled file" $CC -g -faddress-sanitizer -dead_strip -O2 $C_TEST.c -nm ./a.out | grep " T " | sed "s/.* T //" | grep "__asan_" | sed "s/___asan_/__asan_/" > symbols.txt +nm ./a.out | egrep " [TW] " | sed "s/.* T //" | sed "s/.* W //" | grep "__asan_" | sed "s/___asan_/__asan_/" > symbols.txt cat $ASAN_INTERFACE_H | sed "s/\/\/.*//" | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" > interface.txt for i in __asan_report_{load,store}{1,2,4,8,16} do