2013-11-04 22:33:31 +01:00
|
|
|
//===-- sanitizer_platform.h ------------------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-08-14 10:47:11 +02:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2013-11-04 22:33:31 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Common platform macros.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SANITIZER_PLATFORM_H
|
|
|
|
#define SANITIZER_PLATFORM_H
|
|
|
|
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 13:23:59 +02:00
|
|
|
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
|
2018-10-31 12:14:23 +01:00
|
|
|
!defined(__OpenBSD__) && !defined(__APPLE__) && !defined(_WIN32) && \
|
|
|
|
!defined(__Fuchsia__) && !defined(__rtems__) && \
|
|
|
|
!(defined(__sun__) && defined(__svr4__))
|
2013-11-04 22:33:31 +01:00
|
|
|
# error "This operating system is not supported"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__linux__)
|
|
|
|
# define SANITIZER_LINUX 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_LINUX 0
|
|
|
|
#endif
|
|
|
|
|
2014-05-22 09:09:21 +02:00
|
|
|
#if defined(__FreeBSD__)
|
|
|
|
# define SANITIZER_FREEBSD 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_FREEBSD 0
|
|
|
|
#endif
|
|
|
|
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 13:23:59 +02:00
|
|
|
#if defined(__NetBSD__)
|
|
|
|
# define SANITIZER_NETBSD 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_NETBSD 0
|
|
|
|
#endif
|
|
|
|
|
2018-10-31 12:14:23 +01:00
|
|
|
#if defined(__OpenBSD__)
|
|
|
|
# define SANITIZER_OPENBSD 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_OPENBSD 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__sun__) && defined(__svr4__)
|
|
|
|
# define SANITIZER_SOLARIS 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_SOLARIS 0
|
|
|
|
#endif
|
|
|
|
|
2013-11-04 22:33:31 +01:00
|
|
|
#if defined(__APPLE__)
|
|
|
|
# define SANITIZER_MAC 1
|
2013-12-05 10:18:38 +01:00
|
|
|
# include <TargetConditionals.h>
|
|
|
|
# if TARGET_OS_IPHONE
|
|
|
|
# define SANITIZER_IOS 1
|
|
|
|
# else
|
|
|
|
# define SANITIZER_IOS 0
|
|
|
|
# endif
|
2018-10-31 12:14:23 +01:00
|
|
|
# if TARGET_OS_SIMULATOR
|
2015-10-21 09:32:45 +02:00
|
|
|
# define SANITIZER_IOSSIM 1
|
|
|
|
# else
|
|
|
|
# define SANITIZER_IOSSIM 0
|
|
|
|
# endif
|
2013-11-04 22:33:31 +01:00
|
|
|
#else
|
|
|
|
# define SANITIZER_MAC 0
|
2013-12-05 10:18:38 +01:00
|
|
|
# define SANITIZER_IOS 0
|
2015-10-21 09:32:45 +02:00
|
|
|
# define SANITIZER_IOSSIM 0
|
2013-11-04 22:33:31 +01:00
|
|
|
#endif
|
|
|
|
|
2016-11-08 23:04:09 +01:00
|
|
|
#if defined(__APPLE__) && TARGET_OS_IPHONE && TARGET_OS_WATCH
|
|
|
|
# define SANITIZER_WATCHOS 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_WATCHOS 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__APPLE__) && TARGET_OS_IPHONE && TARGET_OS_TV
|
|
|
|
# define SANITIZER_TVOS 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_TVOS 0
|
|
|
|
#endif
|
|
|
|
|
2013-11-04 22:33:31 +01:00
|
|
|
#if defined(_WIN32)
|
|
|
|
# define SANITIZER_WINDOWS 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_WINDOWS 0
|
|
|
|
#endif
|
|
|
|
|
2016-11-08 23:04:09 +01:00
|
|
|
#if defined(_WIN64)
|
|
|
|
# define SANITIZER_WINDOWS64 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_WINDOWS64 0
|
|
|
|
#endif
|
|
|
|
|
2014-11-13 21:41:38 +01:00
|
|
|
#if defined(__ANDROID__)
|
2013-11-04 22:33:31 +01:00
|
|
|
# define SANITIZER_ANDROID 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_ANDROID 0
|
|
|
|
#endif
|
|
|
|
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 13:23:59 +02:00
|
|
|
#if defined(__Fuchsia__)
|
|
|
|
# define SANITIZER_FUCHSIA 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_FUCHSIA 0
|
|
|
|
#endif
|
|
|
|
|
2018-10-31 12:14:23 +01:00
|
|
|
#if defined(__rtems__)
|
|
|
|
# define SANITIZER_RTEMS 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_RTEMS 0
|
|
|
|
#endif
|
|
|
|
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 13:23:59 +02:00
|
|
|
#define SANITIZER_POSIX \
|
2018-10-31 12:14:23 +01:00
|
|
|
(SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC || \
|
|
|
|
SANITIZER_NETBSD || SANITIZER_OPENBSD || SANITIZER_SOLARIS)
|
2014-05-22 09:09:21 +02:00
|
|
|
|
|
|
|
#if __LP64__ || defined(_WIN64)
|
|
|
|
# define SANITIZER_WORDSIZE 64
|
|
|
|
#else
|
|
|
|
# define SANITIZER_WORDSIZE 32
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SANITIZER_WORDSIZE == 64
|
|
|
|
# define FIRST_32_SECOND_64(a, b) (b)
|
|
|
|
#else
|
|
|
|
# define FIRST_32_SECOND_64(a, b) (a)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__x86_64__) && !defined(_LP64)
|
|
|
|
# define SANITIZER_X32 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_X32 0
|
|
|
|
#endif
|
|
|
|
|
2016-11-08 23:04:09 +01:00
|
|
|
#if defined(__mips__)
|
|
|
|
# define SANITIZER_MIPS 1
|
|
|
|
# if defined(__mips64)
|
|
|
|
# define SANITIZER_MIPS32 0
|
|
|
|
# define SANITIZER_MIPS64 1
|
|
|
|
# else
|
|
|
|
# define SANITIZER_MIPS32 1
|
|
|
|
# define SANITIZER_MIPS64 0
|
|
|
|
# endif
|
2015-10-21 09:32:45 +02:00
|
|
|
#else
|
2016-11-08 23:04:09 +01:00
|
|
|
# define SANITIZER_MIPS 0
|
|
|
|
# define SANITIZER_MIPS32 0
|
|
|
|
# define SANITIZER_MIPS64 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__s390__)
|
|
|
|
# define SANITIZER_S390 1
|
|
|
|
# if defined(__s390x__)
|
|
|
|
# define SANITIZER_S390_31 0
|
|
|
|
# define SANITIZER_S390_64 1
|
|
|
|
# else
|
|
|
|
# define SANITIZER_S390_31 1
|
|
|
|
# define SANITIZER_S390_64 0
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
# define SANITIZER_S390 0
|
|
|
|
# define SANITIZER_S390_31 0
|
|
|
|
# define SANITIZER_S390_64 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__powerpc__)
|
|
|
|
# define SANITIZER_PPC 1
|
|
|
|
# if defined(__powerpc64__)
|
|
|
|
# define SANITIZER_PPC32 0
|
|
|
|
# define SANITIZER_PPC64 1
|
|
|
|
// 64-bit PPC has two ABIs (v1 and v2). The old powerpc64 target is
|
|
|
|
// big-endian, and uses v1 ABI (known for its function descriptors),
|
|
|
|
// while the new powerpc64le target is little-endian and uses v2.
|
|
|
|
// In theory, you could convince gcc to compile for their evil twins
|
|
|
|
// (eg. big-endian v2), but you won't find such combinations in the wild
|
|
|
|
// (it'd require bootstrapping a whole system, which would be quite painful
|
|
|
|
// - there's no target triple for that). LLVM doesn't support them either.
|
|
|
|
# if _CALL_ELF == 2
|
|
|
|
# define SANITIZER_PPC64V1 0
|
|
|
|
# define SANITIZER_PPC64V2 1
|
|
|
|
# else
|
|
|
|
# define SANITIZER_PPC64V1 1
|
|
|
|
# define SANITIZER_PPC64V2 0
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define SANITIZER_PPC32 1
|
|
|
|
# define SANITIZER_PPC64 0
|
|
|
|
# define SANITIZER_PPC64V1 0
|
|
|
|
# define SANITIZER_PPC64V2 0
|
2015-10-21 09:32:45 +02:00
|
|
|
# endif
|
2016-11-08 23:04:09 +01:00
|
|
|
#else
|
|
|
|
# define SANITIZER_PPC 0
|
|
|
|
# define SANITIZER_PPC32 0
|
|
|
|
# define SANITIZER_PPC64 0
|
|
|
|
# define SANITIZER_PPC64V1 0
|
|
|
|
# define SANITIZER_PPC64V2 0
|
2015-10-21 09:32:45 +02:00
|
|
|
#endif
|
|
|
|
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 13:23:59 +02:00
|
|
|
#if defined(__arm__)
|
|
|
|
# define SANITIZER_ARM 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_ARM 0
|
|
|
|
#endif
|
|
|
|
|
2018-10-31 12:14:23 +01:00
|
|
|
#if SANITIZER_SOLARIS && SANITIZER_WORDSIZE == 32
|
|
|
|
# define SANITIZER_SOLARIS32 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_SOLARIS32 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__myriad2__)
|
|
|
|
# define SANITIZER_MYRIAD2 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_MYRIAD2 0
|
|
|
|
#endif
|
|
|
|
|
2014-05-22 09:09:21 +02:00
|
|
|
// By default we allow to use SizeClassAllocator64 on 64-bit platform.
|
|
|
|
// But in some cases (e.g. AArch64's 39-bit address space) SizeClassAllocator64
|
|
|
|
// does not work well and we need to fallback to SizeClassAllocator32.
|
|
|
|
// For such platforms build this code with -DSANITIZER_CAN_USE_ALLOCATOR64=0 or
|
|
|
|
// change the definition of SANITIZER_CAN_USE_ALLOCATOR64 here.
|
|
|
|
#ifndef SANITIZER_CAN_USE_ALLOCATOR64
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 13:23:59 +02:00
|
|
|
# if (SANITIZER_ANDROID && defined(__aarch64__)) || SANITIZER_FUCHSIA
|
2016-11-08 23:04:09 +01:00
|
|
|
# define SANITIZER_CAN_USE_ALLOCATOR64 1
|
|
|
|
# elif defined(__mips64) || defined(__aarch64__)
|
2014-05-22 09:09:21 +02:00
|
|
|
# define SANITIZER_CAN_USE_ALLOCATOR64 0
|
|
|
|
# else
|
|
|
|
# define SANITIZER_CAN_USE_ALLOCATOR64 (SANITIZER_WORDSIZE == 64)
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// The range of addresses which can be returned my mmap.
|
2015-11-23 10:07:18 +01:00
|
|
|
// FIXME: this value should be different on different platforms. Larger values
|
|
|
|
// will still work but will consume more memory for TwoLevelByteMap.
|
|
|
|
#if defined(__mips__)
|
2015-10-21 09:32:45 +02:00
|
|
|
# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 40)
|
2016-11-08 23:04:09 +01:00
|
|
|
#elif defined(__aarch64__)
|
2018-10-31 12:14:23 +01:00
|
|
|
# if SANITIZER_MAC
|
|
|
|
// Darwin iOS/ARM64 has a 36-bit VMA, 64GiB VM
|
|
|
|
# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 36)
|
|
|
|
# else
|
|
|
|
# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 48)
|
|
|
|
# endif
|
2019-03-13 10:11:46 +01:00
|
|
|
#elif defined(__sparc__)
|
2019-08-14 10:47:11 +02:00
|
|
|
#define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 52)
|
2014-05-22 09:09:21 +02:00
|
|
|
#else
|
|
|
|
# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47)
|
|
|
|
#endif
|
|
|
|
|
2019-03-13 10:11:46 +01:00
|
|
|
// Whether the addresses are sign-extended from the VMA range to the word.
|
|
|
|
// The SPARC64 Linux port implements this to split the VMA space into two
|
|
|
|
// non-contiguous halves with a huge hole in the middle.
|
|
|
|
#if defined(__sparc__) && SANITIZER_WORDSIZE == 64
|
2019-08-14 10:47:11 +02:00
|
|
|
#define SANITIZER_SIGN_EXTENDED_ADDRESSES 1
|
2019-03-13 10:11:46 +01:00
|
|
|
#else
|
2019-08-14 10:47:11 +02:00
|
|
|
#define SANITIZER_SIGN_EXTENDED_ADDRESSES 0
|
2019-03-13 10:11:46 +01:00
|
|
|
#endif
|
|
|
|
|
2014-05-22 09:09:21 +02:00
|
|
|
// The AArch64 linux port uses the canonical syscall set as mandated by
|
|
|
|
// the upstream linux community for all new ports. Other ports may still
|
|
|
|
// use legacy syscalls.
|
|
|
|
#ifndef SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
|
|
|
|
# if defined(__aarch64__) && SANITIZER_LINUX
|
|
|
|
# define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 1
|
|
|
|
# else
|
|
|
|
# define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 0
|
|
|
|
# endif
|
|
|
|
#endif
|
2013-11-04 22:33:31 +01:00
|
|
|
|
2015-03-23 14:43:22 +01:00
|
|
|
// udi16 syscalls can only be used when the following conditions are
|
|
|
|
// met:
|
|
|
|
// * target is one of arm32, x86-32, sparc32, sh or m68k
|
|
|
|
// * libc version is libc5, glibc-2.0, glibc-2.1 or glibc-2.2 to 2.15
|
|
|
|
// built against > linux-2.2 kernel headers
|
|
|
|
// Since we don't want to include libc headers here, we check the
|
|
|
|
// target only.
|
|
|
|
#if defined(__arm__) || SANITIZER_X32 || defined(__sparc__)
|
|
|
|
#define SANITIZER_USES_UID16_SYSCALLS 1
|
|
|
|
#else
|
|
|
|
#define SANITIZER_USES_UID16_SYSCALLS 0
|
|
|
|
#endif
|
|
|
|
|
2016-11-08 23:04:09 +01:00
|
|
|
#if defined(__mips__)
|
2014-11-13 21:41:38 +01:00
|
|
|
# define SANITIZER_POINTER_FORMAT_LENGTH FIRST_32_SECOND_64(8, 10)
|
|
|
|
#else
|
|
|
|
# define SANITIZER_POINTER_FORMAT_LENGTH FIRST_32_SECOND_64(8, 12)
|
|
|
|
#endif
|
|
|
|
|
2015-10-21 09:32:45 +02:00
|
|
|
/// \macro MSC_PREREQ
|
|
|
|
/// \brief Is the compiler MSVC of at least the specified version?
|
|
|
|
/// The common \param version values to check for are:
|
|
|
|
/// * 1800: Microsoft Visual Studio 2013 / 12.0
|
|
|
|
/// * 1900: Microsoft Visual Studio 2015 / 14.0
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
# define MSC_PREREQ(version) (_MSC_VER >= (version))
|
|
|
|
#else
|
|
|
|
# define MSC_PREREQ(version) 0
|
|
|
|
#endif
|
|
|
|
|
2019-03-06 12:46:15 +01:00
|
|
|
#if SANITIZER_MAC && !(defined(__arm64__) && SANITIZER_IOS)
|
2016-11-08 23:04:09 +01:00
|
|
|
# define SANITIZER_NON_UNIQUE_TYPEINFO 0
|
2019-03-06 12:46:15 +01:00
|
|
|
#else
|
|
|
|
# define SANITIZER_NON_UNIQUE_TYPEINFO 1
|
2016-11-08 23:04:09 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// On linux, some architectures had an ABI transition from 64-bit long double
|
|
|
|
// (ie. same as double) to 128-bit long double. On those, glibc symbols
|
|
|
|
// involving long doubles come in two versions, and we need to pass the
|
|
|
|
// correct one to dlvsym when intercepting them.
|
|
|
|
#if SANITIZER_LINUX && (SANITIZER_S390 || SANITIZER_PPC32 || SANITIZER_PPC64V1)
|
|
|
|
#define SANITIZER_NLDBL_VERSION "GLIBC_2.4"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SANITIZER_GO == 0
|
|
|
|
# define SANITIZER_GO 0
|
|
|
|
#endif
|
|
|
|
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 13:23:59 +02:00
|
|
|
// On PowerPC and ARM Thumb, calling pthread_exit() causes LSan to detect leaks.
|
|
|
|
// pthread_exit() performs unwinding that leads to dlopen'ing libgcc_s.so.
|
|
|
|
// dlopen mallocs "libgcc_s.so" string which confuses LSan, it fails to realize
|
|
|
|
// that this allocation happens in dynamic linker and should be ignored.
|
|
|
|
#if SANITIZER_PPC || defined(__thumb__)
|
|
|
|
# define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT 1
|
|
|
|
#else
|
|
|
|
# define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT 0
|
|
|
|
#endif
|
|
|
|
|
2018-10-31 12:14:23 +01:00
|
|
|
#if SANITIZER_FREEBSD || SANITIZER_MAC || SANITIZER_NETBSD || \
|
|
|
|
SANITIZER_OPENBSD || SANITIZER_SOLARIS
|
|
|
|
# define SANITIZER_MADVISE_DONTNEED MADV_FREE
|
|
|
|
#else
|
|
|
|
# define SANITIZER_MADVISE_DONTNEED MADV_DONTNEED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Older gcc have issues aligning to a constexpr, and require an integer.
|
|
|
|
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56859 among others.
|
|
|
|
#if defined(__powerpc__) || defined(__powerpc64__)
|
|
|
|
# define SANITIZER_CACHE_LINE_SIZE 128
|
|
|
|
#else
|
|
|
|
# define SANITIZER_CACHE_LINE_SIZE 64
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Enable offline markup symbolizer for Fuchsia and RTEMS.
|
|
|
|
#if SANITIZER_FUCHSIA || SANITIZER_RTEMS
|
|
|
|
#define SANITIZER_SYMBOLIZER_MARKUP 1
|
|
|
|
#else
|
|
|
|
#define SANITIZER_SYMBOLIZER_MARKUP 0
|
|
|
|
#endif
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 13:23:59 +02:00
|
|
|
|
2019-08-14 10:47:11 +02:00
|
|
|
// Enable ability to support sanitizer initialization that is
|
|
|
|
// compatible with the sanitizer library being loaded via
|
|
|
|
// `dlopen()`.
|
|
|
|
#if SANITIZER_MAC
|
|
|
|
#define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN 1
|
|
|
|
#else
|
|
|
|
#define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN 0
|
|
|
|
#endif
|
|
|
|
|
2013-11-04 22:33:31 +01:00
|
|
|
#endif // SANITIZER_PLATFORM_H
|