summaryrefslogtreecommitdiff
path: root/libsanitizer
AgeCommit message (Collapse)Author
2018-10-31Update LOCAL_PATCHES after libsanitizer merge.Martin Liska
2018-10-31 Martin Liska <mliska@suse.cz> * LOCAL_PATCHES: Update to installed revisions. From-SVN: r265673
2018-10-31New local GCC patch for CAN_SANITIZE_UB ifdef.Martin Liska
2018-10-31 Martin Liska <mliska@suse.cz> * ubsan/ubsan_platform.h: Add ifndef as we define it with -DCAN_SANITIZE_UB CFLAGS. From-SVN: r265669
2018-10-31Revert https://reviews.llvm.org/D40908 which changes asan offset to 1<<44.Martin Liska
2018-10-31 Martin Liska <mliska@suse.cz> * asan/asan_mapping.h: Revert shadow memory offset to 1 << 41. From-SVN: r265668
2018-10-31Apply LOCAL_PATCHES and remove not used ones.Martin Liska
2018-10-31 Martin Liska <mliska@suse.cz> * LOCAL_PATCHES: Update patch list. * asan/asan_globals.cc (CheckODRViolationViaIndicator): Apply patches from GCC's trunk. (CheckODRViolationViaPoisoning): Likewise. (RegisterGlobal): Likewise. * sanitizer_common/sanitizer_mac.cc (defined): Likewise. * sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Likewise. * ubsan/ubsan_handlers.cc (__ubsan::__ubsan_handle_cfi_bad_icall): Likewise. (__ubsan::__ubsan_handle_cfi_bad_icall_abort): Likewise. * ubsan/ubsan_handlers.h (struct CFIBadIcallData): Likewise. (struct CFICheckFailData): Likewise. (RECOVERABLE): Likewise. From-SVN: r265667
2018-10-31Update build system: include new files and run autoheader, autoconf, automakeMartin Liska
2018-10-31 Martin Liska <mliska@suse.cz> * config.h.in: Regenerate. * configure: Likewise. * sanitizer_common/Makefile.am: Include new files, remove old files. * sanitizer_common/Makefile.in: Regenerate. * ubsan/Makefile.am: Include new files, remove old files. * ubsan/Makefile.in: Likewise. * asan/Makefile.am: Include new files. * asan/Makefile.in: Regenerate. From-SVN: r265666
2018-10-31backport: All source files: Merge from upstream 345033.Martin Liska
Merge from upstream 345033. 2018-10-31 Martin Liska <mliska@suse.cz> * All source files: Merge from upstream 345033. From-SVN: r265665
2018-10-31Update merge script and HOWTO_MERGE documentation.Martin Liska
2018-10-31 Martin Liska <mliska@suse.cz> * HOWTO_MERGE: Enhance documentation. * merge.sh: Add support for git as well. From-SVN: r265664
2018-08-27Replace 8 spaces with a tabular in ChangeLog files.Martin Liska
From-SVN: r263886
2018-08-02Cherry-pick compiler-rt revision 338606 (PR sanitizer/86022).Martin Liska
Fix sizeof(struct pthread) in glibc 2.14. 2018-08-02 Martin Liska <mliska@suse.cz> PR sanitizer/86022 * sanitizer_common/sanitizer_linux_libcdep.cc (ThreadDescriptorSize): Cherry-pick compiler-rt revision 338606. From-SVN: r263246
2018-08-01Cherry-pick compiler-rt revision 318044 and 319180.Marek Polacek
[PowerPC][tsan] Update tsan to handle changed memory layouts in newer kernels In more recent Linux kernels with 47 bit VMAs the layout of virtual memory for powerpc64 changed causing the thread sanitizer to not work properly. This patch adds support for 47 bit VMA kernels for powerpc64. Tested on several 4.x and 3.x kernel releases. Regtested/bootstrapped on ppc64le-linux with kernel 4.14; applying to trunk/8.3. 2018-08-01 Marek Polacek <polacek@redhat.com> PR sanitizer/86759 * tsan/tsan_platform.h: Cherry-pick compiler-rt revision 318044. * tsan/tsan_platform_linux.cc: Cherry-pick compiler-rt revision 319180. From-SVN: r263229
2018-07-26libsanitizer: Mark REAL(swapcontext) with indirect_return attribute on x86H.J. Lu
Cherry-pick compiler-rt revision 337603: When shadow stack from Intel CET is enabled, the first instruction of all indirect branch targets must be a special instruction, ENDBR. lib/asan/asan_interceptors.cc has ... int res = REAL(swapcontext)(oucp, ucp); ... REAL(swapcontext) is a function pointer to swapcontext in libc. Since swapcontext may return via indirect branch on x86 when shadow stack is enabled, as in this case, int res = REAL(swapcontext)(oucp, ucp); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This function may be returned via an indirect branch. Here compiler must insert ENDBR after call, like call *bar(%rip) endbr64 I opened an LLVM bug: https://bugs.llvm.org/show_bug.cgi?id=38207 to add the indirect_return attribute so that it can be used to inform compiler to insert ENDBR after REAL(swapcontext) call. We mark REAL(swapcontext) with the indirect_return attribute if it is available. This fixed: https://bugs.llvm.org/show_bug.cgi?id=38249 Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D49608 PR target/86560 * asan/asan_interceptors.cc (swapcontext) Cherry-pick compiler-rt revision 337603. * sanitizer_common/sanitizer_internal_defs.h (__has_attribute): Likewise. From-SVN: r263009
2018-07-05RevertJakub Jelinek
2018-07-04 Maxim Ostapenko <m.ostapenko@samsung.com> PR sanitizer/84250 * config/gnu-user.h (LIBASAN_EARLY_SPEC): Pass -lstdc++ for static libasan. * gcc.c: Do not pass LIBUBSAN_SPEC if ASan is enabled with UBSan. * Makefile.am: Reorder libs. * Makefile.in: Regenerate. * asan/Makefile.am: Define DCAN_SANITIZE_UB=1, add dependancy from libsanitizer_ubsan.la. * asan/Makefile.in: Regenerate. * ubsan/Makefile.am: Define new libsanitizer_ubsan.la library. * ubsan/Makefile.in: Regenerate. From-SVN: r262433
2018-07-04re PR sanitizer/84250 (Symbol collision when using both Address and ↵Maxim Ostapenko
Undefined Behavior sanitizers (-fsanitize=address,undefined)) gcc/ 2018-07-04 Maxim Ostapenko <m.ostapenko@samsung.com> PR sanitizer/84250 * config/gnu-user.h (LIBASAN_EARLY_SPEC): Pass -lstdc++ for static libasan. * gcc.c: Do not pass LIBUBSAN_SPEC if ASan is enabled with UBSan. libsanitizer/ 2018-07-04 Maxim Ostapenko <m.ostapenko@samsung.com> PR sanitizer/84250 * Makefile.am: Reorder libs. * Makefile.in: Regenerate. * asan/Makefile.am: Define DCAN_SANITIZE_UB=1, add dependancy from libsanitizer_ubsan.la. * asan/Makefile.in: Regenerate. * ubsan/Makefile.am: Define new libsanitizer_ubsan.la library. * ubsan/Makefile.in: Regenerate. From-SVN: r262421
2018-06-13re PR sanitizer/86090 ([ASAN] ASAN does not properly configure libbacktrace.)Denis Khalikov
2018-06-13 Denis Khalikov <d.khalikov@partner.samsung.com> libsanitizer/ PR sanitizer/86090 * configure.ac: Check for lstat and readlink. * configure, config.h.in: Rebuild. From-SVN: r261564
2018-05-31re PR sanitizer/86012 (libsanitizer build failure on sparc64-linux-gnu)Matthias Klose
2018-05-31 Matthias Klose <doko@ubuntu.com> PR sanitizer/86012 * sanitizer_common/sanitizer_platform_limits_posix.cc: Define SIZEOF_STRUCT_USTAT for 32bit sparc. From-SVN: r260990
2018-05-24libsanitizer: Use pre-computed size of struct ustat for LinuxH.J. Lu
Cherry-pick compiler-rt revision 333213: <sys/ustat.h> has been removed from glibc 2.28 by: commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Sun Mar 18 11:28:59 2018 +0800 Deprecate ustat syscall interface This patch uses pre-computed size of struct ustat for Linux. PR sanitizer/85835 * sanitizer_common/sanitizer_platform_limits_posix.cc: Don't include <sys/ustat.h> for Linux. (SIZEOF_STRUCT_USTAT): New. (struct_ustat_sz): Use SIZEOF_STRUCT_USTAT for Linux. From-SVN: r260684
2018-04-26If someone has access to a 64-bit mips-linux system to test this (with the ↵Hans-Peter Nilsson
obvious edit), that'd be really nice. If someone has access to a 64-bit mips-linux system to test this (with the obvious edit), that'd be really nice. Until then, best to not introduce possible build failures. * configure.tgt <mips*-*-linux*>: Enable build, excluding mips*64*-*-linux*. From-SVN: r259665
2018-04-26As mentioned in <http://gcc.gnu.org/ml/gcc/2018-03/msg00133.html> the bogus ↵Hans-Peter Nilsson
adjustment to 160 from 144 (which is reverted here)... As mentioned in <http://gcc.gnu.org/ml/gcc/2018-03/msg00133.html> the bogus adjustment to 160 from 144 (which is reverted here), is a single-token commit in upstream r301307, an attempt to correct a failed build due to an upstream change to compile the runtime with D_FILE_OFFSET_BITS=64. The correct fix is here: just use the right include. Yes, user-struct-stat64-as-stat is actually 160 for MIPS o32 and I hear user-struct-stat is also 160 for n32. There are additional fields appended for user-struct-stat! I guess for MIPS it's as bad as it gets for mixing up kernel and user struct stat. The context of the patch doesn't show that in the #else there's the correct include, the one for <asm/stat.h> to get the kernel-struct-stat. If you can't compile it, IMHO the kernel headers are just too old; 3.2 is fine for example. * sanitizer_common/sanitizer_platform_limits_linux.cc: Do not take the shortcut to #include <sys/stat.h> for MIPS instead of the kernel <asm/stat.h>. Explain why sys/stat.h is misleading or wrong to get the kernel struct stat. * sanitizer_common/sanitizer_platform_limits_posix.h [__mips__]: Correct the value for 32-bit non-android struct_kernel_stat_sz. From-SVN: r259664
2018-04-26This appears to be present in compiler-rt upstream, but as part of more ↵Hans-Peter Nilsson
intrusive changes. This appears to be present in compiler-rt upstream, but as part of more intrusive changes. For gcc, the lack of this results in a fatal warning (-Werror) at build-time. * sanitizer_common/sanitizer_atomic_clang_other.h [_MIPS_SIM && _MIPS_SIM == _ABIO32] (lock): Add initializer for .pad member. From-SVN: r259663
2018-04-24Regenerate configure of target librariesH.J. Lu
* configure: Regenerated. From-SVN: r259610
2018-04-19cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace ↵Jakub Jelinek
--enable-cet=default with --enable-cet=auto. * config/cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace --enable-cet=default with --enable-cet=auto. * doc/install.texi: Document --disable-cet being the default and --enable-cet=auto. * configure: Regenerated. From-SVN: r259487
2018-04-18re PR jit/85384 (libgccjit does not work if --with-gcc-major-version is used)David Malcolm
PR jit/85384 * acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression. * configure.ac (gcc-driver-name.h): Honor --with-gcc-major-version by using gcc_base_ver to generate a gcc_driver_version, and use it when generating GCC_DRIVER_NAME. * configure: Regenerate. * configure: Regenerate. From-SVN: r259462
2018-04-18re PR sanitizer/85389 (posix_memalign() crash with address sanitizer when ↵Bill Seurer
passing invalid arguments) PR sanitizer/85389 * asan/asan_allocator.h (kAllocatorSpace): For __powerpc64__ change from 0xa0000000000ULL to ~(uptr)0. From-SVN: r259459
2018-03-19re PR sanitizer/84761 (AddressSanitizer is not compatible with glibc 2.27 on ↵Jakub Jelinek
x86) PR sanitizer/84761 * sanitizer_common/sanitizer_linux_libcdep.cc (__GLIBC_PREREQ): Define if not defined. (DL_INTERNAL_FUNCTION): Don't define. (InitTlsSize): For __i386__ if not compiled against glibc 2.27+ determine at runtime whether to use regparm(3), stdcall calling convention for older glibcs or normal calling convention for newer glibcs for call to _dl_get_tls_static_info. From-SVN: r258663
2018-03-14rs6000: Fix sanitizer frame unwind on 32-bit ABIsSegher Boessenkool
This fixes more than half of our testcase failures on BE. libsanitizer/ * sanitizer_common/sanitizer_stacktrace.cc (BufferedStackTrace::FastUnwindStack): Use the correct frame offset for PowerPC SYSV ABI. From-SVN: r258525
2018-02-19CET shouldn't be enabled in 32-bit run-time libraries by defualtIgor Tsimbalist
ENDBR32 and RDSSPD are multi-byte NOPs on x86-64 processors and newer x86 processors, starting Pentium Pro. They are UD on older 32-bit processors. Detect this at configure time and adjust the default value for enable_cet. GCC will enable CET in 32-bit run-time libraries in any case if --enable-cet is used to configure GCC. PR target/84148 * config/cet.m4: Check if target support multi-byte NOPS (SSE). * libatomic/configure: Regenerate. * libbacktrace/configure: Likewise. * libgcc/configure: Likewise. * libgfortran/configure: Likewise. * libgomp/configure: Likewise. * libitm/configure: Likewise. * libmpx/configure: Likewise. * libobjc/configure: Likewise. * libquadmath/configure: Likewise. * libsanitizer/configure: Likewise. * libssp/configure: Likewise. * libstdc++-v3/configure: Likewise. * libvtv/configure: Likewise. From-SVN: r257809
2018-02-06Add upstream svn rev for PR sanitizer/82825.Rainer Orth
From-SVN: r257405
2018-02-05Cherry-pick libsanitizer pointer-pair tristate option.Martin Liska
2018-02-05 Martin Liska <mliska@suse.cz> * doc/invoke.texi: Cherry-pick upstream r323995. 2018-02-05 Martin Liska <mliska@suse.cz> * c-c++-common/asan/pointer-compare-1.c: Adjust ASAN_OPTIONS options. * c-c++-common/asan/pointer-compare-2.c: Likewise. * c-c++-common/asan/pointer-subtract-1.c: Likewise. * c-c++-common/asan/pointer-subtract-2.c: Likewise. * c-c++-common/asan/pointer-subtract-3.c: Likewise. * c-c++-common/asan/pointer-subtract-4.c: Likewise. * c-c++-common/asan/pointer-compare-3.c: New test. 2018-02-05 Martin Liska <mliska@suse.cz> * asan/asan_flags.inc: Cherry-pick upstream r323995. * asan/asan_report.cc (CheckForInvalidPointerPair): Cherry-pick upstream r323995. From-SVN: r257387
2018-01-17Guard against undefined weak symbols before Mac OS X 10.9 (PR sanitizer/82825)Rainer Orth
PR sanitizer/82825 * sanitizer_common/sanitizer_internal_defs.h: Cherry-pick upstream r??????. From-SVN: r256813
2018-01-13Allow for lack of VM_MEMORY_OS_ALLOC_ONCE on Mac OS X (PR sanitizer/82824)Rainer Orth
PR sanitizer/82824 * lsan/lsan_common_mac.cc: Cherry-pick upstream r322437. From-SVN: r256650
2017-12-05invoke.texi: Document the options.Martin Liska
gcc/ * doc/invoke.texi: Document the options. * flag-types.h (enum sanitize_code): Add SANITIZE_POINTER_COMPARE and SANITIZE_POINTER_SUBTRACT. * ipa-inline.c (sanitize_attrs_match_for_inline_p): Add handling of SANITIZE_POINTER_COMPARE and SANITIZE_POINTER_SUBTRACT. * opts.c: Define new sanitizer options. * sanitizer.def (BUILT_IN_ASAN_POINTER_COMPARE): Likewise. (BUILT_IN_ASAN_POINTER_SUBTRACT): Likewise. gcc/c/ * c-typeck.c (pointer_diff): Add new argument and instrument pointer subtraction. (build_binary_op): Similar for pointer comparison. gcc/cp/ * typeck.c (pointer_diff): Add new argument and instrument pointer subtraction. (cp_build_binary_op): Create compound expression if doing an instrumentation. gcc/testsuite/ * c-c++-common/asan/pointer-compare-1.c: New test. * c-c++-common/asan/pointer-compare-2.c: New test. * c-c++-common/asan/pointer-subtract-1.c: New test. * c-c++-common/asan/pointer-subtract-2.c: New test. * c-c++-common/asan/pointer-subtract-3.c: New test. * c-c++-common/asan/pointer-subtract-4.c: New test. libsanitizer/ * asan/asan_descriptions.cc: Cherry-pick upstream r319668. * asan/asan_descriptions.h: Likewise. * asan/asan_report.cc: Likewise. * asan/asan_thread.cc: Likewise. * asan/asan_thread.h: Likewise. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r255404
2017-11-17Enable building libsanitizer with Intel CETIgor Tsimbalist
libsanitizer/ * acinclude.m4: Add enable.m4 and cet.m4. * Makefile.in: Regenerate. * asan/Makefile.am: Update AM_CXXFLAGS. * asan/Makefile.in: Regenerate. * configure: Likewise. * configure.ac: Set CET_FLAGS. Update EXTRA_CFLAGS, EXTRA_CXXFLAGS, EXTRA_ASFLAGS. * interception/Makefile.am: Update AM_CXXFLAGS. * interception/Makefile.in: Regenerate. * libbacktrace/Makefile.am: Update AM_CFLAGS, AM_CXXFLAGS. * libbacktrace/Makefile.in: Regenerate. * lsan/Makefile.am: Update AM_CXXFLAGS. * lsan/Makefile.in: Regenerate. * sanitizer_common/Makefile.am: Update AM_CXXFLAGS, AM_CCASFLAGS. * sanitizer_common/sanitizer_linux_x86_64.S: Include cet.h. Add _CET_ENDBR macro. * sanitizer_common/Makefile.in: Regenerate. * tsan/Makefile.am: Update AM_CXXFLAGS. * tsan/Makefile.in: Regenerate. * tsan/tsan_rtl_amd64.S Include cet.h. Add _CET_ENDBR macro. * ubsan/Makefile.am: Update AM_CXXFLAGS. * ubsan/Makefile.in: Regenerate. From-SVN: r254896
2017-11-08re PR bootstrap/82670 (UBSAN bootstrap broken after recent libsanitizer merge)Jakub Jelinek
PR bootstrap/82670 * ubsan/Makefile.am (ubsan_files): Remove ubsan_init_standalone.cc and ubsan_signals_standalone.cc. * ubsan/Makefile.in: Regenerated. From-SVN: r254518
2017-11-05[libsanitizer] Remove semicolon after do {} while (0) in macro bodyTom de Vries
2017-11-05 Tom de Vries <tom@codesourcery.com> PR other/82784 * asan/asan_poisoning.cc (CHECK_SMALL_REGION): Remove semicolon after "do {} while (0)". * lsan/lsan_common.cc (LOG_POINTERS, LOG_THREADS): Same. From-SVN: r254419
2017-10-20re PR sanitizer/82595 (bootstrap fails in libsanitizer on ↵Jakub Jelinek
powerpc64-unknown-linux-gnu) PR sanitizer/82595 * config/gnu-user.h (LIBTSAN_EARLY_SPEC): Add libtsan_preinit.o for -fsanitize=thread link of executables. (LIBLSAN_EARLY_SPEC): Add liblsan_preinit.o for -fsanitize=leak link of executables. * lsan/lsan.h (__lsan_init): Add SANITIZER_INTERFACE_ATTRIBUTE. * lsan/Makefile.am (nodist_toolexeclib_HEADERS): Add liblsan_preinit.o. (lsan_files): Remove lsan_preinit.cc. (liblsan_preinit.o): New rule. * lsan/Makefile.in: Regenerated. From-SVN: r253925
2017-10-19ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...Jakub Jelinek
* 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-05Add sanitizer_linux_x86_64.lo if __x86_64__ is defined by $CCH.J. Lu
Since size of "void *" is 4 bytes for x32, check if __x86_64__ is defined by $CC, instead of if test x$ac_cv_sizeof_void_p = x8; then to decide wether sanitizer_linux_x86_64.lo should be used. PR sanitizer/82379 * configure.tgt (SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS): Set to sanitizer_linux_x86_64.lo if __x86_64__ is defined by $CC. From-SVN: r253441
2017-10-02backtrace-rename.h (backtrace_uncompress_zdebug): Define.Jakub Jelinek
* libbacktrace/backtrace-rename.h (backtrace_uncompress_zdebug): Define. From-SVN: r253351
2017-08-07* include/system/sys/ptrace.h: New file.Jakub Jelinek
From-SVN: r250910
2017-07-28re PR sanitizer/80998 (Implement -fsanitize=pointer-overflow)Jakub Jelinek
PR sanitizer/80998 * sanopt.c (pass_sanopt::execute): Handle IFN_UBSAN_PTR. * tree-ssa-alias.c (call_may_clobber_ref_p_1): Likewise. * flag-types.h (enum sanitize_code): Add SANITIZER_POINTER_OVERFLOW. Or it into SANITIZER_UNDEFINED. * ubsan.c: Include gimple-fold.h and varasm.h. (ubsan_expand_ptr_ifn): New function. (instrument_pointer_overflow): New function. (maybe_instrument_pointer_overflow): New function. (instrument_object_size): Formatting fix. (pass_ubsan::execute): Call instrument_pointer_overflow and maybe_instrument_pointer_overflow. * internal-fn.c (expand_UBSAN_PTR): New function. * ubsan.h (ubsan_expand_ptr_ifn): Declare. * sanitizer.def (__ubsan_handle_pointer_overflow, __ubsan_handle_pointer_overflow_abort): New builtins. * tree-ssa-tail-merge.c (merge_stmts_p): Handle IFN_UBSAN_PTR. * internal-fn.def (UBSAN_PTR): New internal function. * opts.c (sanitizer_opts): Add pointer-overflow. * lto-streamer-in.c (input_function): Handle IFN_UBSAN_PTR. * fold-const.c (build_range_check): Compute pointer range check in integral type if pointer arithmetics would be needed. Formatting fixes. gcc/testsuite/ * c-c++-common/ubsan/ptr-overflow-1.c: New test. * c-c++-common/ubsan/ptr-overflow-2.c: New test. libsanitizer/ * ubsan/ubsan_handlers.cc: Cherry-pick upstream r304461. * ubsan/ubsan_checks.inc: Likewise. * ubsan/ubsan_handlers.h: Likewise. From-SVN: r250656
2017-07-14re PR sanitizer/81066 (sanitizer_stoptheworld_linux_libcdep.cc:276:22: ↵Jakub Jelinek
error: aggregate ‘sigaltstack handler_stack’ has incomplete type and cannot be defined) PR sanitizer/81066 * sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969. * sanitizer_common/sanitizer_linux.cc: Likewise. * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise. * tsan/tsan_platform_linux.cc: Likewise. From-SVN: r250200
2017-04-06Cherry-pick upstream r299036 from libsanitizer (PR sanitizer/80166).Martin Liska
2017-04-06 Martin Liska <mliska@suse.cz> PR sanitizer/80166 * sanitizer_common/sanitizer_common_interceptors.inc (INTERCEPTOR): Cherry-pick upstream r299036. 2017-04-06 Martin Liska <mliska@suse.cz> PR sanitizer/80166 * gcc.dg/asan/pr80166.c: New test. From-SVN: r246730
2017-03-22re PR sanitizer/78158 (Strange data race detection with thread sanitizer)Jakub Jelinek
PR sanitizer/78158 * tsan/tsan_interface_atomic.cc: Cherry-pick upstream r298378. From-SVN: r246402
2017-02-16re PR sanitizer/79562 (sanitizer breaks bootstrap of x86_64-*-freebsd)Andreas Tobler
2017-02-16 Andreas Tobler <andreast@gcc.gnu.org> PR sanitizer/79562 * sanitizer_common/sanitizer_platform_limits_posix.cc: Cherry-pick upstream r294806. From-SVN: r245520
2017-02-11re PR sanitizer/79341 (Many Asan tests fail on s390)Jakub Jelinek
PR sanitizer/79341 * configure.tgt (s390*-*-linux*): Don't disable libsanitizer on s390-linux 31-bit. * sanitizer_common/sanitizer_internal_defs.h: Cherry-pick upstream r294793. * sanitizer_common/sanitizer_common_interceptors.inc: Cherry-pick upstream r294790. * sanitizer_common/sanitizer_linux_s390.cc: Cherry-pick upstream r294799. From-SVN: r245350
2017-02-03re PR sanitizer/78663 (Hundreds of asan failures on x86_64-apple-darwin10 at ↵Maxim Ostapenko
r243019) PR sanitizer/78663 * sanitizer_common/sanitizer_mac.cc: Cherry-pick upstream r293992. * sanitizer_common/sanitizer_platform_interceptors.h: Likewise. From-SVN: r245149
2017-01-31s390.c (s390_asan_shadow_offset): New function.Jakub Jelinek
gcc/ * config/s390/s390.c (s390_asan_shadow_offset): New function. (TARGET_ASAN_SHADOW_OFFSET): Redefine. libsanitizer/ * configure.tgt: Enable asan and ubsan on 64-bit s390*-*-linux*. From-SVN: r245060
2017-01-24* configure.tgt: Enable tsan and lsan on powerpc64{,le}-*-linux*.Jakub Jelinek
From-SVN: r244854
2017-01-24re PR sanitizer/79168 (libtsan fails to link when cross compiling GCC tip ↵Jakub Jelinek
for Aarch64 target) PR sanitizer/79168 * merge.sh (change_comment_headers): Don't remove 2nd and 3rd line if the 3rd line doesn't contain 'The LLVM Compiler Infrastructure' text. * sanitizer_common/sanitizer_linux_mips64.S: Regenerated. * sanitizer_common/sanitizer_linux_x86_64.S: Likewise. * tsan/tsan_ppc_regs.h: Likewise. * tsan/tsan_rtl_aarch64.S: Likewise. * tsan/tsan_rtl_mips64.S: Likewise. * tsan/tsan_rtl_ppc64.S: Likewise. From-SVN: r244844
2017-01-21re PR other/79046 (g++ -print-file-name=plugin uses full version number in path)Jakub Jelinek
PR other/79046 libatomic/ * testsuite/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * testsuite/Makefile.in: Regenerated. libffi/ * configure.ac: Add GCC_BASE_VER. * include/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. * testsuite/Makefile.in: Regenerated. * include/Makefile.in: Regenerated. * Makefile.in: Regenerated. * man/Makefile.in: Regenerated. libgomp/ * testsuite/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * testsuite/Makefile.in: Regenerated. libitm/ * testsuite/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * testsuite/Makefile.in: Regenerated. libmpx/ * mpxrt/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * mpxwrap/Makefile.am (gcc_version): Likewise. * mpxrt/Makefile.in: Regenerated. * mpxwrap/Makefile.in: Regenerated. liboffloadmic/ * plugin/configure.ac: Add GCC_BASE_VER. * plugin/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * plugin/configure: Regenerated. * plugin/aclocal.m4: Regenerated. * plugin/Makefile.in: Regenerated. libsanitizer/ * interception/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * asan/Makefile.am (gcc_version): Likewise. * ubsan/Makefile.am (gcc_version): Likewise. * sanitizer_common/Makefile.am (gcc_version): Likewise. * lsan/Makefile.am (gcc_version): Likewise. * tsan/Makefile.am (gcc_version): Likewise. * interception/Makefile.in: Regenerated. * asan/Makefile.in: Regenerated. * ubsan/Makefile.in: Regenerated. * sanitizer_common/Makefile.in: Regenerated. * lsan/Makefile.in: Regenerated. * tsan/Makefile.in: Regenerated. libvtv/ * testsuite/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * testsuite/Makefile.in: Regenerated. From-SVN: r244742