This reapplies 8fa66c6ca7 ([asan][windows]
Eliminate the static asan runtime on windows) for a second time.
That PR bounced off the tests because it caused failures in the other
sanitizer runtimes, these have been fixed by only building interception,
sanitizer_common, and asan with /MD, and continuing to build the rest of
the runtimes with /MT. This does mean that any usage of the static
ubsan/fuzzer/etc runtimes will mean you're mixing different runtime
library linkages in the same app, the interception, sanitizer_common,
and asan runtimes are designed for this, however it does result in some
linker warnings.
Additionally, it turns out when building in release-mode with
LLVM_ENABLE_PDBs the build system forced /OPT:ICF. This totally breaks
asan's "new" method of doing "weak" functions on windows, and so
/OPT:NOICF was explicitly added to asan's link flags.
---------
Co-authored-by: Amy Wishnousky <amyw@microsoft.com>
19 lines
404 B
C++
19 lines
404 B
C++
// RUN: %clangxx_asan -O2 %s -o %t
|
|
// RUN: %run %t 2>&1 | FileCheck %s
|
|
|
|
const char *kAsanDefaultOptions = "verbosity=1 help=1";
|
|
// Required for dyld macOS 12.0+
|
|
#if (__APPLE__)
|
|
__attribute__((weak))
|
|
#endif
|
|
__attribute__((no_sanitize_address))
|
|
extern "C" const char *
|
|
__asan_default_options() {
|
|
// CHECK: Available flags for AddressSanitizer:
|
|
return kAsanDefaultOptions;
|
|
}
|
|
|
|
int main() {
|
|
return 0;
|
|
}
|