Commit Graph

102 Commits

Author SHA1 Message Date
H.J. Lu
a699d67255 Always use PIC option with -shared in libtool
Libtool needs to pass PIC option -shared when creating shared object to
link regular object files with slim-lto archive.

	PR bootstrap/63784
	* libtool.m4: Add $pic_flag with -shared.

boehm-gc/

	PR bootstrap/63784
	* configure: Regenerated.

gcc/

	PR bootstrap/63784
	* configure: Regenerated.

libatomic/

	PR bootstrap/63784
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/63784
	* configure: Regenerated.

libcc1/

	PR bootstrap/63784
	* configure: Regenerated.

libcilkrts/

	PR bootstrap/63784
	* configure: Regenerated.

libffi/

	PR bootstrap/63784
	* configure: Regenerated.

libgfortran/

	PR bootstrap/63784
	* configure: Regenerated.

libgomp/

	PR bootstrap/63784
	* configure: Regenerated.

libitm/

	PR bootstrap/63784
	* configure: Regenerated.

libjava/

	PR bootstrap/63784
	* configure: Regenerated.

libjava/classpath/

	PR bootstrap/63784
	* configure: Regenerated.

libobjc/

	PR bootstrap/63784
	* configure: Regenerated.

libquadmath/

	PR bootstrap/63784
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/63784
	* configure: Regenerated.

libssp/

	PR bootstrap/63784
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/63784
	* configure: Regenerated.

libvtv/

	PR bootstrap/63784
	* configure: Regenerated.

lto-plugin/

	PR bootstrap/63784
	* configure: Regenerated.

From-SVN: r217937
2014-11-21 08:49:17 -08:00
Jakub Jelinek
7697b16f45 re PR sanitizer/64013 (libsanitizer fails to build)
PR sanitizer/64013
	* sanitizer_common/sanitizer_linux.cc (FileExists): Cherry pick
	upstream r222532.

From-SVN: r217921
2014-11-21 15:03:37 +01:00
Uros Bizjak
7f201a67fb Makefile.am (AM_CXXFLAGS): Use -std=gnu++11.
* sanitizer_common/Makefile.am (AM_CXXFLAGS): Use -std=gnu++11.
	* asan/Makefile.am (AM_CXXFLAGS): Ditto.
	* lsan/Makefile.am (AM_CXXFLAGS): Ditto.
	* interception/Makefile.am (AM_CXXFLAGS): Ditto.
	* tsan/Makefile.am (AM_CXXFLAGS): Ditto.
	* libbacktrace/Makefile.am (AM_CXXFLAGS): Ditto.
	* ubsan/Makefile.am (AM_CXXFLAGS): Ditto.
	* sanitizer_common/Makefile.in: Regenerate.
	* asan/Makefile.in: Ditto.
	* lsan/Makefile.in: Ditto.
	* interception/Makefile.in: Ditto.
	* tsan/Makefile.in: Ditto.
	* libbacktrace/Makefile.in: Ditto.
	* ubsan/Makefile.in: Ditto.

From-SVN: r217562
2014-11-14 15:23:51 +01:00
Kostya Serebryany
c5be964a42 libsanitizer merge from upstream r221802
From-SVN: r217518
2014-11-13 20:41:38 +00:00
Francois-Xavier Coudert
ebf6d33b73 re PR target/63610 (Fixing the libtool bug for Yosemite (darwin14))
toplevel:
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* libtool.m4: Fix globbing of darwin versions.

boehm-gc/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

gcc/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libatomic/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libbacktrace/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libcc1/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libcilkrts/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libffi/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libgfortran/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libgomp/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libitm/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libobjc/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libquadmath/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libsanitizer/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libssp/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libstdc++-v3/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libvtv/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

lto-plugin/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libjava/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libjava/classpath/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

zlib/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

From-SVN: r217366
2014-11-11 20:25:18 +00:00
Martin Liska
d13fc1ed98 IPA ICF fallout: fox for libasan and pr43077-1.c
* gcc.dg/guality/pr43077-1.c: IPA ICF disabled
	to match defined expectations.

	* asan/Makefile.am: IPA ICF pass is disabled.
	* asan/Makefile.in: Likewise.

From-SVN: r216339
2014-10-16 16:56:21 +00:00
David S. Miller
c84733360b Fix sanitizer build on sparc.
* sanitizer_common/sanitizer_platform_limits_linux.cc (time_t):
	Define at __kernel_time_t, as needed for sparc.
	(struct __old_kernel_stat): Don't check if __sparc__ is defined.
	* libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
	(__sanitizer): Define struct___old_kernel_stat_sz,
	struct_kernel_stat_sz, and struct_kernel_stat64_sz for sparc.
	(__sanitizer_ipc_perm): Adjust for sparc targets.
	(__sanitizer_shmid_ds): Likewsie.
	(__sanitizer_sigaction): Likewsie.
	(IOC_SIZE): Likewsie.

From-SVN: r216224
2014-10-14 14:20:46 -07:00
Jakub Jelinek
694b4cfa08 Makefile.am (DEFS): Add -DPIC.
* ubsan/Makefile.am (DEFS): Add -DPIC.
	* ubsan/Makefile.in: Regenerated.

From-SVN: r216206
2014-10-14 17:56:52 +02:00
Christophe Lyon
a3125fc233 [AArch64] Enable Address Sanitizer.
2014-09-26  Christophe Lyon  <christophe.lyon@linaro.org>

	[AArch64] Enable Address Sanitizer.

	gcc/
	* config/aarch64/aarch64-linux.h (ASAN_CC1_SPEC): Define.
        (CC1_SPEC): Define.
        * config/aarch64/aarch64.c (aarch64_asan_shadow_offset): New function.
        (TARGET_ASAN_SHADOW_OFFSET): Define.

	libsanitzer/
	* configure.tgt: Enable build on aarch64*-linux.

From-SVN: r215642
2014-09-26 15:07:42 +02:00
Kostya Serebryany
866e32ad33 [libsanitizer merge from upstream r218156]
From-SVN: r215527
2014-09-23 17:59:53 +00:00
Jakub Jelinek
126edc3fe2 flag-types.h (enum sanitize_code): Add SANITIZE_NONNULL_ATTRIBUTE and SANITIZE_RETURNS_NONNULL_ATTRIBUTE...
gcc/
	* flag-types.h (enum sanitize_code): Add SANITIZE_NONNULL_ATTRIBUTE
	and SANITIZE_RETURNS_NONNULL_ATTRIBUTE, or them into SANITIZE_UNDEFINED.
	* opts.c (common_handle_option): Handle SANITIZE_NONNULL_ATTRIBUTE and
	SANITIZE_RETURNS_NONNULL_ATTRIBUTE and disable
	flag_delete_null_pointer_checks for them.
	* sanitizer.def (BUILT_IN_UBSAN_HANDLE_NONNULL_ARG,
	BUILT_IN_UBSAN_HANDLE_NONNULL_ARG_ABORT,
	BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
	BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): New.
	* ubsan.c (instrument_bool_enum_load): Set *gsi back to
	stmt's iterator.
	(instrument_nonnull_arg, instrument_nonnull_return): New functions.
	(pass_ubsan::gate): Return true even for SANITIZE_NONNULL_ATTRIBUTE
	or SANITIZE_RETURNS_NONNULL_ATTRIBUTE.
	(pass_ubsan::execute): Call instrument_nonnull_{arg,return}.
	* doc/invoke.texi (-fsanitize=nonnull-attribute,
	-fsanitize=returns-nonnull-attribute): Document.
gcc/testsuite/
	* c-c++-common/ubsan/attrib-3.c: New test.
	* c-c++-common/ubsan/nonnull-1.c: New test.
	* c-c++-common/ubsan/nonnull-2.c: New test.
	* c-c++-common/ubsan/nonnull-3.c: New test.
	* c-c++-common/ubsan/nonnull-4.c: New test.
	* c-c++-common/ubsan/nonnull-5.c: New test.
libsanitizer/
	* ubsan/ubsan_handlers.cc, ubsan/ubsan_handlers.h: Cherry pick
	upstream r215485, r217389, r217391 and r217400.

From-SVN: r215118
2014-09-10 11:23:16 +02:00
Paolo Carlini
0d807c8050 sanitizer_common_interceptors.inc: Cherry pick upstream r211008.
2014-06-23  Paolo Carlini  <paolo.carlini@oracle.com>

	* sanitizer_common/sanitizer_common_interceptors.inc:
	Cherry pick upstream r211008.

From-SVN: r211912
2014-06-23 19:03:07 +00:00
Richard Biener
4622301b0d asan_linux.cc: Cherry pick upstream r210012.
2014-06-11  Richard Biener  <rguenther@suse.de>

	* asan/asan_linux.cc: Cherry pick upstream r210012.

From-SVN: r211453
2014-06-11 11:35:48 +00:00
Jakub Jelinek
ecd5543ffa sanitizer_stacktrace.cc: Cherry pick upstream r209879.
* sanitizer_common/sanitizer_stacktrace.cc: Cherry pick upstream
	r209879.
	* sanitizer_common/sanitizer_common.h: Likewise.
	* asan/asan_mapping.h: Likewise.
	* asan/asan_linux.cc: Likewise.
	* tsan/tsan_mman.cc: Cherry pick upstream r209744.
	* sanitizer_common/sanitizer_allocator.h: Likewise.

From-SVN: r211080
2014-05-30 15:48:22 +02:00
Marek Polacek
85a16bf8b5 builtins.def: Change SANITIZE_FLOAT_DIVIDE to SANITIZE_NONDEFAULT.
* builtins.def: Change SANITIZE_FLOAT_DIVIDE to SANITIZE_NONDEFAULT.
	* gcc.c (sanitize_spec_function): Likewise.
	* convert.c (convert_to_integer): Include "ubsan.h".  Add
	floating-point to integer instrumentation.
	* doc/invoke.texi: Document -fsanitize=float-cast-overflow.
	* flag-types.h (enum sanitize_code): Add SANITIZE_FLOAT_CAST and
	SANITIZE_NONDEFAULT.
	* opts.c (common_handle_option): Handle -fsanitize=float-cast-overflow.
	* sanitizer.def (BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW,
	BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW_ABORT): Add.
	* ubsan.c: Include "realmpfr.h" and "dfp.h".
	(get_ubsan_type_info_for_type): Handle REAL_TYPEs.
	(ubsan_type_descriptor): Set tkind to 0xffff for types other than
	float/double/long double.
	(ubsan_instrument_float_cast): New function.
	* ubsan.h (ubsan_instrument_float_cast): Declare.
testsuite/
	* c-c++-common/ubsan/float-cast-overflow-1.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-10.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-2.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-3.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-4.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-5.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-6.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-7.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-7.h: New file.
	* c-c++-common/ubsan/float-cast-overflow-8.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-9.c: New test.
	* c-c++-common/ubsan/float-cast.h: New file.
	* g++.dg/ubsan/float-cast-overflow-bf.C: New test.
	* gcc.dg/ubsan/float-cast-overflow-bf.c: New test.
libsanitizer/
	* ubsan/ubsan_value.cc (getFloatValue): Handle 96-bit
	floating-point types.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r210862
2014-05-23 14:44:42 +00:00
Kostya Serebryany
dee5ea7a0b libsanitizer merge from upstream r209283
From-SVN: r210743
2014-05-22 07:09:21 +00:00
Yury Gribov
2675305b4f re PR sanitizer/61100 (asan/tsan should have the sanitizer includes)
2014-05-14  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/61100
	* Makefile.am (nodist_saninclude_HEADERS): Install
	public headers.
	* Makefile.in: Regenerate.

	* c-c++-common/asan/asan-interface-1.c: New test.
	* lib/asan-dg.exp (asan_include_flags): New function.
	(asan_init): Call asan_include_flags to obtain path
	to sanitizer headers.

From-SVN: r210413
2014-05-14 08:33:45 +00:00
Rainer Orth
a6c9ab4e19 Handle backtrace_qsort
* libbacktrace/Makefile.am (libsanitizer_libbacktrace_la_SOURCES):
	Add ../../libbacktrace/sort.c.
	* libbacktrace/Makefile.in: Regenerate.
	* libbacktrace/backtrace-rename.h (backtrace_qsort): Define.

From-SVN: r208401
2014-03-07 13:55:54 +00:00
Bill Schmidt
a42a7046eb configure.tgt: Unsupported for little endian PowerPC for now.
2014-03-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* configure.tgt: Unsupported for little endian PowerPC for now.

From-SVN: r208290
2014-03-03 20:36:56 +00:00
Jakub Jelinek
81c87471e9 re PR sanitizer/60055 (Invalid binding of __tsan_default_options)
PR sanitizer/60055
	* tsan/tsan_flags.cc (__tsan_default_options): Add
	SANITIZER_INTERFACE_ATTRIBUTE.  Backport from upstream r200747.
	* tsan/tsan_rtl.cc (__tsan::OnFinalize): Likewise.

From-SVN: r207459
2014-02-04 11:46:22 +01:00
Jakub Jelinek
5ab39ec3b0 re PR sanitizer/60038 (AddressSanitizer CHECK failed ... "((*tls_addr + *tls_size)) <= ((*stk_addr + *stk_size))" on CentOS 5.10)
PR sanitizer/60038
	* sanitizer_common/sanitizer_linux_libcdep.cc: Include
	sanitizer_atomic.h and unistd.h.
	(kThreadDescriptorSize): Made static, remove initializer and const,
	change type to atomic_uintptr_t.
	(ThreadDescriptorSize): Use confstr(_CS_GNU_LIBC_VERSION, ...) to
	query glibc version, compute kThreadDescriptorSize depending on
	glibc version minor number.
	(GetThreadStackAndTls): Use ThreadDescriptorSize() instead of
	kThreadDescriptorSize directly.

From-SVN: r207452
2014-02-04 08:37:44 +01:00
Yury Gribov
4a7eaf5f94 re PR sanitizer/57316 (build failure in libsanitizer)
2014-01-23  Yury Gribov  <y.gribov@samsung.com>
	    Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/57316
	* configure.ac: Check for missing syscalls.
	* Makefile.am: Likewise.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r206966
2014-01-23 14:32:05 +00:00
Jakub Jelinek
b5f58ba331 * sanitizer_common/sanitizer_symbolizer_libbacktrace.h
(LibbacktraceSymbolizer::Demangle): New declaration.
	* sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
	(POSIXSymbolizer::Demangle): Use libbacktrace_symbolizer_'s Demangle
	method if possible.
	* sanitizer_common/sanitizer_symbolizer_libbacktrace.cc: Include
	"demangle.h" if SANITIZE_CP_DEMANGLE is defined.
	(struct CplusV3DemangleData): New type.
	(CplusV3DemangleCallback, CplusV3Demangle): New functions.
	(SymbolizeCodePCInfoCallback, SymbolizeCodeCallback,
	SymbolizeDataCallback): Use CplusV3Demangle.
	* sanitizer_common/Makefile.am (AM_CXXFLAGS): Add
	-DSANITIZE_CP_DEMANGLE and -I $(top_srcdir)/../include.
	* libbacktrace/backtrace-rename.h (cplus_demangle_builtin_types,
	cplus_demangle_fill_ctor, cplus_demangle_fill_dtor,
	cplus_demangle_fill_extended_operator, cplus_demangle_fill_name,
	cplus_demangle_init_info, cplus_demangle_mangled_name,
	cplus_demangle_operators, cplus_demangle_print,
	cplus_demangle_print_callback, cplus_demangle_type, cplus_demangle_v3,
	cplus_demangle_v3_callback, is_gnu_v3_mangled_ctor,
	is_gnu_v3_mangled_dtor, java_demangle_v3, java_demangle_v3_callback):
	Define.
	(__asan_internal_memcmp, __asan_internal_strncmp): New prototypes.
	(memcmp, strncmp): Redefine.
	* libbacktrace/Makefile.am (libsanitizer_libbacktrace_la_SOURCES): Add
	../../libiberty/cp-demangle.c.
	* libbacktrace/bridge.cc (__asan_internal_memcmp,
	__asan_internal_strncmp): New functions.
	* sanitizer_common/Makefile.in: Regenerated.
	* libbacktrace/Makefile.in: Regenerated.
	* configure: Regenerated.
	* configure.ac: Regenerated.
	* config.h.in: Regenerated.

From-SVN: r206477
2014-01-09 19:16:40 +01:00
Jakub Jelinek
2613419a70 Makefile.am (AM_CPPFLAGS): Add -isystem $(top_srcdir)/include/system.
* sanitizer_common/Makefile.am (AM_CPPFLAGS): Add
	-isystem $(top_srcdir)/include/system.
	* sanitizer_common/Makefile.in: Regenerated.
	* include/system/linux/aio_abi.h: New header.
	* include/system/linux/mroute.h: New header.
	* include/system/linux/mroute6.h: New header.
	* include/system/linux/perf_event.h: New header.
	* include/system/linux/types.h: New header.

From-SVN: r206476
2014-01-09 19:15:41 +01:00
Jakub Jelinek
c915a58145 re PR sanitizer/59136 (llvm-symbolizer shouldn't be started always)
PR sanitizer/59136
libsanitizer/
	* sanitizer_common/Makefile.am (AM_CXXFLAGS): If
	LIBBACKTRACE_SUPPORTED add -DSANITIZER_LIBBACKTRACE
	and -I/-include flags.
	* lsan/Makefile.am (liblsan_la_LIBADD): Add
	libsanitizer_libbacktrace.la if LIBBACKTRACE_SUPPORTED.
	* tsan/Makefile.am (libtsan_la_LIBADD): Likewise.
	* ubsan/Makefile.am (libubsan_la_LIBADD): Likewise.
	* asan/Makefile.am (libasan_la_LIBADD): Likewise.
	* Makefile.am (SUBDIRS): If LIBBACKTRACE_SUPPORTED add
	libbacktrace.
	* README.gcc: Document that also lsan and ubsan are
	maintained in compiler-rt upstream.
	* libbacktrace/Makefile.am: New file.
	* libbacktrace/backtrace-rename.h: New file.
	* libbacktrace/backtrace-supported.h.in: New file.
	* libbacktrace/bridge.cc: New file.
	* configure.ac: Add tests needed for libbacktrace build
	within libsanitizer.
	* sanitizer_common/Makefile.in: Regenerated.
	* lsan/Makefile.in: Regenerated.
	* tsan/Makefile.in: Regenerated.
	* ubsan/Makefile.in: Regenerated.
	* libbacktrace/Makefile.in: Generated.
	* config.h.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* interception/Makefile.in: Regenerated.
	* asan/Makefile.in: Regenerated.
	* aclocal.m4: Regenerated.
testsuite/
	* c-c++-common/asan/strip-path-prefix-1.c: Allow also the
	filename:line instead of (modulename+offset) form with stripped
	initial / from the filename.

From-SVN: r206475
2014-01-09 19:13:39 +01:00
Kostya Serebryany
409f3b4663 libsanitizer: fix build on Mac 10.6
From-SVN: r206113
2013-12-19 12:54:11 +00:00
H.J. Lu
079db27b09 Use int64 on time and clock for x32
* sanitizer_common/sanitizer_platform_limits_posix.h
	(__sanitizer_shmid_ds): Use u64 on time fields for x32.
	(__sanitizer_clock_t): Use long long for x32.

From-SVN: r205737
2013-12-06 03:48:24 -08:00
H.J. Lu
7efb96c077 Include <sys/stat.h> if __x86_64__ is defined
* sanitizer_common/sanitizer_platform_limits_linux.cc: Include
	<sys/stat.h>, instead of <asm/stat.h>, if __x86_64__ is defined.
	(struct___old_kernel_stat_sz): Don't check if __x86_64__ is defined.

From-SVN: r205736
2013-12-06 03:44:55 -08:00
H.J. Lu
df9d1700f1 Add -lm to link_sanitizer_common
* configure.ac (link_sanitizer_common): Add -lm.
	* configure: Regenerated.

From-SVN: r205710
2013-12-05 06:41:38 -08:00
Jakub Jelinek
46db94aa6a Add forgotten file.
From-SVN: r205701
2013-12-05 12:06:10 +01:00
Kostya Serebryany
c4c16f7456 libsanitizer merge from upstream r196489
From-SVN: r205700
2013-12-05 10:28:59 +00:00
Yury Gribov
666ee4d682 re PR sanitizer/59368 (libsanitizer spec file installed in the wrong place)
2013-12-05  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/59368
	* Makefile.am (gcc_version): Added gcc_version.
	* Makefile.in: Regenerate.

From-SVN: r205698
2013-12-05 09:56:03 +00:00
Kostya Serebryany
df77f0e4ec libsanitizer merge from upstream r196090
From-SVN: r205695
2013-12-05 09:18:38 +00:00
Jakub Jelinek
35814b0346 re PR sanitizer/59063 (ASAN: segfault in __interceptor_clock_gettime)
gcc/
2013-11-29  Jakub Jelinek  <jakub@redhat.com>
            Yury Gribov  <y.gribov@samsung.com>

        PR sanitizer/59063
        * config/gnu-user.h: Removed old code for setting up sanitizer
        libs.
        * gcc.c: Using libsanitizer spec instead of explicit libs.

gcc/testsuite/
2013-11-29  Jakub Jelinek  <jakub@redhat.com>
            Yury Gribov  <y.gribov@samsung.com>

        PR sanitizer/59063
        * c-c++-common/asan/pr59063-1.c: New test.
        * c-c++-common/asan/pr59063-2.c: Likewise.
        * lib/asan-dg.exp: Add path to libsanitizer.spec to cflags.
        * lib/ubsan-dg.exp: Likewise.

libsanitizer/
2013-11-29  Jakub Jelinek  <jakub@redhat.com>
            Yury Gribov  <y.gribov@samsung.com>

        PR sanitizer/59063
        * libsanitizer.spec.in: Add spec file to hold link flags for
        various sanitizer libs.
        * configure.ac: Check whether clock_* routines come from librt.
        * asan/Makefile.am (libasan_la_LDFLAGS): Libs now come from
        configure.ac.
        * tsan/Makefile.am (libtsan_la_LDFLAGS): Likewise.
        * ubsan/Makefile.am (libubsan_la_LDFLAGS): Likewise.
        * lsan/Makefile.am (liblsan_la_LDFLAGS): Likewise.
        * asan/Makefile.in: Regenerate.
        * interception/Makefile.in: Regenerate.
        * lsan/Makefile.in: Regenerate.
        * sanitizer_common/Makefile.in: Regenerate.
        * tsan/Makefile.in: Regenerate.
        * ubsan/Makefile.in: Regenerate.
        * Makefile.in: Regenerate.
        * configure: Regenerate.


Co-Authored-By: Yury Gribov <y.gribov@samsung.com>

From-SVN: r205524
2013-11-29 12:30:36 +00:00
Jakub Jelinek
049558ed48 re PR sanitizer/59106 (Failure to link against static libasan)
2013-11-28  Jakub Jelinek  <jakub@redhat.com>
	    Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/59106
	* ubsan/Makefile.am (AM_CXXFLAGS): Disable -frtti for files that
	don't need it.
	* ubsan/Makefile.in: Regenerated.

Co-Authored-By: Yury Gribov <y.gribov@samsung.com>

From-SVN: r205482
2013-11-28 12:20:23 +00:00
Jakub Jelinek
9065ada9b5 re PR sanitizer/59061 (Port leaksanitizer)
PR sanitizer/59061
	* common.opt (static-liblsan): Add.
	* config/gnu-user.h (STATIC_LIBLSAN_LIBS, STATIC_LIBUBSAN_LIBS):
	Define.
	* flag-types.h (enum sanitize_code): Add SANITIZE_LEAK.  Renumber
	SANITIZE_SHIFT, SANITIZE_DIVIDE, SANITIZE_UNREACHABLE, SANITIZE_VLA,
	SANITIZE_RETURN.
	* opts.c (common_handle_option): Handle -fsanitize=leak.
	* gcc.c (ADD_STATIC_LIBLSAN_LIBS, LIBLSAN_SPEC): Define.
	(LIBUBSAN_SPEC): Don't test LIBUBSAN_EARLY_SPEC.
	(LIBUBSAN_EARLY_SPEC): Remove.
	(SANITIZER_EARLY_SPEC): Don't do anything for libubsan.
	(SANITIZER_SPEC): Add -fsanitize=leak handling.
	(sanitize_spec_function): Handle %sanitize(leak).
	* doc/invoke.texi (-static-liblsan, -fsanitize=leak): Document.

	* c-c++-common/asan/no-redundant-instrumentation-7.c: Fix
	cleanup-tree-dump directive.

	* configure.tgt: Set LSAN_SUPPORTED=yes for x86_64-linux.
	* configure.ac (LSAN_SUPPORTED): New AM_CONDITIONAL.
	* configure: Regenerated.
	* lsan/Makefile.am (toolexeclib_LTLIBRARIES, lsan_files,
	liblsan_la_SOURCES, liblsan_la_LIBADD, liblsan_la_LDFLAGS): Add.
	* lsan/Makefile.in: Regenerated.

From-SVN: r205290
2013-11-22 22:13:08 +01:00
Mike Stump
486294d4ed sanitizer_linux.cc (__sanitizer): Grab one change from upstream to fix build.
* sanitizer_common/sanitizer_linux.cc (__sanitizer): Grab one
        change from upstream to fix build.

From-SVN: r205285
2013-11-22 20:33:06 +00:00
Yury Gribov
2621c86043 re PR sanitizer/59106 (Failure to link against static libasan)
libsanitizer:
2013-11-18  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/59106
	* asan/Makefile.am (AM_CXXFLAGS): Add -fno-rtti.
	* interception/Makefile.am (AM_CXXFLAGS): Likewise.
	* lsan/Makefile.am (AM_CXXFLAGS): Likewise.
	* sanitizer_common/Makefile.am (AM_CXXFLAGS): Likewise.
	* tsan/Makefile.am (AM_CXXFLAGS): Likewise.
	* asan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.

gcc/testsuite:
2013-11-18  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/59106
	* c-c++-common/asan/pr59106.c: New test.

From-SVN: r204934
2013-11-18 08:03:16 +00:00
Kostya Serebryany
c8e1377bf9 fix PR sanitizer/58994
From-SVN: r204838
2013-11-15 10:31:14 +00:00
Peter Bergner
c3d77f3add re PR sanitizer/59009 (libsanitizer merge from upstream r191666 breaks bootstrap on powerpc64-linux and aarch64-linux)
PR sanitizer/59009
	* sanitizer_common/sanitizer_platform_limits_posix.cc: Temporarily
	ifdef out more source.

From-SVN: r204757
2013-11-13 16:34:33 -06:00
Jakub Jelinek
d00106f4f0 sanitizer_platform_limits_linux.cc: Temporarily ifdef out almost the whole source.
* sanitizer_common/sanitizer_platform_limits_linux.cc: Temporarily
	ifdef out almost the whole source.
	* sanitizer_common/sanitizer_common_syscalls.inc: Likewise.

From-SVN: r204726
2013-11-13 00:42:55 +01:00
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