Commit Graph

318 Commits

Author SHA1 Message Date
GCC Administrator 2832d51b38 Daily bump. 2021-05-22 00:16:29 +00:00
Tamar Christina 745dae5923 libsanitizer: Remove cyclades from libsanitizer
The Linux kernel has removed the interface to cyclades from
the latest kernel headers[1] due to them being orphaned for the
past 13 years.

libsanitizer uses this header when compiling against glibc, but
glibcs itself doesn't seem to have any references to cyclades.

Further more it seems that the driver is broken in the kernel and
the firmware doesn't seem to be available anymore.

As such since this is breaking the build of libsanitizer (and so the
GCC bootstrap[2]) I propose to remove this.

[1] https://lkml.org/lkml/2021/3/2/153
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379

(cherry picked from commit f7c5351552387bd43f6ca3631016d7f0dfe0f135)

libsanitizer/ChangeLog:

	PR sanitizer/100379
	* sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Cherry-pick
	llvm-project revision f7c5351552387bd43f6ca3631016d7f0dfe0f135.
	* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.
	* sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.
2021-05-21 10:30:59 +01:00
H.J. Lu f3b1516d9d libsanitizer: cherry-pick from upstream
cherry-pick:

72797dedb720 [sanitizer] Use size_t on g_tls_size to fix build on x32
2021-05-13 18:23:55 -07:00
GCC Administrator f9af11c7f1 Daily bump. 2021-05-14 00:16:30 +00:00
Iain Sandoe 1f6fc2826d libsanitizer : Update LOCAL_PATCHES.
This adds the local patch to handle missing __builtin_os_log_format
on Darwin.

libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Add Darwin patch for __builtin_os_log_format.
2021-05-13 21:19:19 +01:00
Iain Sandoe adab7b2bf4 libsanitizer, Darwin : Handle missing __builtin_os_log_format.
GCC does not, currently, define __builtin_os_log_format, which
is needed by os/log.h.  Do not include that header unless the
builtin is defined (since the header errors out on the same
condition).  Provide a work-around solution to the missing API
provided via the header.

libsanitizer/ChangeLog:

	* sanitizer_common/sanitizer_mac.cpp : Check for the
	availability of __builtin_os_log_format before trying to
	include a header depending on it.
	(OS_LOG_DEFAULT): New.
	(os_log_error): Define to a fall-back using an older API.
2021-05-13 21:18:18 +01:00
Martin Liska 269338fe9d libsanitizer: update LOCAL_PATCHES.
libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Update to the corresponding revision.
2021-05-13 09:30:05 +02:00
Martin Liska fb73b1ce36 libsanitizer: Apply local patches. 2021-05-13 09:29:50 +02:00
Martin Liska d0fee87e0c libsanitizer: merge from master
Merged revision: f58e0513dd95944b81ce7a6e7b49ba656de7d75f
2021-05-13 09:29:17 +02:00
GCC Administrator da946b41be Daily bump. 2021-04-18 00:16:21 +00:00
Jakub Jelinek d9f462fb37 sanitizer: Fix asan against glibc 2.34 [PR100114]
As mentioned in the PR, SIGSTKSZ is no longer a compile time constant in
glibc 2.34 and later, so
static const uptr kAltStackSize = SIGSTKSZ * 4;
needs dynamic initialization, but is used by a function called indirectly
from .preinit_array and therefore before the variable is constructed.
This results in using 0 size instead and all asan instrumented programs
die with:
==91==ERROR: AddressSanitizer failed to allocate 0x0 (0) bytes of SetAlternateSignalStack (error code: 22)

Here is a cherry-pick from upstream to fix this.

2021-04-17  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/100114
	* sanitizer_common/sanitizer_posix_libcdep.cpp: Cherry-pick
	llvm-project revisions 82150606fb11d28813ae6da1101f5bda638165fe
	and b93629dd335ffee2fc4b9b619bf86c3f9e6b0023.
2021-04-17 11:27:14 +02:00
GCC Administrator 6405b40f4a Daily bump. 2021-03-09 00:16:57 +00:00
Martin Liska 81fee43851 libsanitizer: cherry-pick ad294e572bc5c16f9dc420cc994322de6ca3fbfb
libsanitizer/ChangeLog:

	PR sanitizer/98920
	* asan/asan_interceptors.cpp (COMMON_INTERCEPT_FUNCTION_VER):
	Cherry pick.
	(COMMON_INTERCEPT_FUNCTION_VER_UNVERSIONED_FALLBACK): Likewise.
	* asan/asan_interceptors.h (ASAN_INTERCEPT_FUNC_VER_UNVERSIONED_FALLBACK): Likewise.
	* sanitizer_common/sanitizer_common_interceptors.inc
	(COMMON_INTERCEPT_FUNCTION_GLIBC_VER_MIN): Likewise.
	(INIT_REGEX): Likewise.
	* tsan/tsan_interceptors_posix.cpp (COMMON_INTERCEPT_FUNCTION_VER_UNVERSIONED_FALLBACK):
	Likewise.

gcc/testsuite/ChangeLog:

	PR sanitizer/98920
	* c-c++-common/asan/pr98920.c: New test.
2021-03-08 15:55:27 +01:00
Martin Liska e03e58c184 Fix UBSAN in __ubsan::Value::getSIntValue
/home/marxin/Programming/gcc2/libsanitizer/ubsan/ubsan_value.cpp:77:25: runtime error: left shift of 0x0000000000000000fffffffffffffffb by 96 places cannot be represented in type '__int128'
    #0 0x7ffff754edfe in __ubsan::Value::getSIntValue() const /home/marxin/Programming/gcc2/libsanitizer/ubsan/ubsan_value.cpp:77
    #1 0x7ffff7548719 in __ubsan::Value::isNegative() const /home/marxin/Programming/gcc2/libsanitizer/ubsan/ubsan_value.h:190
    #2 0x7ffff7542a34 in handleShiftOutOfBoundsImpl /home/marxin/Programming/gcc2/libsanitizer/ubsan/ubsan_handlers.cpp:338
    #3 0x7ffff75431b7 in __ubsan_handle_shift_out_of_bounds /home/marxin/Programming/gcc2/libsanitizer/ubsan/ubsan_handlers.cpp:370
    #4 0x40067f in main (/home/marxin/Programming/testcases/a.out+0x40067f)
    #5 0x7ffff72c8b24 in __libc_start_main (/lib64/libc.so.6+0x27b24)
    #6 0x4005bd in _start (/home/marxin/Programming/testcases/a.out+0x4005bd)

Differential Revision: https://reviews.llvm.org/D97263

Cherry-pick from 16ede0956cb1f4b692dfa619ccfa6ab1de28e19b.
2021-02-23 11:15:16 +01:00
GCC Administrator e62bb7f083 Daily bump. 2021-01-27 00:16:33 +00:00
Martin Liska 2e81b16c24 liblsan: build missing lsan_posix.cpp file
libsanitizer/ChangeLog:

	PR sanitizer/98828
	* lsan/Makefile.am: Add missing lsan_posix.cpp file.
	* lsan/Makefile.in: Likewise.
2021-01-26 14:14:40 +01:00
GCC Administrator 651b8a50a6 Daily bump. 2021-01-06 00:16:55 +00:00
Samuel Thibault f56de3557f Update GNU/Hurd configure support
ChangeLog:

	* libtool.m4: Match gnu* along other GNU systems.
	* libgo/config/libtool.m4: Match gnu* along other GNU systems.
	* libgo/configure: Re-generate.

libffi/
	* configure: Re-generate.

libgomp/
	* configure: Re-generate.

gcc/

	* configure: Re-generate.

libatomic/

	* configure: Re-generate.

libbacktrace/

	* configure: Re-generate.

libcc1/

	* configure: Re-generate.

libgfortran/

	* configure: Re-generate.

libgomp/

	* configure: Re-generate.

libhsail-rt/

	* configure: Re-generate.

libitm/

	* configure: Re-generate.

libobjc/

	* configure: Re-generate.

liboffloadmic/

	* configure: Re-generate.
	* plugin/configure: Re-generate.

libphobos/

	* configure: Re-generate.

libquadmath/

	* configure: Re-generate.

libsanitizer/

	* configure: Re-generate.

libssp/

	* configure: Re-generate.

libstdc++-v3/

	* configure: Re-generate.

libvtv/

	* configure: Re-generate.

lto-plugin/

	* configure: Re-generate.

zlib/

	* configure: Re-generate.
2021-01-05 16:04:14 -07:00
GCC Administrator 6e1edf48eb Daily bump. 2020-12-06 00:16:44 +00:00
Iain Sandoe 1352bc88a0 Darwin : Update libtool and dependencies for Darwin20 [PR97865]
The change in major version (and the increment from Darwin19 to 20)
caused libtool tests to fail which resulted in incorrect build settings
for shared libraries.

We take this opportunity to sort out the shared undefined symbols state
rather than propagating the current unsound behaviour into a new rev.

This change means that we default to the case that missing symbols are
considered an error, and if one wants to allow this intentionally, the
confiuration for that case should be set appropriately.

Three existing cases need undefined dynamic lookup:
 libitm, where there is already a configuration mechanism to add the
         flags.
 libcc1, where we add simple configuration to add the flags for Darwin.
 libsanitizer, where we can add to the existing extra flags.

libcc1/ChangeLog:

	PR target/97865
	* Makefile.am: Add dynamic_lookup to LD flags for Darwin.
	* configure.ac: Test for Darwin host and set a flag.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

libitm/ChangeLog:

	PR target/97865
	* configure.tgt: Add dynamic_lookup to XLDFLAGS for Darwin.
	* configure: Regenerate.

libsanitizer/ChangeLog:

	PR target/97865
	* configure.tgt: Add dynamic_lookup to EXTRA_CXXFLAGS for
	Darwin.
	* configure: Regenerate.

ChangeLog:

	PR target/97865
	* libtool.m4: Update handling of Darwin platform link flags
	for Darwin20.

gcc/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libatomic/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libbacktrace/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libffi/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libgfortran/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libgomp/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libhsail-rt/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libobjc/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libphobos/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libquadmath/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libssp/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libvtv/ChangeLog:

	PR target/97865
	* configure: Regenerate.

zlib/ChangeLog:

	PR target/97865
	* configure: Regenerate.
2020-12-05 08:43:20 +00:00
GCC Administrator a9625c50dd Daily bump. 2020-11-30 00:16:27 +00:00
John David Anglin 4e4ba6478a Fix hppa64-hpux11 build to remove source paths from embedded path.
This change adds the +nodefaultrpath ld option to remove all library
paths that were specified with the -L option from the embedded path.

2020-11-29  John David Anglin  <danglin@gcc.gnu.org>

ChangeLog:
	* libtool.m4 (archive_cmds): Add +nodefaultrpath ld option on
	hppa64-*-hpux11*.

libatomic/ChangeLog:
	* configure: Regenerate.

libbacktrace/ChangeLog:
	* configure: Regenerate.

libcc1/ChangeLog:
	* configure: Regenerate.

libffi/ChangeLog:
	* configure: Regenerate.

libgfortran/ChangeLog:
	* configure: Regenerate.

libgomp/ChangeLog:
	* configure: Regenerate.

libhsail-rt/ChangeLog:
	* configure: Regenerate.

libitm/ChangeLog:
	* configure: Regenerate.

libobjc/ChangeLog:
	* configure: Regenerate.

liboffloadmic/ChangeLog:
	* configure: Regenerate.
	* plugin/configure: Regenerate.

libquadmath/ChangeLog:
	* configure: Regenerate.

libsanitizer/ChangeLog:
	* configure: Regenerate.

libssp/ChangeLog:
	* configure: Regenerate.

libstdc++-v3/ChangeLog:
	* configure: Regenerate.

libvtv/ChangeLog:
	* configure: Regenerate.

lto-plugin/ChangeLog:
	* configure: Regenerate.

zlib/ChangeLog:
	* configure: Regenerate.
2020-11-29 20:11:38 +00:00
GCC Administrator 360258daf5 Daily bump. 2020-11-26 00:16:41 +00:00
Matthew Malcomson b85fb3187e libsanitizer: Add recently added commit to LOCAL_PATCHES
libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Add one commit.
2020-11-25 16:39:11 +00:00
Matthew Malcomson 8a769f816f libsanitizer: Only build libhwasan when targeting AArch64
Though the library has limited support for x86, we don't have any
support for generating code targeting x86 so there is no point building
for that target.

Ensure we build for AArch64 but not for AArch64 ilp32.

libsanitizer/ChangeLog:

	* Makefile.am: Condition Build hwasan directory.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Set HWASAN_SUPPORTED based on target
	architecture.
	* configure.tgt: Likewise.
2020-11-25 16:35:35 +00:00
Matthew Malcomson edb07cb95a libsanitizer: Tie the hwasan library into our build system
This patch tries to tie libhwasan into the GCC build system in the same way
that the other sanitizer runtime libraries are handled.

libsanitizer/ChangeLog:

	* Makefile.am:  Build libhwasan.
	* Makefile.in:  Build libhwasan.
	* asan/Makefile.in:  Build libhwasan.
	* configure:  Build libhwasan.
	* configure.ac:  Build libhwasan.
	* hwasan/Makefile.am: New file.
	* hwasan/Makefile.in: New file.
	* hwasan/libtool-version: New file.
	* interception/Makefile.in: Build libhwasan.
	* libbacktrace/Makefile.in: Build libhwasan.
	* libsanitizer.spec.in: Build libhwasan.
	* lsan/Makefile.in: Build libhwasan.
	* sanitizer_common/Makefile.in: Build libhwasan.
	* tsan/Makefile.in: Build libhwasan.
	* ubsan/Makefile.in: Build libhwasan.
2020-11-25 16:35:33 +00:00
Matthew Malcomson 8eb12742e8 libsanitizer: Hwasan reporting check for dladdr failing
In `GetGlobalSizeFromDescriptor` we use `dladdr` to get info on the the
current address.  `dladdr` returns 0 if it failed.
During testing on Linux this returned 0 to indicate failure, and
populated the `info` structure with a NULL pointer which was
dereferenced later.

This patch checks for `dladdr` returning 0, and in that case returns 0
from `GetGlobalSizeFromDescriptor` to indicate failure of identifying
the address.

This occurs when `GetModuleNameAndOffsetForPC` succeeds for some address
not in a dynamically loaded library.  One example is when the found
"module" is '[stack]' having come from parsing /proc/self/maps.

Cherry-pick from 83ac18205ec69a00ac2be3b603bc3a61293fbe89.

Differential Revision: https://reviews.llvm.org/D91344
2020-11-25 16:35:31 +00:00
Martin Liska 1ee3d1ef10 libsanitizer: add hwasan.
Introduce the libhwasan library from LLVM sources.
2020-11-25 16:35:30 +00:00
GCC Administrator 7a97e2fcf7 Daily bump. 2020-11-22 00:16:24 +00:00
Iain Sandoe 93f1186f7d Darwin, libsanitizer : Support libsanitizer for x86_64-darwin20.
The sanitizer is supported for at least x86_64 and Darwin20.

libsanitizer/ChangeLog:

	* configure.tgt: Allow x86_64 Darwin2x.
2020-11-21 08:56:41 +00:00
GCC Administrator 77f67db2a4 Daily bump. 2020-11-14 00:16:38 +00:00
Martin Liska a98ebdc50a libsanitizer: update LOCAL_PATCHES.
libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Update to the latest commit.
2020-11-13 17:31:16 +01:00
Martin Liska d72227e29a libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
Martin Liska 98f792ff53 libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
Martin Liska b69f33f477 ASAN: Support detect_invalid_pointer_pairs=1 with detect_stack_use_after_return=1
Do not crash when AsanThread::GetStackVariableShadowStart does not find
a variable for a pointer on a shadow stack.

Cherry-pick from ad2be02a833e56f7fe280797280b219eb3312621.

Differential Revision: https://reviews.llvm.org/D89552
2020-10-21 09:27:08 +02:00
Vitaly Buka 00b355522b Fix compilation on older systems
Cherry-pick upstream commit f97ca48b1cbbf5da065e94271cb3af4f1c907dd4.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47896
2020-10-20 11:15:10 +02:00
GCC Administrator 970d683f67 Daily bump. 2020-10-20 00:16:29 +00:00
Martin Liska 04ffed2ef2 libsanitizer: Add recently added commit to LOCAL_PATCHES.
libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Add one commit.
2020-10-19 09:05:34 +02:00
GCC Administrator 3acb91a48e Daily bump. 2020-10-19 00:16:22 +00:00
Iain Sandoe 476036b35c libsanitizer, Darwin, Bootstrap : Fix bootstrap on Darwin <= 15.
The latest upstream merge for libsanitizer introduces code that makes
use of some macro values that are not available in SDKs for versions
of Darwin <= 15 (macOS 10.11).

Add definitions for these where they are not present.

libsanitizer/ChangeLog:

	* sanitizer_common/sanitizer_mac.h: Ensure that TARGET_OS_
	macros are defined where the macOS SDK does not contain
	them.
	(TARGET_OS_OSX, TARGET_OS_IOS, TARGET_OS_TV, TARGET_OS_WATCH):
	Define where needed.
2020-10-18 20:55:58 +01:00
GCC Administrator 56e4eee935 Daily bump. 2020-10-17 00:16:29 +00:00
Martin Liska 9791b4bb4b libsanitizer: update locale patches
libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Update revision.
2020-10-16 10:58:03 +02:00
Martin Liska b040b1ce1f Reapply all revisions mentioned in LOCAL_PATCHES.
(cherry picked from commit 21bb1625bd)
2020-10-16 10:57:16 +02:00
Martin Liska 0b997f6e07 libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
GCC Administrator 44135373fc Daily bump. 2020-09-22 00:16:31 +00:00
Ian Lance Taylor 762c16eba6 libsanitizer: rename new libbacktrace symbols
* libbacktrace/backtrace-rename.h (backtrace_uncompress_lzma):
	Define.
	(backtrace_syminfo_to_full_callback): Define.
	(backtrace_syminfo_to_full_error_callback): Define.
2020-09-21 12:03:45 -07:00
GCC Administrator 96686b3fcd Daily bump. 2020-07-17 00:16:27 +00:00
Rainer Orth 6805c1c6a6 libsanitizer: Fix GetPcSpBp determination of SP on 32-bit Solaris/x86
The latest Solaris 11.4/x86 update uncovered a libsanitizer bug that
caused one test to FAIL for 32-bit:

+FAIL: c-c++-common/asan/null-deref-1.c   -O0  output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c   -O1  output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c   -O2  output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c   -O2 -flto  output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto -flto-partition=none
output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c   -O3 -g  output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c   -Os  output pattern test

I've identified the problem and the fix has just landed in upstream
llvm-project:

	https://reviews.llvm.org/D83664

Tested on i386-pc-solaris2.11 and x86_64-pc-linux.gnu.

	libsanitizer:
	* sanitizer_common/sanitizer_linux.cpp: Cherry-pick llvm-project
	revision f0e9b76c3500496f8f3ea7abe6f4bf801e3b41e7.
2020-07-16 10:38:48 +02:00
GCC Administrator b952c2cfcd Daily bump. 2020-06-10 00:16:47 +00:00
Martin Liska 942a384ef9
libsanitizer: use gnu++14
libsanitizer/ChangeLog:

	* asan/Makefile.am: Replace gnu++11 with gnu++14.
	* interception/Makefile.am: Likewise.
	* libbacktrace/Makefile.am: Likewise.
	* lsan/Makefile.am: Likewise.
	* sanitizer_common/Makefile.am: Likewise.
	* tsan/Makefile.am: Likewise.
	* ubsan/Makefile.am: Likewise.
	* asan/Makefile.in: Regenerate.
	* interception/Makefile.in: Likewise.
	* libbacktrace/Makefile.in: Likewise.
	* lsan/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.
	* ubsan/Makefile.in: Likewise.
2020-06-09 10:07:24 +02:00