Commit Graph

61 Commits

Author SHA1 Message Date
H.J. Lu
e276866fd7 Check __x86_64__ for FPU state
PR sanitizer/59018
	* sanitizer_common/sanitizer_platform_limits_posix.cc
	(struct_user_fpxregs_struct_sz): Initialize to 0 if __x86_64__ is
	defined.

From-SVN: r204483
2013-11-06 13:52:29 -08:00
H.J. Lu
f5c36cfc4b Use 64-bit system types for x86-64
PR sanitizer/59018
	* sanitizer_common/sanitizer_platform_limits_linux.cc
	(struct_kernel_stat64_sz): Initialize to 0 if __x86_64__ is
	defined.
	* sanitizer_common/sanitizer_platform_limits_posix.h
	(__sanitizer_dirent): Use 64-bit d_ino/d_off if __x86_64__ is
	defined.
	(__sanitizer___kernel_uid_t): Typedef as unsigned if __x86_64__
	is defined.
	(__sanitizer___kernel_gid_t): Likewise.
	(__sanitizer___kernel_off_t): Typedef as long long if __x86_64__
	is defined.

From-SVN: r204482
2013-11-06 13:51:41 -08:00
H.J. Lu
e45de14ec7 Fix internal_clone for x32
PR sanitizer/59018
	* sanitizer_common/sanitizer_linux.cc (internal_clone): Allocate
	2 64-bit integers to save and restore fn and arg.  Properly load
	newtls/child_tidptr into r8/r10.

From-SVN: r204481
2013-11-06 13:50:42 -08:00
H.J. Lu
38693e39b6 Cast pointers to uptr for 64-bit syscalls
PR sanitizer/59018
	* sanitizer_common/sanitizer_linux.cc (internal_mmap,
	internal_munmap, internal_open, internal_read, internal_write,
	internal_stat, internal_lstat, internal_fstat, internal_readlink,
	internal_unlink, internal_execve, NanoTime, BlockingMutex::Lock,
	BlockingMutex::Unlock, internal_ptrace, internal_getdents,
	internal_sigaltstack): Cast pointers to uptr for 64-bit syscalls.

From-SVN: r204480
2013-11-06 13:49:36 -08:00
Kostya Serebryany
ef1b3fda32 libsanitizer merge from upstream r191666
This may break gcc-asan on Mac, will follow up separately.

From-SVN: r204368
2013-11-04 21:33:31 +00:00
Gerald Pfeifer
ecdbd01aa1 Fix up ChangeLog entries (name, e-mail, formatting, otherwise).
From-SVN: r203992
2013-10-23 21:30:54 +00:00
Alan Modra
3cbe17f7de libtool.m4 (_LT_ENABLE_LOCK <ld -m flags>): Remove non-canonical ppc host match.
* libtool.m4 (_LT_ENABLE_LOCK <ld -m flags>): Remove non-canonical
	ppc host match.  Support little-endian powerpc linux hosts.
Regenerate configure throughout.

From-SVN: r202773
2013-09-20 19:17:52 +09:30
Iain Sandoe
0cea211ebd darwin.h (LINK_COMMAND_SPEC_A): Revise sanitizer specs to include sanitize(undefined).
gcc:

        * config/darwin.h (LINK_COMMAND_SPEC_A): Revise sanitizer specs to
        include sanitize(undefined).

libsanitizer:

        * ubsan/Makefile.am (libubsan_la_LIBADD): Revise to omit
        libinterception.la for Darwin.
        * ubsan/Makefile.in: Regenerate.

From-SVN: r202144
2013-09-01 12:16:07 +00:00
Marek Polacek
de5a5fa139 Merge ubsan into trunk.
From-SVN: r202113
2013-08-30 16:12:58 +00:00
Christophe Lyon
634cfa2ba8 sanitizer_linux.cc (MemoryMappingLayout::Next): Cherry pick upstream r182922.
2013-06-03  Christophe Lyon  <christophe.lyon@linaro.org>

       * sanitizer_common/sanitizer_linux.cc (MemoryMappingLayout::Next):
       Cherry pick upstream r182922.

From-SVN: r199606
2013-06-03 15:04:35 +02:00
Christophe Lyon
8a5800b82f arm.c (arm_asan_shadow_offset): New function.
2013-05-06  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* config/arm/arm.c (arm_asan_shadow_offset): New function.
	(TARGET_ASAN_SHADOW_OFFSET): Define.
	* config/arm/linux-eabi.h (ASAN_CC1_SPEC): Define.
	(LINUX_OR_ANDROID_CC): Add ASAN_CC1_SPEC.

	libsanitizer/
	* configure.tgt: Add ARM pattern.

	testsuite/
	* lib/target-supports.exp (check_effective_target_hw): New
	function.
	* c-c++-common/asan/clone-test-1.c: Call
	check_effective_target_hw.
	* c-c++-common/asan/rlimit-mmap-test-1.c: Likewise.
	* c-c++-common/asan/heap-overflow-1.c: Update regexps to accept
	possible decorations.
	* c-c++-common/asan/null-deref-1.c: Likewise.
	* c-c++-common/asan/stack-overflow-1.c: Likewise.
	* c-c++-common/asan/strncpy-overflow-1.c: Likewise.
	* c-c++-common/asan/use-after-free-1.c: Likewise.
	* g++.dg/asan/deep-thread-stack-1.C: Likewise.
	* g++.dg/asan/large-func-test-1.C: Likewise.

From-SVN: r198683
2013-05-07 16:17:50 +02:00
Jakub Jelinek
a745e44403 Fix up ChangeLog entry date.
From-SVN: r196965
2013-03-22 15:17:24 +01:00
Jakub Jelinek
1868beeeca re PR other/43620 ([4.3 Release Blocker] Uploading to gnu.org will fail due to automake security issue)
PR other/43620
	* configure.ac (AM_INIT_AUTOMAKE): Add no-dist.
	* Makefile.in: Regenerated.
	* asan/Makefile.in: Regenerated.
	* interception/Makefile.in: Regenerated.
	* sanitizer_common/Makefile.in: Regenerated.
	* tsan/Makefile.in: Regenerated.

From-SVN: r196964
2013-03-22 15:14:42 +01:00
Jakub Jelinek
4c37612689 asan_mapping.h (kMidMemEnd): Increase to 0x4fffffffffULL.
* asan/asan_mapping.h (kMidMemEnd): Increase to 0x4fffffffffULL.
	* asan/asan_rtl.cc (__asan_init): Increase kMidMemEnd to
	0x4fffffffffULL.

From-SVN: r196355
2013-02-28 20:55:40 +01:00
Jakub Jelinek
7d61373544 re PR sanitizer/56393 (SIGSEGV when -fsanitize=address and dynamic lib with global objects)
PR sanitizer/56393
	* config/gnu-user.h (LIBASAN_EARLY_SPEC): Link in libasan_preinit.o
	if not linking a shared library.

	* lib/asan-dg.exp (asan_link_flags): Add
	-B${gccpath}/libsanitizer/asan/ to flags.

	* asan/Makefile.am (nodist_toolexeclib_HEADERS): Set to
	libasan_preinit.o.
	(libasan_preinit.o): Depend on asan_preinit.o.
	* asan/Makefile.in: Regenerated.
	* asan/asan_preinit.cc: New file, synced from upstream.
	* asan/asan_rtl.cc: Remove preinit stuff, synced from upstream.

From-SVN: r196222
2013-02-22 17:07:36 +01:00
Jack Howarth
304886c59c Makefile.am (libasan_la_SOURCES): Remove deprecated dynamic/asan_interceptors_dynamic.cc.
* asan/Makefile.am (libasan_la_SOURCES): Remove deprecated
	dynamic/asan_interceptors_dynamic.cc.
	* asan/Makefile.in: Regenerated.
	* merge.sh: Remove merge of deprecated lib/asan/dynamic.

From-SVN: r196211
2013-02-21 20:12:43 +01:00
Jakub Jelinek
4be7da26b5 asan_rtl.cc (__asan_preinit): Don't add if PIC macro is defined.
* asan/asan_rtl.cc (__asan_preinit): Don't add if PIC macro is
	defined.  Add used attribute.

From-SVN: r196205
2013-02-21 15:25:32 +01:00
Kostya Serebryany
7df59255e1 libsanitizer merge from upstream r175733
From-SVN: r196201
2013-02-21 10:57:10 +00:00
H.J. Lu
8afd2ed720 OFF_T: Merged from upstream r175140
PR bootstrap/56327
	* interception/interception.h (OFF_T): Merged from upstream
	r175140.

From-SVN: r196054
2013-02-14 08:54:01 -08:00
Jakub Jelinek
6422242b91 i386.c (ix86_asan_shadow_offset): Revert last change.
* config/i386/i386.c (ix86_asan_shadow_offset): Revert last change.

	* asan/asan_mapping.h (SHADOW_OFFSET): Set to (1ULL << 44) on x86-64.

From-SVN: r196017
2013-02-13 17:06:43 +01:00
Kostya Serebryany
b4ab7d34f5 libsanitizer merge from upstream r175049
From-SVN: r196009
2013-02-13 10:46:01 +00:00
Jack Howarth
34dc17ed31 configure.tgt: Disable build on darwin9 and earlier.
2013-02-11  Jack Howarth  <howarth@bromo.med.uc.edu>

	    * configure.tgt: Disable build on darwin9 and earlier.

From-SVN: r195958
2013-02-11 23:13:37 +00:00
Kostya Serebryany
2660d12d0a libsanitizer merge from upstream r173241
From-SVN: r195404
2013-01-23 11:41:33 +00:00
Jakub Jelinek
19006c45f5 Makefile.am (AM_CXXFLAGS): Remove -Wno-c99-extensions.
* sanitizer_common/Makefile.am (AM_CXXFLAGS): Remove
	-Wno-c99-extensions.
	* interception/Makefile.am (AM_CXXFLAGS): Likewise.
	* asan/Makefile.am (AM_CXXFLAGS): Likewise.
	* sanitizer_common/Makefile.in: Regenerated.
	* interception/Makefile.in: Regenerated.
	* asan/Makefile.in: Regenerated.

From-SVN: r195229
2013-01-16 08:34:49 +01:00
Wei Mi
edadb734f6 re PR sanitizer/55488 (Implement cold calls in tsan run-time)
2013-01-10  Wei Mi  <wmi@google.com>

libsanitizer/
        PR sanitizer/55488
        * tsan/Makefile.am: Add tsan_rtl_amd64.S.
        * tsan/Makefile.in: Regenerated.
        * tsan/tsan_rtl.h: Enable HACKY_CALL.

From-SVN: r195092
2013-01-10 17:57:34 +00:00
Kostya Serebryany
e9772e16b3 libsanitizer mege from upstream r171973
From-SVN: r195083
2013-01-10 12:44:08 +00:00
H.J. Lu
7f7162cf57 Remove "-I" from LIBSTDCXX_RAW_CXX_LDFLAGS
config/

	* libstdc++-raw-cxx.m4 (GCC_LIBSTDCXX_RAW_CXX_FLAGS): Remove
	"-I" from LIBSTDCXX_RAW_CXX_LDFLAGS.

libjava/

	* Makefile.am (lib_gnu_awt_xlib_la_LDFLAGS): Replace
	LIBSTDCXX_RAW_CXX_LDLAGS with LIBSTDCXX_RAW_CXX_LDFLAGS.
	* Makefile.in: Regenerated.

libsanitizer/

	* asan/Makefile.am (libasan_la_LIBADD): Replace
	LIBSTDCXX_RAW_CXX_LDLAGS with LIBSTDCXX_RAW_CXX_LDFLAGS.
	* tsan/Makefile.am (libtsan_la_LIBADD): Likewise.
	* Makefile.in: Regenerated.
	* configure: Likewise.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.

From-SVN: r194989
2013-01-07 10:23:42 -08:00
H.J. Lu
b488a2c757 Restore AM_MAKEFLAGS in libsanitizer
* Makefile.am (AM_MAKEFLAGS): Restored.
	* asan/Makefile.am: Likewise.
	* interception/Makefile.am: Likewise.
	* sanitizer_common/Makefile.am: Likewise.
	* tsan/Makefile.am: Likewise.
	* Makefile.in: Regenerated.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.

From-SVN: r194452
2012-12-12 07:41:36 -08:00
H.J. Lu
e8adb21b9a Restore MAKEOVERRIDES in libsanitizer
* Makefile.am (MAKEOVERRIDES): Restored.
	* asan/Makefile.am: Likewise.
	* interception/Makefile.am: Likewise.
	* sanitizer_common/Makefile.am: Likewise.
	* tsan/Makefile.am: Likewise.
	* Makefile.in: Regenerated.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.

From-SVN: r194450
2012-12-12 06:36:27 -08:00
H.J. Lu
e1e953d9d5 Use libstdc++-raw-cxx.m4 in libjava
config/

	* libstdc++-raw-cxx.m4 (GCC_LIBSTDCXX_RAW_CXX_FLAGS): Also
	AC_SUBST LIBSTDCXX_RAW_CXX_LDFLAGS.

libjava/

	* Makefile.am (lib_gnu_awt_xlib_la_CPPFLAGS): Use
	$(LIBSTDCXX_RAW_CXX_CXXLAGS).
	(lib_gnu_awt_xlib_la_LDFLAGS): Use $(LIBSTDCXX_RAW_CXX_LDLAGS).
	* configure.ac (GCC_LIBSTDCXX_RAW_CXX_FLAGS): New.
	* aclocal.m4: Regenerated.
	* Makefile.in:Likewise.
	* configure: Likewise.

libsanitizer/

	* asan/Makefile.am (libasan_la_LIBADD): Use $(LIBSTDCXX_RAW_CXX_LDLAGS).
	* tsan/Makefile.am (libtsan_la_LIBADD): Likewise.
	* Makefile.in: Regenerated.
	* configure: Likewise.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.

From-SVN: r194448
2012-12-12 05:40:15 -08:00
H.J. Lu
a62d3903d9 Remove AM_MAKEFLAGS/MAKEOVERRIDES from libsanitizer
* Makefile.am (AM_MAKEFLAGS): Removed.
	(MAKEOVERRIDES): Likewise.
	* asan/Makefile.am: Likewise.
	* interception/Makefile.am: Likewise.
	* sanitizer_common/Makefile.am: Likewise.
	* tsan/Makefile.am: Likewise.
	* Makefile.in: Regenerated.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.

From-SVN: r194447
2012-12-12 05:36:47 -08:00
H.J. Lu
d10a2df271 Add libstdc++-raw-cxx.m4 and use it in libsanitizer
config/

	PR sanitizer/55533
	* libstdc++-raw-cxx.m4: New file.

libsanitizer/

	PR sanitizer/55533
	* Makefile.am (AM_MAKEFLAGS): Remove CC and CXX.
	* configure.ac (GCC_LIBSTDCXX_RAW_CXX_FLAGS): New.
	* asan/Makefile.am (AM_CXXFLAGS): Add $(LIBSTDCXX_RAW_CXX_CXXFLAGS).
	(AM_MAKEFLAGS): Remove CC and CXX.
	* interception/Makefile.am: Likewise.
	* sanitizer_common/Makefile.am: Likewise.
	* tsan/Makefile.am: Likewise.
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.

From-SVN: r194424
2012-12-11 13:32:11 -08:00
Peter Bergner
957fee09af configure.tgt: Enable build on powerpc*-linux.
libsanitizer/
	* configure.tgt: Enable build on powerpc*-linux.

gcc/
	* config/rs6000/sysv4.h (TARGET_ASAN_SHADOW_OFFSET): Define.
	* config/rs6000/rs6000.c (rs6000_asan_shadow_offset): New function.
	* config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Disable if using ASAN.

From-SVN: r194273
2012-12-06 15:53:36 -06:00
Jack Howarth
3157880f53 Fix PR55599/sanitizer by disabling static libasan on darwin
From-SVN: r194257
2012-12-06 14:49:44 +00:00
Kostya Serebryany
695edbac5c [libsanitizer] merge from upstream r169392
From-SVN: r194255
2012-12-06 14:43:11 +00:00
Kostya Serebryany
a040845458 [libsanitizer] merge from upstream r169371
From-SVN: r194221
2012-12-05 13:19:55 +00:00
Jakub Jelinek
41d37c5656 Fix up two ChangeLog entries.
From-SVN: r194132
2012-12-04 14:18:54 +01:00
Kostya Serebryany
8c4d267c6e [libsanitizer] Fix PR55521 by switching libsanitizer from mach_override to mac interpose functions on darwin
From-SVN: r194120
2012-12-04 07:00:35 +00:00
H.J. Lu
a23ed040bb Don't use -I for libstdc++-v3 header files
* Makefile.am (AM_MAKEFLAGS): Restore CC and CXX.
	* configure.ac (ACX_NONCANONICAL_TARGET): Removed.
	* asan/Makefile.am (AM_CXXFLAGS): Remove -I for libstdc++-v3 header
	files.
	(AM_MAKEFLAGS): Restore CC and CXX.
	* interception/Makefile.am: Likewise.
	* sanitizer_common/Makefile.am: Likewise.
	* tsan/Makefile.am: Likewise.
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.

From-SVN: r193951
2012-11-29 11:15:43 -08:00
H.J. Lu
2ed685b8fb Use explicit -I for libstdc++-v3 header files
* Makefile.am (AM_MAKEFLAGS): Remove CC and CXX.
	* configure.ac (ACX_NONCANONICAL_TARGET): New.
	* asan/Makefile.am (AM_CXXFLAGS): Add -I for libstdc++-v3 header
	files.
	(AM_MAKEFLAGS): Remove CC and CXX.
	* interception/Makefile.am: Likewise.
	* sanitizer_common/Makefile.am: Likewise.
	* tsan/Makefile.am: Likewise.
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.

From-SVN: r193949
2012-11-29 11:01:17 -08:00
Kostya Serebryany
4ba5ca4650 [libsanitizer] merge from upstream r168699
From-SVN: r193849
2012-11-27 14:01:46 +00:00
Jack Howarth
f246eadc0a [libsanitizer] add mach_override and enable libsanitizer on darwin
From-SVN: r193781
2012-11-24 18:24:13 +00:00
H.J. Lu
9cb5411c17 Set gcc_version in tsan/Makefile.am
PR sanitizer/55450
	* tsan/Makefile.am (gcc_version): New.
	* tsan/Makefile.in: Regenerated.

From-SVN: r193767
2012-11-23 13:14:05 -08:00
Kostya Serebryany
e297eb600d [libsanitizer] merge from upstream r168514
From-SVN: r193756
2012-11-23 14:46:25 +00:00
Kostya Serebryany
3409d40e47 [libsanitizer] a script to help merging asan/tsan from upstream
From-SVN: r193743
2012-11-23 04:09:17 +00:00
Jakub Jelinek
64548f3b79 Makefile.am (AM_CXXFLAGS): Remove -Wno-variadic-macros.
* tsan/Makefile.am (AM_CXXFLAGS): Remove -Wno-variadic-macros.
	* Makefile.am (SUBDIRS): Guard tsan addition with TSAN_SUPPORTED
	automake conditional instead of !MULTISUBDIR32.
	* configure.tgt: Set TSAN_SUPPORTED=yes for x86_64/i686-linux
	for 64-bit multilib.
	* configure.ac: Check for void * size, source in configure.tgt,
	define TSAN_SUPPORTED conditional instead of MULTILIBDIR32.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* tsan/Makefile.in: Regenerated.

From-SVN: r193741
2012-11-23 01:31:54 +01:00
Wei Mi
cd0be65c26 tsan: New directory.
libsanitizer/
	* tsan: New directory. Import tsan runtime from llvm.
	* configure.ac: Add 64 bits tsan build.
	* Makefile.am: Likewise.
	* configure: Regenerated.
	* Makefile.in: Likewise.

From-SVN: r193737
2012-11-22 22:03:11 +00:00
Kostya Serebryany
5cba83a8a7 extend libsanitizer/README.gcc
From-SVN: r193698
2012-11-21 15:07:31 +00:00
Konstantin Serebryany
b014e124e4 Fix sanitizer build on sparc64.
* sanitizer_common/sanitizer_linux.cc
	(SANITIZER_LINUX_USES_64BIT_SYSCALLS): Define.
	(internal_mmap): Use it.
	(internal_filesize): Likewise.

From-SVN: r193676
2012-11-20 12:54:49 -08:00
Tom Tromey
2b723e217a configure.ac: Invoke AM_MAINTAINER_MODE.
* configure.ac: Invoke AM_MAINTAINER_MODE.
	* aclocal.m4, configure, Makefile.in, asan/Makefile.in,
	interception/Makefile.in, sanitizer_common/Makefile.in: Rebuild.

From-SVN: r193561
2012-11-16 15:19:15 +00:00