dart-sdk/runtime/bin/address_sanitizer.cc
Ryan Macnak 877284947b Rename TARGET_OS_* to HOST_OS_*.
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.

Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2750843003 .
2017-03-15 13:11:05 -07:00

27 lines
958 B
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(HOST_OS_LINUX) || defined(HOST_OS_MACOSX)
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
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 // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_MACOSX)