dart-sdk/runtime/bin/address_sanitizer.cc
Ivan Inozemtsev bbde6ba9b3 Do not declare __asan_default_options if GOOGLE3 is defined.
This allows to build VM with ASAN internally.

TEST=ci
Change-Id: I56eddb38952ba5ccb97426d83c6388790a9954ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224942
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2021-12-24 06:44:34 +00:00

29 lines
1 KiB
C++

// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOSX)
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
#if !defined(GOOGLE3)
const char* kAsanDefaultOptions =
"strict_memcmp=0 symbolize=0 check_printf=1 use_sigaltstack=1 "
"detect_leaks=0 fast_unwind_on_fatal=1 handle_segv=0 ";
extern "C" __attribute__((no_sanitize_address))
__attribute__((visibility("default")))
// The function isn't referenced from the executable itself. Make sure it isn't
// stripped by the linker.
__attribute__((used)) const char*
__asan_default_options() {
return kAsanDefaultOptions;
}
#endif // !defined(GOOGLE3)
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOSX)