Commit Graph

5088 Commits

Author SHA1 Message Date
Thomas A
5fd9bc0eff Use Architecture Abstraction 2020-10-03 14:27:10 -07:00
Ariel Abreu
c4dc3214ea
Merge remote-tracking branch 'origin/master' into update-sources 2020-06-15 14:30:55 -04:00
Thomas A
cb293c7c14 Add platform to SIBLINGS 2020-05-15 19:53:23 -07:00
Ariel Abreu
00422e05d2
Initial update to clean up include directories
"initial" because there might some additional modifications necessary later on
2020-05-14 12:57:38 -04:00
Thomas A
ca3363cd23 Add ARM64 Support 2020-05-13 19:13:03 -07:00
Lubos Dolezel
08b1718277 New ranlib location 2020-04-17 21:29:33 +02:00
Andrew Hyatt
fc763d0a0b
Allow i386 or x86_64 only builds 2019-08-13 14:04:13 -04:00
Lubos Dolezel
bb8e6e5ceb BlocksRuntime is replaced with libclosure 2017-01-28 21:53:25 +01:00
Lubos Dolezel
756b73078c Adapt to new libc 2017-01-28 00:16:04 +01:00
Lubos Dolezel
2e6b25e8e4 Build static libs for 32/64 bits separately 2017-01-25 23:33:13 +01:00
Lubos Dolezel
d790b0e8f6 Work on build after libc upgrade 2017-01-25 16:09:34 +01:00
Lubos Dolezel
52df903643 More changes needed for dylib usage 2017-01-15 20:31:23 +01:00
Lubos Dolezel
da0a3111a3 Build dylibs 2017-01-08 15:05:31 +01:00
Lubos Dolezel
addf1e22f8 Updated build file 2016-02-10 22:30:03 +01:00
Lubos Dolezel
da5f684563 Use -nostdinc with Darling 2015-12-15 00:52:06 +01:00
Lubos Dolezel
f3b7ec8be1 Changes for Darling build 2015-12-15 00:33:07 +01:00
Kuba Brecka
7f1c97c766 [tsan] Allow memchr interceptor to be used before initialization on OS X
On OS X, `memchr` is called on a newly created thread even before `__tsan_thread_start_func` is invoked, which means that the ThreadState object for that thread will not yet be initialized. Let's add `COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED` into the interceptor to simply call `internal_memchr` in these cases.

Differential Revision: http://reviews.llvm.org/D14283



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251935 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 16:19:37 +00:00
Martell Malone
6754ab20d5 Fix r251928 build error
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251931 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 16:04:28 +00:00
Martell Malone
4356fa3ec6 Support for 32-bit mingw-w64 in compiler-rt.
Add chkstk/alloca for gcc objects.
Replace or instructions with test, the latter should be marginally more
efficent, as it does not write to memory.

Differential Revision: http://reviews.llvm.org/D14044

Patch by vadimcn

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251928 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 15:46:23 +00:00
Kuba Brecka
1d301e42d6 Fixup for r251923 to fix a warning about an extra semicolon.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251924 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 14:45:32 +00:00
Kuba Brecka
657bd0eb3d Reapply r251916 ("[tsan] Port TSan interceptors on OS X").
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251923 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 14:43:39 +00:00
Kuba Brecka
e2b976ac48 Revert r251916 ("[tsan] Port TSan interceptors on OS X").
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251922 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 14:42:03 +00:00
Kuba Brecka
befa80c402 Reapply r251918 ("[tsan] Fix build errors for TSan on OS X").
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251920 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 14:33:39 +00:00
Kuba Brecka
4d918b66b1 Revert r251918 ("[tsan] Fix build errors for TSan on OS X").
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251919 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 14:30:31 +00:00
Kuba Brecka
1d675fa922 [tsan] Fix build errors for TSan on OS X
This patch moves a few functions from `sanitizer_linux_libcdep.cc` to `sanitizer_posix_libcdep.cc` in order to use them on OS X as well. Plus a few more small build fixes.

This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point.

Differential Revision: http://reviews.llvm.org/D14235



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251918 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 14:26:00 +00:00
Kuba Brecka
28992d9bb6 [tsan] Port TSan interceptors on OS X
This patch modifies `tsan_interceptors.cc` to be buildable on OS X. Several of the intercepted methods are not available on OS X, so we need to `#if !SANITIZER_MAC` them. Plus a few other fixes, e.g. `pthread_yield` doesn't exist, let's use `internal_sched_yield` instead.

This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point.

Differential Revision: http://reviews.llvm.org/D14237




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251916 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 14:22:51 +00:00
Kuba Brecka
fe1142ec10 [tsan] CMake support for TSan on OS X
Hi, this patch adds a CMake flag called `COMPILER_RT_ENABLE_TSAN_OSX`, which is off by default. If enabled, the build system will be building the OS X version of the TSan runtime library (called `libclang_rt.tsan_osx_dynamic.dylib`). I'll submit patches that fix OS X build errors shortly.

This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251915 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 14:13:59 +00:00
Alexey Samsonov
6f7eaaad04 Revert "Apply modernize-use-default to compiler-rt."
This reverts commit r250823.

Replacing at least some of empty
constructors with "= default" variants is a semantical change which we
don't want. E.g. __tsan::ClockBlock contains a union of large arrays,
and it's critical for correctness and performance that we don't memset()
these arrays in the constructor.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251717 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 18:52:31 +00:00
Saleem Abdulrasool
8f11ffecd8 Sanitizer: define WIN32_LEAN_AND_MEAN
Define WIN32_LEAN_AND_MEAN before including Windows.h.  This is already being
done in some places.  This does it more broadly.  This permits building ASAN on
Linux for Winndows, as well as reduces the amount of included declarations.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251649 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-29 20:36:55 +00:00
Adhemerval Zanella
5b3b8a081d [compiler-rt] [msan] Unify aarch64 mapping
This patch unify the 39-bit and 42-bit mapping for aarch64 to use only
one instrumentation algorithm.  A runtime check avoid mapping 42-bit 
only segments for 39-bit kernels.

The mapping to use now is for 39 and 42-bits:

    0x00000000000ULL-0x01000000000ULL  MappingDesc::INVALID
    0x01000000000ULL-0x02000000000ULL  MappingDesc::SHADOW
    0x02000000000ULL-0x03000000000ULL  MappingDesc::ORIGIN
    0x03000000000ULL-0x04000000000ULL  MappingDesc::SHADOW
    0x04000000000ULL-0x05000000000ULL  MappingDesc::ORIGIN
    0x05000000000ULL-0x06000000000ULL  MappingDesc::APP
    0x06000000000ULL-0x07000000000ULL  MappingDesc::INVALID
    0x07000000000ULL-0x08000000000ULL  MappingDesc::APP

And only for 42-bits:

    0x08000000000ULL-0x09000000000ULL  MappingDesc::INVALID
    0x09000000000ULL-0x0A000000000ULL  MappingDesc::SHADOW
    0x0A000000000ULL-0x0B000000000ULL  MappingDesc::ORIGIN
    0x0B000000000ULL-0x0F000000000ULL  MappingDesc::INVALID
    0x0F000000000ULL-0x10000000000ULL  MappingDesc::APP
    0x10000000000ULL-0x11000000000ULL  MappingDesc::INVALID
    0x11000000000ULL-0x12000000000ULL  MappingDesc::APP
    0x12000000000ULL-0x17000000000ULL  MappingDesc::INVALID
    0x17000000000ULL-0x18000000000ULL  MappingDesc::SHADOW
    0x18000000000ULL-0x19000000000ULL  MappingDesc::ORIGIN
    0x19000000000ULL-0x20000000000ULL  MappingDesc::INVALID
    0x20000000000ULL-0x21000000000ULL  MappingDesc::APP
    0x21000000000ULL-0x26000000000ULL  MappingDesc::INVALID
    0x26000000000ULL-0x27000000000ULL  MappingDesc::SHADOW
    0x27000000000ULL-0x28000000000ULL  MappingDesc::ORIGIN
    0x28000000000ULL-0x29000000000ULL  MappingDesc::SHADOW
    0x29000000000ULL-0x2A000000000ULL  MappingDesc::ORIGIN
    0x2A000000000ULL-0x2B000000000ULL  MappingDesc::APP
    0x2B000000000ULL-0x2C000000000ULL  MappingDesc::INVALID
    0x2C000000000ULL-0x2D000000000ULL  MappingDesc::SHADOW
    0x2D000000000ULL-0x2E000000000ULL  MappingDesc::ORIGIN
    0x2E000000000ULL-0x2F000000000ULL  MappingDesc::APP
    0x2F000000000ULL-0x39000000000ULL  MappingDesc::INVALID
    0x39000000000ULL-0x3A000000000ULL  MappingDesc::SHADOW
    0x3A000000000ULL-0x3B000000000ULL  MappingDesc::ORIGIN
    0x3B000000000ULL-0x3C000000000ULL  MappingDesc::APP
    0x3C000000000ULL-0x3D000000000ULL  MappingDesc::INVALID
    0x3D000000000ULL-0x3E000000000ULL  MappingDesc::SHADOW
    0x3E000000000ULL-0x3F000000000ULL  MappingDesc::ORIGIN
    0x3F000000000ULL-0x40000000000ULL  MappingDesc::APP

And although complex it provides a better memory utilization that
previous one.

[1] http://reviews.llvm.org/D13817


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251625 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-29 13:04:19 +00:00
Anna Zaks
a1eec3a36d Reapply: [asan] On OS X, log reports to syslog and os_trace
When ASan currently detects a bug, by default it will only print out the text
        of the report to stderr. This patch changes this behavior and writes the full
        text of the report to syslog before we terminate the process. It also calls
        os_trace (Activity Tracing available on OS X and iOS) with a message saying
        that the report is available in syslog. This is useful, because this message
        will be shown in the crash log.

        For this to work, the patch makes sure we store the full report into
        error_message_buffer unconditionally, and it also strips out ANSI escape
        sequences from the report (they are used when producing colored reports).

        I've initially tried to log to syslog during printing, which is done on Android
        right now. The advantage is that if we crash during error reporting or the
        produced error does not go through ScopedInErrorReport, we would still get a
        (partial) message in the syslog. However, that solution is very problematic on
        OS X. One issue is that the logging routine uses GCD, which may spawn a new
        thread on its behalf. In many cases, the reporting logic locks threadRegistry,
        which leads to deadlocks.

        Reviewed at http://reviews.llvm.org/D13452

        (In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid
         build failures on Linux.)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251577 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-28 23:18:44 +00:00
Evgeniy Stepanov
bd58cbc2f3 [asan] Fix asan_device_setup script on KitKat.
app_process32, when started via a shell script wrapper, needs a
different security context to satisty SELinux.

Patch by Abhishek Arya.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251572 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-28 22:55:12 +00:00
Ivan Krasin
1a2a5a81cc sanitizer_common: be more verbose, when symbolizer is not found.
Summary:
I have othen been stuck when I got an ASAN report, but no symbols
are resolved. The reasons might be different, and it always 
requires a bit of detective work to track down.

These more verbose error messages will help the users like me.

Reviewers: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14135

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251553 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-28 20:45:34 +00:00
Anna Zaks
29e41712c4 Revert "[asan] On OS X, log reports to syslog and os_trace"
This reverts commit 251447.

(Which caused failures on a Linux bot.)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251467 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-27 23:15:05 +00:00
Anna Zaks
72f38c18d7 [asan] On OS X, log reports to syslog and os_trace
When ASan currently detects a bug, by default it will only print out the text
of the report to stderr. This patch changes this behavior and writes the full
text of the report to syslog before we terminate the process. It also calls
os_trace (Activity Tracing available on OS X and iOS) with a message saying
that the report is available in syslog. This is useful, because this message
will be shown in the crash log.

For this to work, the patch makes sure we store the full report into
error_message_buffer unconditionally, and it also strips out ANSI escape
sequences from the report (they are used when producing colored reports).

I've initially tried to log to syslog during printing, which is done on Android
right now. The advantage is that if we crash during error reporting or the
produced error does not go through ScopedInErrorReport, we would still get a
(partial) message in the syslog. However, that solution is very problematic on
OS X. One issue is that the logging routine uses GCD, which may spawn a new
thread on its behalf. In many cases, the reporting logic locks threadRegistry,
which leads to deadlocks.

Reviewed at http://reviews.llvm.org/D13452

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251447 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-27 20:13:01 +00:00
Anna Zaks
6f70a3cc0c [asan] Sort headers.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251446 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-27 20:12:55 +00:00
Anna Zaks
fcec98e044 [asan] On OS X, tag mapped regions with VM_MEMORY_ANALYSIS_TOOL tag
This will tag all mmapped memory sanitizers use with "Performance tool data"
when viewed in vmmap. (Even though sanitizers are not performance tools, it's
the best available match and better than having the unidentified objects.)

http://reviews.llvm.org/D13609

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251445 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-27 20:12:53 +00:00
Alexey Samsonov
be4b740a00 asan_symbolize.py: Call llvm-symbolizer with --functions=linkage instead of --functions=short.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 21:48:49 +00:00
Adhemerval Zanella
80f1d254b3 [compiler-rt] Fix ptrace interceptor for aarch64
This patch fixes the ptrace interceptor for aarch64. The PTRACE_GETREGSET
ptrace syscall with with invalid memory might zero the iovec::iov_base
field and then masking the subsequent check after the syscall (since it
will be 0 and it will not trigger an invalid access). The fix is to copy
the value on a local variable and use its value on the checks.

The patch also adds more coverage on the Linux/ptrace.cc testcase by addding
check for PTRACE_GETREGSET for both general and floating registers (aarch64
definitions added only).


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 18:55:04 +00:00
Adhemerval Zanella
d1165cd1d4 [compiler-rt] Enable ptrace sanitizer for arm
This patch enables the ptrace syscall interceptors for arm and adds support
for both PTRACE_GETVFPREGS and PTRACE_SETVFPREGS used to get the VFP register
from ARM.

The ptrace tests is also updated with arm and PTRACE_GETVFPREGS tests.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 18:15:14 +00:00
Kostya Serebryany
8c96149e30 [sanitizer-coverage] introduce __sanitizer_get_total_unique_caller_callee_pairs
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251071 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 22:06:41 +00:00
Evgeniy Stepanov
d777b79886 [msan] Intercept process_vm_readv/writev.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251059 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 20:35:42 +00:00
Evgeniy Stepanov
d6184a3b98 [msan] Build unit test shared library code with -fPIC.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250957 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21 22:13:36 +00:00
Adhemerval Zanella
0729a38100 [lsan] [aarch64] Add support for AArch64
This patch add support for leak sanitizer for aarch64.  Similar to
MIPS it uses a SizeClassAllocator32 due VMA constraints (aarch64
currently supports 39 and 42-bit VMA).

It also fixes the android build issue.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250898 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21 13:08:06 +00:00
Angel Garcia Gomez
f44877aefa Apply modernize-use-default to compiler-rt.
Summary: Replace empty bodies of default constructors and destructors with '= default'.

Reviewers: klimek, bkramer

Subscribers: alexfh, cfe-commits

Differential Revision: http://reviews.llvm.org/D13892

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250823 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 12:53:50 +00:00
Yury Gribov
33b6756813 [ubsan] Fix looksLikeFloatCastOverflowDataV1 heuristic to work if one of the types is unknown.
Differential revision: http://reviews.llvm.org/D13775


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250806 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 08:40:52 +00:00
Evgeniy Stepanov
c7c9a04ce6 [msan] Intercept mincore.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250761 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 23:39:11 +00:00
Evgeniy Stepanov
edfb216103 [msan] Intercept pthread_getcancel*.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250752 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 23:00:13 +00:00
Xinliang David Li
73404b7fcd [PGO] Eliminate prof data register calls on FreeBSD platform
This is a follow up patch of r250199 after verifying the start/stop
section symbols work as spected on FreeBSD.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250680 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 04:17:19 +00:00
Xinliang David Li
7b13ae6fb1 Use struct type instead of raw array for raw profile header (NFC)
This patch introduces a well defined header struct
to represent raw profile header instead of using raw array.
Previously the raw array is used in two different files and
is very error prone when header structure is re-organized.
This is a small cleanup with NFC.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250561 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 22:21:56 +00:00