Commit Graph

13576 Commits

Author SHA1 Message Date
Fangrui Song 140808768d [test] Fix asan/TestCases/Linux/globals-gc-sections-lld.cpp with -fsanitize-address-globals-dead-stripping
r302591 dropped -fsanitize-address-globals-dead-stripping for ELF platforms
(to work around a gold<2.27 bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19002)

Upgrade REQUIRES: from lto (COMPILER_RT_TEST_USE_LLD (set by Android, but rarely used elsewhere)) to lto-available.
2020-12-06 11:11:15 -08:00
Fangrui Song dde44f488c [test] Fix asan/TestCases/Posix/lto-constmerge-odr.cpp when 'binutils_lto' is avaiable
If COMPILER_RT_TEST_USE_LLD is not set, config.use_lld will be False.
However, if feature 'binutils_lto' is available, lto_supported can still be True,
but config.target_cflags will not get -fuse-ld=lld from config.lto_flags

As a result, we may use clang -flto with system 'ld' which may not support the bitcode file, e.g.

  ld: error: /tmp/lto-constmerge-odr-44a1ee.o: Unknown attribute kind (70) (Producer: 'LLVM12.0.0git' Reader: 'LLVM 12.0.0git')
  // The system ld+LLVMgold.so do not support ATTR_KIND_MUSTPROGRESS (70).

Just require lld-available and add -fuse-ld=lld.
2020-12-06 10:31:40 -08:00
Fangrui Song b00f345acd [asan][test] Fix odr-vtable.cpp 2020-12-05 19:30:41 -08:00
Benjamin Kramer 2a136a7a9c [X86] Autodetect znver3 2020-12-05 19:08:20 +01:00
Zhuojia Shen 24333481cb [builtins][ARM] Check __ARM_FP instead of __VFP_FP__.
This patch fixes builtins' CMakeLists.txt and their VFP tests to check
the standard macro defined in the ACLE for VFP support. It also enables
the tests to be built and run for single-precision-only targets while
builtins were built with double-precision support.

Differential revision: https://reviews.llvm.org/D92497
2020-12-04 20:53:23 -08:00
Fangrui Song 190b4374c0 [asan][test] Improve -asan-use-private-alias tests
In preparation for D92078
2020-12-04 15:05:59 -08:00
Jianzhou Zhao 80e326a8c4 [dfsan] Support passing non-i16 shadow values in TLS mode
This is a child diff of D92261.

It extended TLS arg/ret to work with aggregate types.

For a function
  t foo(t1 a1, t2 a2, ... tn an)
Its arguments shadow are saved in TLS args like
  a1_s, a2_s, ..., an_s
TLS ret simply includes r_s. By calculating the type size of each shadow
value, we can get their offset.

This is similar to what MSan does. See __msan_retval_tls and __msan_param_tls
from llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp.

Note that this change does not add test cases for overflowed TLS
arg/ret because this is hard to test w/o supporting aggregate shdow
types. We will be adding them after supporting that.

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D92440
2020-12-04 02:45:07 +00:00
Adhemerval Zanella c288715e95 [compiler-rt] [builtins] Use _Float16 on extendhfsf2, truncdfhf2 __truncsfhf2 if available
On AArch64 it allows use the native FP16 ABI (although libcalls are
not emitted for fptrunc/fpext lowering), while on other architectures
the expected current semantic is preserved (arm for instance).

For testing the _Float16 usage is enabled by architecture base,
currently only for arm, aarch64, and arm64.

This re-enabled revert done by https://reviews.llvm.org/rGb534beabeed3ba1777cd0ff9ce552d077e496726

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D92241
2020-12-03 16:08:55 -03:00
Stella Stamenova 1410b72be3 [compiler-rt] Fix a bug in the cmakelists file when CMAKE_CXX_FLAGS are empty
Right now, the regex expression will fail if the flags were not set. Instead, we should follow the pattern of other llvm projects and quote the expression, so that it can work even when the flags are not set.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D92586
2020-12-03 10:25:52 -08:00
Martin Storsjö d3fef7a7c2 [compiler-rt] Fix building the aarch64 out-of-line atomics assembly for non-ELF platforms
Move the two different definitions of FUNC_ALIGN out of the ELF
specific block. Add the missing CFI_END in
END_COMPILERRT_OUTLINE_FUNCTION, to go with the corresponding CFI_START
in DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED.

Differential Revision: https://reviews.llvm.org/D92549
2020-12-03 15:31:06 +02:00
Vitaly Buka 20a2b1bf6b [NFC][sanitizer] Another attempt to fix test on arm 2020-12-02 18:36:02 -08:00
Kostya Kortchinsky 0a09c1cc9d [scudo][standalone] Add missing va_end() in ScopedString::append
In ScopedString::append va_list ArgsCopy is created but never cleanuped
which can lead to undefined behaviour, like stack corruption.

Reviewed By: cryptoad

Differential Revision: https://reviews.llvm.org/D92383
2020-12-02 16:10:50 -08:00
Jianzhou Zhao 6fa06628a7 [dfsan] Add test cases for struct/pair
This is a child diff of D92261.

This locks down the behavior before the change.
2020-12-02 21:25:23 +00:00
Pavel Iliin a4ac434c47 [AArch64] Compiler-rt interface for out-of-line atomics.
Out-of-line helper functions to support LSE deployment added.
This is a port of libgcc implementation:
https://gcc.gnu.org/git/?p=gcc.git;h=33befddcb849235353dc263db1c7d07dc15c9faa

Differential Revision: https://reviews.llvm.org/D91156
2020-12-02 20:07:12 +00:00
Roland McGrath 827e075676 [lsan] Use final on Fuchsia ThreadContext declaration
This is consistent with other platforms' versions and
eliminates a compiler warning.

Reviewed By: leonardchan

Differential Revision: https://reviews.llvm.org/D92442
2020-12-02 11:58:03 -08:00
Kostya Kortchinsky c904c32b9c [GWP-ASan] Fix flaky test on Fuchsia
The LateInit test might be reusing some already initialized thread
specific data if run within the main thread. This means that there
is a chance that the current value will not be enough for the 100
iterations, hence the test flaking.

Fix this by making the test run in its own thread.

Differential Revision: https://reviews.llvm.org/D92415
2020-12-02 09:00:51 -08:00
Vitaly Buka 1f3def16f6 [NFC][sanitizer] Fix test on 32bit platform 2020-12-02 07:32:40 -08:00
Ahsan Saghir 5045b831a3 [PowerPC] Mark sanitizer test case unsupported for powerpc64
The author of "https://reviews.llvm.org/D92428" marked
'resize_tls_dynamic.cpp' with XFAIL for powerpc64 since
it fails on a bunch of PowerPC buildbots. However, the
original test case passes on clang-ppc64le-rhel bot. So
marking this as XFAIL makes this bot to fail as the test
case passes unexpectedly. We are marking this unsupported
on all PowerPC64 for now until it is fixed for all the
PowerPC buildbots.
2020-12-02 09:03:28 -06:00
Vitaly Buka 3f0c4bfc64 [NFC][sanitizer] Fix ppc -> powerpc64 in XFAIL 2020-12-01 17:57:42 -08:00
Vitaly Buka bdd6718bef [NFC] Disable new test from D92428 on PPC TSAN 2020-12-01 16:54:14 -08:00
Vitaly Buka 8a300deb3e [sanitizer] Make DTLS_on_tls_get_addr signal safer
Avoid relocating DTV table and use linked list of mmap-ed pages.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D92428
2020-12-01 16:16:04 -08:00
Vitaly Buka adfefa5553 [NFC] Extract ForEachDVT 2020-12-01 16:15:32 -08:00
Alexey Baturo 17427ec3f3 [RISCV][crt] support building without init_array
Reviewed By: luismarques, phosek, kito-cheng

Differential Revision: https://reviews.llvm.org/D87997
2020-12-01 17:17:50 +03:00
Martin Storsjö 2e5aaf65a3 [compiler-rt] [emutls] Handle unused parameters in a compiler agnostic way
The MSVC specific pragmas disable this warning, but the pragmas themselves
(when not guarded by any _MSC_VER ifdef) cause warnings for other targets,
e.g. when targeting mingw.

Instead silence the MSVC warnings about unused parameters by casting
the parameters to void.

Differential Revision: https://reviews.llvm.org/D91851
2020-12-01 10:07:53 +02:00
Reid Kleckner b5af5787b3 [WinASan] Improve exception reporting accuracy
Previously, ASan would produce reports like this:
ERROR: AddressSanitizer: breakpoint on unknown address 0x000000000000 (pc 0x7fffdd7c5e86 ...)

This is unhelpful, because the developer may think this is a null
pointer dereference, and not a breakpoint exception on some PC.

The cause was that SignalContext::GetAddress would read the
ExceptionInformation array to retreive an address for any kind of
exception. That data is only available for access violation exceptions.
This changes it to be conditional on the exception type, and to use the
PC otherwise.

I added a variety of tests for common exception types:
- int div zero
- breakpoint
- ud2a / illegal instruction
- SSE misalignment

I also tightened up IsMemoryAccess and GetWriteFlag to check the
ExceptionCode rather than looking at ExceptionInformation[1] directly.

Differential Revision: https://reviews.llvm.org/D92344
2020-11-30 16:39:22 -08:00
Vy Nguyen 1b723a955d [sanitizer] Disable use_tls_dynamic on on-Android x86 Linux.
https://bugs.chromium.org/p/chromium/issues/detail?id=1153421

Differential Revision: https://reviews.llvm.org/D92273
2020-11-30 11:45:36 -05:00
Reid Kleckner b534beabee Revert builtins fp16 support: tests do not pass on Mac
Revert "[compiler-rt] [builtins] Support conversion between fp16 and fp128" & dependency

Revert "[compiler-rt] [builtins] Use _Float16 on extendhfsf2, truncdfhf2 __truncsfhf2 if available"

This reverts commit 7a94829881.

This reverts commit 1fb91fcf9c.
2020-11-25 16:12:49 -08:00
Luís Marques 1bc85cbbb8 [Sanitizer][RISCV] Fix redefinition of REG_SP
The include header sys/ucontext.h already defines REG_SP as 2, causing
redefinition warnings during compilation. This patch fixes that issue.
(We also can't just use the numerical definition provided by the header,
as REG_SP is used in this file this refers to a struct field.)

Differential Revision: https://reviews.llvm.org/D90934
2020-11-25 00:04:47 +00:00
Evgenii Stepanov 237b024b06 [hwasan] Fix tests when vm.overcommit_memory=1.
Remove an invalid check from sizes.cpp that only passes when overcommit is disabled.

Fixes PR48274.

Differential Revision: https://reviews.llvm.org/D91999
2020-11-23 16:05:56 -08:00
Martin Storsjö 33fb9679ec [compiler-rt] [profile] Silence a warning about an unused function on mingw targets
This function is only used within the ifdef below.

Differential Revision: https://reviews.llvm.org/D91850
2020-11-21 22:14:35 +02:00
Evgenii Stepanov 08d90f72ce [hwasan] Implement error report callback.
Similar to __asan_set_error_report_callback, pass the entire report to a
user provided callback function.

Differential Revision: https://reviews.llvm.org/D91825
2020-11-20 16:48:19 -08:00
Vitaly Buka 3b947cc8ce [msan] unpoison_file from fclose and fflash
Also unpoison IO_write_base/_IO_write_end buffer

memcpy from fclose and fflash can copy internal bytes without metadata into user memory.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D91858
2020-11-20 13:09:01 -08:00
Rainer Orth 03d593dd7e [sanitizers][test] Test sanitizer_common and ubsan_minimal on Solaris
During the initial Solaris sanitizer port, I missed to enable the
`sanitizer_common` and `ubsan_minimal` testsuites.  This patch fixes this,
correcting a few unportabilities:

- `Posix/getpass.cpp` failed to link since Solaris lacks `libutil`.
  Omitting the library lets the test `PASS`, but I thought adding `%libutil`
  along the lines of `%librt` to be overkill.
- One subtest of `Posix/getpw_getgr.cpp` is disabled because Solaris
  `getpwent_r` has a different signature than expected.
- `/dev/null` is a symlink on Solaris.
- XPG7 specifies that `uname` returns a non-negative value on success.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D91606
2020-11-20 14:06:25 +01:00
Rainer Orth 0f69cbe269 [sanitizer_common][test] Disable CombinedAllocator32Compact etc. on Solaris/sparcv9
As reported in PR 48202, two allocator tests `FAIL` on Solaris/sparcv9,
presumably because Solaris uses the full 64-bit address space and the
allocator cannot deal with that:

  SanitizerCommon-Unit :: ./Sanitizer-sparcv9-Test/SanitizerCommon.CombinedAllocator32Compact
  SanitizerCommon-Unit :: ./Sanitizer-sparcv9-Test/SanitizerCommon.SizeClassAllocator32Iteration

This patch disables the tests.

Tested on `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D91622
2020-11-20 13:02:15 +01:00
Rainer Orth ce6524d127 [sanitizer_common][test] Disable FastUnwindTest.* on SPARC
Many of the `FastUnwindTest.*` tests `FAIL` on SPARC, both Solaris and
Linux.  The issue is that the fake stacks used in those tests don't match
the requirements of the SPARC unwinder in `sanitizer_stacktrace_sparc.cpp`
which has to look at the register window save area.

I'm disabling the failing tests.

Tested on `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D91618
2020-11-20 12:52:18 +01:00
Jianzhou Zhao b4ac05d763 Replace the equivalent code by UnionTableAddr
UnionTableAddr is always inlined.

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/DD91758
2020-11-19 20:15:25 +00:00
Teresa Johnson a75b2e87e6 [MemProf] Add interface to dump profile
Add an interface so that the profile can be dumped on demand.

Differential Revision: https://reviews.llvm.org/D91768
2020-11-19 10:21:53 -08:00
Adhemerval Zanella 7a94829881 [compiler-rt] [builtins] Use _Float16 on extendhfsf2, truncdfhf2 __truncsfhf2 if available
On AArch64 it allows use the native FP16 ABI (although libcalls are
not emitted for fptrunc/fpext lowering), while on other architectures
the expected current semantic is preserved (arm for instance).

Differential Revision: https://reviews.llvm.org/D91733
2020-11-19 15:14:50 -03:00
Adhemerval Zanella 1fb91fcf9c [compiler-rt] [builtins] Support conversion between fp16 and fp128
This patch adds both extendhftf2 and trunctfhf2 to support
conversion between half-precision and quad-precision floating-point
values. They are enabled iff the compiler supports _Float16.

Some notes on ARM plaforms: while __fp16 is supported on all
architectures, _Float16 is supported only for 32-bit ARM, 64-bit ARM,
and SPIR (as indicated by clang/docs/LanguageExtensions.rst).  Also,
__fp16 is a storage format and promoted to 'float' for argument passing
and 64-bit ARM supports floating-point convert precision to half as
base armv8-a instruction.

It means that although extendhfsf2, truncdfhf2 __truncsfhf2 will be
built for 64-bit ARM, they will be never used in practice (compiler
won't emit libcall to them). This patch does not change the ABI for
32-bit ARM, it will continue to pass _Float16 as uint16.

Differential Revision: https://reviews.llvm.org/D91732
2020-11-19 15:14:50 -03:00
Teresa Johnson 8f778b283d [sanitizer_common] Add facility to get the full report path
Add a new interface __sanitizer_get_report_path which will return the
full path to the report file if __sanitizer_set_report_path was
previously called (otherwise it returns null). This is useful in
particular for memory profiling handlers to access the path which
was specified at compile time (and passed down via
__memprof_profile_filename), including the pid added to the path when
the file is opened.

There wasn't a test for __sanitizer_set_report_path, so I added one
which additionally tests the new interface.

Differential Revision: https://reviews.llvm.org/D91765
2020-11-19 09:19:12 -08:00
Evgenii Stepanov 523cc097fd [hwasan] Fix Thread reuse (try 2).
HwasanThreadList::DontNeedThread clobbers Thread::next_,
Breaking the freelist. As a result, only the top of the freelist ever
gets reused, and the rest of it is lost.

Since the Thread object with its associated ring buffer is only 8Kb, this is
typically only noticable in long running processes, such as fuzzers.

Fix the problem by switching from an intrusive linked list to a vector.

Differential Revision: https://reviews.llvm.org/D91392
2020-11-18 16:04:08 -08:00
Vitaly Buka 0e2585c804 [tsan] Add pthread_cond_clockwait interceptor
Disable the test on old systems.
pthread_cond_clockwait is supported by glibc-2.30.
It also supported by Android api 30 even though we
do not run tsan on Android.

Fixes https://github.com/google/sanitizers/issues/1259

Reviewed By: dvyukov
2020-11-18 14:39:19 -08:00
Kostya Kortchinsky 5556616b5b [GWP-ASan] Port tests to Fuchsia
This modifies the tests so that they can be run on Fuchsia:
- add the necessary includes for `set`/`vector` etc
- do the few modifications required to use zxtest instead og gtest

`backtrace.cpp` requires stacktrace support that Fuchsia doesn't have
yet, and `enable_disable.cpp` currently uses `fork()` which Fuchsia
doesn't support yet. I'll revisit this later.

I chose to use `harness.h` to hold my "platform-specific" include and
namespace, and using this header in tests rather than `gtest.h`,
which I am open to change if someone would rather go another direction.

Differential Revision: https://reviews.llvm.org/D91575
2020-11-18 13:36:12 -08:00
Wolfgang Pieb 87369c6261 Revert "[tsan] Add pthread_cond_clockwait interceptor"
This reverts commit 16eb853ffd.

The test is failing on some Linux build bots. See the review for
an example.
2020-11-18 11:58:45 -08:00
Roland McGrath 7810d83786 [GWP-ASan] Respect GWP_ASAN_DEFAULT_ENABLED compile-time macro
If the containing allocator build uses -DGWP_ASAN_DEFAULT_ENABLED=false
then the option will default to false.  For e.g. Scudo, this is simpler
and more efficient than using -DSCUDO_DEFAULT_OPTIONS=... to set gwp-asan
options that have to be parsed from the string at startup.

Reviewed By: hctim

Differential Revision: https://reviews.llvm.org/D91463
2020-11-18 10:34:42 -08:00
Seonghyun Park 096bd9b293 [sanitizer] Fix typo in log messages
Fix typo in log messages

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D91492
2020-11-18 03:42:38 -08:00
Vitaly Buka 16eb853ffd [tsan] Add pthread_cond_clockwait interceptor
Fixes https://github.com/google/sanitizers/issues/1259

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D91684
2020-11-18 03:01:58 -08:00
Vitaly Buka 1c0ef2984d [NFC][tsan] Prepepare for more interceptors which use cond_wait() 2020-11-18 00:03:00 -08:00
Robert Underwood 16de50895e honor Python2_EXECUTABLE and Python3_EXECUTABLE when they are passed to cmake
CMake's find_package(Python3) and find_package(Python2) packages have a PYTHON_EXECUTABLE, Python2_EXECUTABLE, and Python3_EXECUTABLE cmake variables which control which version of python is built against.  As far as I can tell, the rest of LLVM honors these variables. This can cause the build process to fail when  if the automatically selected version of Python can't run due to modifications of LD_LIBRARY_PATH when using spack.  The corresponding Spack issue is https://github.com/spack/spack/issues/19908.  The corresponding LLVM issue is 48180

I believe an appropriate fix is to add the variables to the list of PASSTHROUGH_VARIABLES in cmake/Modules/AddCompilerRT.cmake, and this fixed compilation errors for me.

This bug affects distributions like Gentoo and package managers like Spack which allow for combinatorial versioning.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D91536
2020-11-17 17:49:14 -06:00
Amy Huang bc98034040 [llvm-symbolizer] Add inline stack traces for Windows.
This adds inline stack frames for symbolizing on Windows.

Differential Revision: https://reviews.llvm.org/D88988
2020-11-17 13:19:13 -08:00
Vy Nguyen b16e4d3fc1 [sanitizers-test]add definition for %device_rm on android so it stops complaining
Differential Revision: https://reviews.llvm.org/D91570
2020-11-16 19:57:54 -05:00
Kostya Kortchinsky f0703cb1b2 [scudo][standalone] Correct min/max region indices
The original code to keep track of the minimum and maximum indices
of allocated 32-bit primary regions was sketchy at best.

`MinRegionIndex` & `MaxRegionIndex` were shared between all size
classes, and could (theoretically) have been updated concurrently. This
didn't materialize anywhere I could see, but still it's not proper.

This changes those min/max indices by making them class specific rather
than global: classes are locked when growing, so there is no
concurrency there. This also allows to simplify some of the 32-bit
release code, that now doesn't have to go through all the regions to
get the proper min/max. Iterate and unmap will no longer have access to
the global min/max, but they aren't used as much so this is fine.

Differential Revision: https://reviews.llvm.org/D91106
2020-11-16 12:43:10 -08:00
Jonathan Metzman 91703085f5 [fuzzer] Disable uncaught-exception on non-Win+undo bad fix
Test is failing on non-Windows platforms. Also undo speculative
fix since it causes failures on Windows.
2020-11-16 09:35:35 -08:00
Jonathan Metzman a3be128709 [fuzzer] Add allocator_may_return_null to uncaught-exception.test.
Speculative fix for failing unittest.
2020-11-16 09:13:25 -08:00
Matthew Malcomson 83ac18205e 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.

Differential Revision: https://reviews.llvm.org/D91344
2020-11-16 12:25:27 +00:00
Vitaly Buka 2ec25bae5a [NFC][tsan] Simplify call_pthread_cancel_with_cleanup 2020-11-16 04:21:27 -08:00
Vitaly Buka 7006738131 [sanitizer] Fix StackDepotPrint testing
Make test order agnostic as it can change with platform.
2020-11-16 03:07:29 -08:00
Vitaly Buka 581ebf44d2 [sanitizer] Fix setup of android-thread-properties-api 2020-11-14 23:23:10 -08:00
Vitaly Buka dd0b8b94d0 [sanitizer] Add timeouts for adb calls 2020-11-14 18:43:45 -08:00
Vitaly Buka e51631ca4c [sanitizer] Fix Android API level parsing on arm 2020-11-14 01:54:45 -08:00
Vitaly Buka c8f4e06b29
[sanitizer] Fix test on arm 32bit
Make test values suitable for PC alignment arithmetic used
in StackTrace::Print().
2020-11-14 00:02:29 -08:00
Roland McGrath 6ef07111a4 [scudo/standalone] Fix leak in ThreadedGlobalQuarantine test
This unit test code was using malloc without a corresponding free.
When the system malloc is not being overridden by the code under
test, it might an asan/lsan allocator that notices leaks.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D91472
2020-11-13 22:24:44 -08:00
Joe Pletcher f897e82bfd [fuzzer] Add Windows Visual C++ exception intercept
Adds a new option, `handle_winexcept` to try to intercept uncaught
Visual C++ exceptions on Windows. On Linux, such exceptions are handled
implicitly by `std::terminate()` raising `SIBABRT`. This option brings the
Windows behavior in line with Linux.

Unfortunately this exception code is intentionally undocumented, however
has remained stable for the last decade. More information can be found
here: https://devblogs.microsoft.com/oldnewthing/20100730-00/?p=13273

Reviewed By: morehouse, metzman

Differential Revision: https://reviews.llvm.org/D89755
2020-11-12 13:11:14 -08:00
Zhuojia Shen 0c0eeb78eb [builtins] Add support for single-precision-only-FPU ARM targets.
This patch enables building compiler-rt builtins for ARM targets that
only support single-precision floating point instructions (e.g., those
with -mfpu=fpv4-sp-d16).

This fixes PR42838

Differential Revision: https://reviews.llvm.org/D90698
2020-11-12 15:10:48 +00:00
Jianzhou Zhao 3597fba4e5 Add a simple stack trace printer for DFSan
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D91235
2020-11-11 19:00:59 +00:00
Nico Weber 6ab31eeb62 Revert "[hwasan] Fix Thread reuse."
This reverts commit e1eeb026e6.
Test fails: https://reviews.llvm.org/D91208#2388613
2020-11-11 09:56:21 -05:00
Evgenii Stepanov e1eeb026e6 [hwasan] Fix Thread reuse.
HwasanThreadList::DontNeedThread clobbers Thread::next_, breaking the
freelist. As a result, only the top of the freelist ever gets reused,
and the rest of it is lost.

Since the Thread object its associated ring buffer is only 8Kb, this is
typically only noticable in long running processes, such as fuzzers.

Fix the problem by switching from an intrusive linked list to a vector.

Differential Revision: https://reviews.llvm.org/D91208
2020-11-10 17:24:24 -08:00
Peter Collingbourne 0ae2ea8f83 hwasan: Bring back operator {new,delete} interceptors on Android.
It turns out that we can't remove the operator new and delete
interceptors on Android without breaking ABI, so bring them back
as forwards to the malloc and free functions.

Differential Revision: https://reviews.llvm.org/D91219
2020-11-10 16:05:24 -08:00
Ayshe Kuran 55ec2ba4bc Fix PR47973: Addressing integer division edge case with INT_MIN
Adjustment to integer division in int_div_impl.inc to avoid undefined behaviour that can occur as a result of having INT_MIN as one of the parameters.

Reviewed By: sepavloff

Differential Revision: https://reviews.llvm.org/D90218
2020-11-10 15:57:06 +00:00
Kostya Kortchinsky c955989046 [scudo][standalone] Simplify populateFreelist
`populateFreelist` was more complicated that it needed to be. We used
to call to `populateBatches` that would do some internal shuffling and
add pointers one by one to the batches, but ultimately this was not
needed. We can get rid of `populateBatches`, and do processing in
bulk. This doesn't necessarily make things faster as this is not on the
hot path, but it makes the function cleaner.

Additionally clean up a couple of items, like `UNLIKELY`s and setting
`Exhausted` to `false` which can't happen.

Differential Revision: https://reviews.llvm.org/D90700
2020-11-06 09:44:36 -08:00
Leonard Chan 71b0ee72bb [NFC] Add InitializePlatformCommonFlags for Fuchsia
https://reviews.llvm.org/D90811 is breaking our CI builders because
InitializePlatformCommonFlags is not defined. This just adds an empty definition.

This would've been caught on our upstream buildbot, but it's red at the moment
and most likely won't be sending out alert emails for recent failures.

Differential Revision: https://reviews.llvm.org/D90864
2020-11-05 10:39:51 -08:00
Peter Collingbourne ee7b629df2 scudo: Don't memset previously released cached pages in the secondary allocator.
There is no need to memset released pages because they are already
zero. On db845c, before:

BM_stdlib_malloc_free_default/131072      34562 ns        34547 ns        20258 bytes_per_second=3.53345G/s

after:

BM_stdlib_malloc_free_default/131072      29618 ns        29589 ns        23485 bytes_per_second=4.12548G/s

Differential Revision: https://reviews.llvm.org/D90814
2020-11-05 09:24:50 -08:00
Vy Nguyen 5cb378fab3 [sanitizers] Remove the test case involving `new int[0]`
Bionic doesn't acutally allocate any memory in this case, so there won't be a leak on Android.

Differential Revision: https://reviews.llvm.org/D90821
2020-11-05 09:16:45 -05:00
Adhemerval Zanella d025df3c1d [lsan] Disable some LSAN tests for arm-linux-gnueabi{hf}
The tests do not report the expected leak when issued with use_stack
or use_tls option equal to 0 on arm-linux-gnueabihf (ubuntu 18.04,
glibc 2.27).

This issue is being tracked by https://bugs.llvm.org/show_bug.cgi?id=48052
2020-11-05 08:32:53 -03:00
Adhemerval Zanella 0ad3cb8c26 [sanitizer] Assume getrandom might not be supported by the kernel
It was added on kernel 3.17.
2020-11-05 08:32:53 -03:00
Vitaly Buka 230efefdbc [NFC] Fix cpplint warnings 2020-11-04 22:56:08 -08:00
Vitaly Buka fbf7ccec02 [LSAN] Fix compilation error on MSVC 2020-11-04 22:32:49 -08:00
Vitaly Buka e62e0b1675 Revert "[LSAN] Fix preprocessor condition for MSVC"
Missread the error message. It was not the reason.

This reverts commit 2d041554d1.
2020-11-04 22:31:36 -08:00
Vitaly Buka 2d041554d1 [LSAN] Fix preprocessor condition for MSVC 2020-11-04 22:29:09 -08:00
Vitaly Buka 61e59ebfa6 [LSAN] Enabled only with __ANDROID_API__ >= 28
Code does not work as-is with emulated tls even if
lsan is disabled with runtime flag.
2020-11-04 22:18:05 -08:00
Vy Nguyen 9f9077d7d1 [sanitizers] Add missing definition
Fix breakages from https://reviews.llvm.org/D90811

http://lab.llvm.org:8011/#/builders/37/builds/471/steps/8/logs/stdio

Differential Revision: https://reviews.llvm.org/D90818
2020-11-05 00:24:36 -05:00
Vitaly Buka 234857f730 [sanitizer] Fix -fno-emulated-tls setup
COMPILER_RT_TEST_COMPILER_CFLAGS is a string
2020-11-04 19:23:28 -08:00
Vitaly Buka 6c164d6080 [NFC] Extract InitializePlatformCommonFlags
And move some Android specifi declarations from headers

Differential Revision: https://reviews.llvm.org/D90811
2020-11-04 19:23:28 -08:00
Vy Nguyen 796650d990 [lsan] Remove unnecessary elf-tls condition
Differential Revision: https://reviews.llvm.org/D90808
2020-11-04 22:21:40 -05:00
Vitaly Buka bbd4ebffd4 [sanitizer] Quick fix for non-Linux build 2020-11-04 18:35:04 -08:00
Vitaly Buka e15f424cf9 [LSAN] Fix CAN_SANITIZE_LEAKS on Android 2020-11-04 18:35:04 -08:00
Vy Nguyen 484ec6be30 Reland [lsan] Enable LSAN for Android
Reland: a2291a58bf.

New fixes for the breakages reported in D85927 include:
 - declare a weak decl for `dl_iterate_phdr`, because it does not exist on older  APIs
 - Do not enable leak-sanitizer if api_level is less than 29, because of  `ld.lld: error: undefined symbol: __aeabi_read_tp` for armv7, API level 16.
 - Put back the interceptor for `memalign` but still opt out intercepting `__libc_memalign` and `cfree` because both of these don't exist in Bionic.

Reviewed By: srhines, vitalybuka

Differential Revision: https://reviews.llvm.org/D89251
2020-11-04 18:00:25 -08:00
Vy Nguyen 678edfc1f3 [sanitizer] Allow preinit array on Android
Extracted from D89251
2020-11-04 16:46:10 -08:00
Vitaly Buka a52852f694 [NFC][sanitizer] Reformat some code
Extracted from D89251
2020-11-04 15:37:48 -08:00
Vitaly Buka 09ec07827b [sanitizer] Get Android API from --target
Depends on D90792.

Differential Revision: https://reviews.llvm.org/D90793
2020-11-04 14:05:44 -08:00
Vitaly Buka 7960ba3c49 [NFC][LSAN] Remove unused variable
Depends on D90791.

Differential Revision: https://reviews.llvm.org/D90792
2020-11-04 14:02:28 -08:00
Vitaly Buka 90e5b7b8be [NFC] Fix comment in test
Differential Revision: https://reviews.llvm.org/D90790
2020-11-04 14:02:28 -08:00
Vy Nguyen 6b67e22ea3 Fix breakage in D89615 (due to cmake version 3.16.5)
Differential Revision: https://reviews.llvm.org/D90764
2020-11-04 11:19:01 -05:00
Vy Nguyen 6855a60fd6 [NFC]Remove unused variable
Accidentally committed in D89615
2020-11-04 09:54:07 -05:00
Vy Nguyen aa662f61de Disable emulated-tls for compiler-rt+tests on Android if ELF_TLS is presence.
This is necessary for enabling LSAN on Android (D89251) because:
 - LSAN will have false negatives if run with emulated-tls.
 - Bionic ELF-TLS is not compatible with Gold (hence the need for LLD)

Differential Revision: https://reviews.llvm.org/D89615
2020-11-04 09:49:45 -05:00
Vitaly Buka 985a5d970a [NFC][UBSAN] Replace "count 0" with FileCheck
Unrelated system warnings may confuse "check 0"
2020-11-04 02:36:13 -08:00
Vitaly Buka e86205680e [sanitizer] Remove ANDROID_NDK_VERSION 2020-11-04 01:15:25 -08:00
Vitaly Buka 9c31e12609 [sanitizer] Remove -Wno-non-virtual-dtor
Warning should be fixed with d48f2d7c02
2020-11-04 00:51:33 -08:00
Vy Nguyen 707d69ff32 Use LLD for Android compiler-rt
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D90720
2020-11-04 00:51:18 -08:00
Petr Hosek e0b5e5a9d8 [compiler-rt] Use empty SuspendedThreadsList for Fuchsia
d48f2d7 made destructor of SuspendedThreadsList protected, so we need
an empty subclass to pass to the callback now.

Differential Revision: https://reviews.llvm.org/D90695
2020-11-03 11:34:13 -08:00
Vitaly Buka 4cd0927306 [memprof] Don't protect destructor in final 2020-11-03 11:33:33 -08:00
etiotto e1af54296c [compiler-rt][profile][AIX]: Enable compiler-rt profile build on AIX
This patch adds support for building the compiler-rt profile library on AIX.

Reviewed by: phosek

Differential Revision: https://reviews.llvm.org/D90619
2020-11-03 11:46:21 -05:00
Martin Storsjö 076d351e8b [compiler-rt] [ubsan] Use the itanium type info lookup for mingw targets
Differential Revision: https://reviews.llvm.org/D90571
2020-11-03 09:59:08 +02:00
Vitaly Buka d48f2d7c02 [sanitizer] Cleanup -Wnon-virtual-dtor warnings 2020-11-02 20:30:50 -08:00
Vitaly Buka 8b37a4e6ca [sanitizer] Make destructors protected 2020-11-02 18:00:43 -08:00
Alex Lorenz 701456b523 [darwin] add support for __isPlatformVersionAtLeast check for if (@available)
The __isPlatformVersionAtLeast routine is an implementation of `if (@available)` check
that uses the _availability_version_check API on Darwin that's supported on
macOS 10.15, iOS 13, tvOS 13 and watchOS 6.

Differential Revision: https://reviews.llvm.org/D90367
2020-11-02 16:28:09 -08:00
Kostya Kortchinsky b3420adf5a [scudo][standalone] Code tidying (NFC)
- we have clutter-reducing helpers for relaxed atomics that were barely
  used, use them everywhere we can
- clang-format everything with a recent version

Differential Revision: https://reviews.llvm.org/D90649
2020-11-02 16:00:31 -08:00
Kostya Kortchinsky 98fe39df93 [GWP-ASan] Stub out backtrace/signal functions on Fuchsia
The initial version of GWP-ASan on Fuchsia doesn't support crash and
signal handlers, so this just adds empty stubs to be able to compile
the project on the platform.

Differential Revision: https://reviews.llvm.org/D90537
2020-11-02 13:49:50 -08:00
Teresa Johnson 7f32ddc99b [MemProf] Reenable test with fix for bot failures
The issue was unexpected macro expansion when the bot's test output
directory contained a token matching a build system macro (e.g.
"linux"). Switch to using a hardcoded path, which is invalid but is
sufficient for ensuring that the path is passed down to the runtime.

Differential Revision: https://reviews.llvm.org/D90466
2020-11-02 09:00:04 -08:00
Jim Lin 1bd433bdff [compiler-rt][NFC] Fix typo in comment 2020-11-02 13:05:03 +08:00
Teresa Johnson 0949f96dc6 [MemProf] Pass down memory profile name with optional path from clang
Similar to -fprofile-generate=, add -fmemory-profile= which takes a
directory path. This is passed down to LLVM via a new module flag
metadata. LLVM in turn provides this name to the runtime via the new
__memprof_profile_filename variable.

Additionally, always pass a default filename (in $cwd if a directory
name is not specified vi the = form of the option). This is also
consistent with the behavior of the PGO instrumentation. Since the
memory profiles will generally be fairly large, it doesn't make sense to
dump them to stderr. Also, importantly, the memory profiles will
eventually be dumped in a compact binary format, which is another reason
why it does not make sense to send these to stderr by default.

Change the existing memprof tests to specify log_path=stderr when that
was being relied on.

Depends on D89086.

Differential Revision: https://reviews.llvm.org/D89087
2020-11-01 17:38:23 -08:00
Kostya Kortchinsky 63ad087656 [GWP-ASan] Fuchsia specific mapping & utilities functions
This CL introduces the Fuchsia versions of the existing platform
specific functions.

For Fuchsia, we need to track the VMAR (https://fuchsia.dev/fuchsia-src/reference/kernel_objects/vm_address_region)
of the Guarded Pool mapping, and for this purpose I added some platform
specific data structure that remains empty on POSIX platforms.

`getThreadID` is not super useful for Fuchsia so it's just left as a
stub for now.

While testing the changes in my Fuchsia tree, I realized that
`guarded_pool_allocator_tls.h` should have closed the namespace before
including `GWP_ASAN_PLATFORM_TLS_HEADER`, otherwise drama ensues.

This was tested in g3, upstream LLVM, and Fuchsia (with local changes).

Differential Revision: https://reviews.llvm.org/D90483
2020-10-31 10:22:58 -07:00
Vitaly Buka f9dd0166f1 [sanitizer] Disabled 2 tests on Android
They block bot upgrade to NDK 21.
2020-10-31 03:56:52 -07:00
Petr Hosek 11efd002b1 [CMake] Avoid accidental C++ standard library dependency in sanitizers
While sanitizers don't use C++ standard library, we could still end
up accidentally including or linking it just by the virtue of using
the C++ compiler. Pass -nostdinc++ and -nostdlib++ to avoid these
accidental dependencies.

Reviewed By: smeenai, vitalybuka

Differential Revision: https://reviews.llvm.org/D88922
2020-10-31 02:37:38 -07:00
Arthur Eubanks 5c31b8b94f Revert "Use uint64_t for branch weights instead of uint32_t"
This reverts commit 10f2a0d662.

More uint64_t overflows.
2020-10-31 00:25:32 -07:00
Petr Hosek d11710dae6 [NFC][CMake] Move some COMPILER_RT variables setup
Part of D88922
2020-10-30 20:09:50 -07:00
Petr Hosek 59d5031591 [CMake] Add -fno-rtti into tsan unittests
And some other NFC parts of D88922
2020-10-30 20:03:38 -07:00
Petr Hosek 6db314e86b [CMake] Remove cxx-headers from runtime deps
Part of D88922
2020-10-30 20:03:38 -07:00
Petr Hosek ed4fbe6d9c [CMake] Replace ctime with time.h in memprof
Part of D88922
2020-10-30 20:02:53 -07:00
Peter Collingbourne 3859fc653f AArch64: Switch to x20 as the shadow base register for outlined HWASan checks.
From a code size perspective it turns out to be better to use a
callee-saved register to pass the shadow base. For non-leaf functions
it avoids the need to reload the shadow base into x9 after each
function call, at the cost of an additional stack slot to save the
caller's x20. But with x9 there is also a stack size cost, either
as a result of copying x9 to a callee-saved register across calls or
by spilling it to stack, so for the non-leaf functions the change to
stack usage is largely neutral.

It is also code size (and stack size) neutral for many leaf functions.
Although they now need to save/restore x20 this can typically be
combined via LDP/STP into the x30 save/restore. In the case where
the function needs callee-saved registers or stack spills we end up
needing, on average, 8 more bytes of stack and 1 more instruction
but given the improvements to other functions this seems like the
right tradeoff.

Unfortunately we cannot change the register for the v1 (non short
granules) check because the runtime assumes that the shadow base
register is stored in x9, so the v1 check still uses x9.

Aside from that there is no change to the ABI because the choice
of shadow base register is a contract between the caller and the
outlined check function, both of which are compiler generated. We do
need to rename the v2 check functions though because the functions
are deduplicated based on their names, not on their contents, and we
need to make sure that when object files from old and new compilers
are linked together we don't end up with a function that uses x9
calling an outlined check that uses x20 or vice versa.

With this change code size of /system/lib64/*.so in an Android build
with HWASan goes from 200066976 bytes to 194085912 bytes, or a 3%
decrease.

Differential Revision: https://reviews.llvm.org/D90422
2020-10-30 12:51:30 -07:00
Dmitry Vyukov 00da38ce2d tsan: add Go race detector support for macOS/ARM64
Add Go race detector support for macOS/ARM64. The Go counterpart is https://golang.org/cl/266373 .

Author: cherry (Cherry Zhang)
Reviewed-in: https://reviews.llvm.org/D90435
2020-10-30 19:42:48 +01:00
Arthur Eubanks 10f2a0d662 Use uint64_t for branch weights instead of uint32_t
CallInst::updateProfWeight() creates branch_weights with i64 instead of i32.
To be more consistent everywhere and remove lots of casts from uint64_t
to uint32_t, use i64 for branch_weights.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D88609
2020-10-30 10:03:46 -07:00
Louis Dionne 75a1f52c1a [compiler-rt] Don't include libc++ headers from the source tree in MSAN
We shouldn't be including the libc++ headers from the source tree directly, since those headers are not configured (i.e. they don't use the __config_site) header like they should, which could mean up to ABI differences

Reviewed By: vitalybuka, phosek, ldionne

Differential Revision: https://reviews.llvm.org/D89915
2020-10-30 02:36:02 -07:00
Dmitry Vyukov 26c1ced41c [sanitizer] Use __atomic_load/store() built-ins for generic 32-bit targets
Simplifies the code and fixes the build on SPARC.
See discussion in: http://lists.llvm.org/pipermail/llvm-dev/2020-October/145937.html

Author: glaubitz (John Paul Adrian Glaubitz)
Reviewed-in: https://reviews.llvm.org/D89940
2020-10-30 09:17:46 +01:00
Kostya Kortchinsky 3591721ada [GWP-ASan] Add mutexes for Fuchsia
Mitch expressed a preference to not have `#ifdef`s in platform agnostic
code, this change tries to accomodate this.

I am not attached to the method this CL proposes, so if anyone has a
suggestion, I am open.

We move the platform specific member of the mutex into its own platform
specific class that the main `Mutex` class inherits from. Functions are
implemented in their respective platform specific compilation units.

For Fuchsia, we use the sync APIs, as those are also the ones being
used in Scudo.

Differential Revision: https://reviews.llvm.org/D90351
2020-10-29 15:51:13 -07:00
Adhemerval Zanella f93c2b64ed [sanitizer] Disable ASLR for release_shadow_space
On aarch64 with kernel 4.12.13 the test sporadically fails with

RSS at start: 1564, after mmap: 103964, after mmap+set label: 308768, \
after fixed map: 206368, after another mmap+set label: 308768, after \
munmap: 206368
release_shadow_space.c.tmp: [...]/release_shadow_space.c:80: int \
main(int, char **): Assertion `after_fixed_mmap <= before + delta' failed.

It seems on some executions the memory is not fully released, even
after munmap.  And it also seems that ASLR is hurting it by adding
some fragmentation, by disabling it I could not reproduce the issue
in multiple runs.
2020-10-29 16:09:03 -03:00
Teresa Johnson d124ac0c22 [MemProf] Temporarily disable test failing on a couple bots
I finally see why this test is failing (on now 2 bots). Somehow the path
name is getting messed up, and the "linux" converted to "1". I suspect
there is something in the environment causing the macro expansion in the
test to get messed up:

http://lab.llvm.org:8011/#/builders/112/builds/555/steps/5/logs/FAIL__MemProfiler-x86_64-linux__log_path_test_cpp
http://lab.llvm.org:8011/#/builders/37/builds/275/steps/31/logs/stdio

On the avr bot:
-DPROFILE_NAME_VAR="/home/buildbot/llvm-avr-linux/llvm-avr-linux/stage1/projects/compiler-rt/test/memprof/X86_64LinuxConfig/TestCases/Output/log_path_test.cpp.tmp.log2"

after macros expansions becomes:
/home/buildbot/llvm-avr-1/llvm-avr-1/stage1/projects/compiler-rt/test/memprof/X86_64LinuxConfig/TestCases/Output/log_path_test.cpp.tmp.log2

Similar (s/linux/1/) on the other bot.

Disable it while I investigate
2020-10-29 11:26:21 -07:00
Jody Sankey 5a3077f3a7 [sanitizer][fuchsia] Avoid deprecated syscall.
The zx_clock_get syscall on Fuchsia is deprecated - ref
https://fuchsia.dev/fuchsia-src/reference/syscalls/clock_get
This changes to the recommended replacement; calling zx_clock_read on
the userspace UTC clock.

Reviewed By: mcgrathr, phosek

Differential Revision: https://reviews.llvm.org/D90169
2020-10-29 10:51:59 -07:00
Teresa Johnson 240b421738 [MemProf] Augment test to debug avr bot failure
After 81f7b96ed0, I can see that the
reason this test is failing on llvm-avr-linux is that it doesn't think
the directory exists (error comes during file open for write command).
Not sure why since this is the main test Output directory and we created
a different file there earlier in the test from the same file open
invocation. Print directory contents in an attempt to debug.
2020-10-29 10:04:43 -07:00
Teresa Johnson 81f7b96ed0 [sanitizer] Print errno for report file open failure
To help debug failures, specifically the llvm-avr-linux bot failure from
5c20d7db9f2791367b9311130eb44afecb16829c:

http://lab.llvm.org:8011/#/builders/112/builds/407/steps/5/logs/FAIL__MemProfiler-x86_64-linux-dynamic__log_path_t

Also re-enable the failing test which I temporarily disabled, to
see if this change will help identify why that particular log file can't
be opened for write on that bot (when another log file in the same
directory could earlier in the test).

Differential Revision: https://reviews.llvm.org/D90120
2020-10-29 08:47:30 -07:00
Vitaly Buka 20a3931f8f Revert "[NFC][TSAN] Logs to debug test script on bot"
Done with debugging. Script didn't work because of low limit on open
files on the bot.

This reverts commit 220293da53.
2020-10-29 01:11:16 -07:00
Cameron Finucane 6777919d5a [libFuzzer] Remove InterruptHandler from Fuchsia implementation
As implemented, the `InterruptHandler` thread was spinning trying to
`select()` on a null "stdin", wasting a significant amount of CPU for no
benefit. As Fuchsia does not have a native concept of stdin (or POSIX
signals), this commit simply removes this feature entirely.

Reviewed By: aarongreen

Differential Revision: https://reviews.llvm.org/D89266
2020-10-29 00:02:31 -07:00
Peter Collingbourne 864b3a336b Reland "hwasan: Disable operator {new,delete} interceptors when interceptors are disabled."
There was a discrepancy in the gn build which is now fixed.

Differential Revision: https://reviews.llvm.org/D89827
2020-10-28 15:42:23 -07:00
Kostya Kortchinsky 90678f65ae [GWP-ASan] Abstract the thread local variables access
In a similar fashion to D87420 for Scudo, this CL introduces a way to
get thread local variables via a platform-specific reserved TLS slot,
since Fuchsia doesn't support ELF TLS from the libc itself.

If needing to use this, a platform will have to define
`GWP_ASAN_HAS_PLATFORM_TLS_SLOT` and provide `gwp_asan_platform_tls_slot.h`
which will define a `uint64_t *getPlatformGwpAsanTlsSlot()` function
that will return the TLS word of storage.

I snuck in a couple of cleanup items as well, moving some static
functions to anonymous namespace for consistency.

Differential Revision: https://reviews.llvm.org/D90195
2020-10-28 15:06:38 -07:00
Vitaly Buka 220293da53 [NFC][TSAN] Logs to debug test script on bot 2020-10-28 11:40:16 -07:00
Ulrich Weigand a998cae021 [compiler-rt][SystemZ] Skip fuzzer/full-coverage.test
This test is currently marked as XFAIL on s390x, but it is randomly
passing, causing build bot issues.  Setting as UNSUPPORTED for now.
2020-10-28 16:39:46 +01:00
Vitaly Buka d1b9c0fd1d [NFC][Sanitizer] format sanitizer_platform_interceptors.h 2020-10-28 00:39:58 -07:00
Vitaly Buka 48bc38f254 [NFC][Asan] Fix cpplint warning in test 2020-10-28 00:38:50 -07:00
Vitaly Buka 2a6b156311 [NFC][Asan] Fix cpplint warnings in tests 2020-10-28 00:32:44 -07:00
Vitaly Buka 8ecf1c4969 [NFC][UBSAN] Try to re-enable tests on IOS
Looks like the reason they were disabled is the same as for Android
and it's fixed by 776a15d8ae
2020-10-27 23:49:31 -07:00
Vitaly Buka 58828f6a93 [NFC][UBSAN] Remove XFAIL from fixed tests 2020-10-27 23:43:50 -07:00
Nico Weber 2a4e704c92 Revert "Use uint64_t for branch weights instead of uint32_t"
This reverts commit e5766f25c6.
Makes clang assert when building Chromium, see https://crbug.com/1142813
for a repro.
2020-10-27 09:26:21 -04:00
Alex Richardson 89031cffd1 Fix sancov.py when objdump is llvm-objdump
The sanitizer-coverage.cpp test case was always failing for me. It turns
out the reason for this is that I was building with
-DLLVM_INSTALL_BINUTILS_SYMLINKS=ON and sancov.py's grep regex does not
handle llvm-objdump's disassembly format (hex immediates have a leading "0x").
While touching those lines also change them to use raw string literals since
invalid escape sequnces will become an error in future python versions.
Also simplify the code by using subprocess.check_output() instead of Popen().
This also works with python2.

Fixes https://bugs.llvm.org/show_bug.cgi?id=44504

Reviewed By: #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D89648
2020-10-27 12:16:46 +00:00
Arthur Eubanks e5766f25c6 Use uint64_t for branch weights instead of uint32_t
CallInst::updateProfWeight() creates branch_weights with i64 instead of i32.
To be more consistent everywhere and remove lots of casts from uint64_t
to uint32_t, use i64 for branch_weights.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D88609
2020-10-26 20:24:04 -07:00
Vedant Kumar a77a739abc [profile] Suppress spurious 'expected profile to require unlock' warning
In %c (continuous sync) mode, avoid attempting to unlock an
already-unlocked profile.

The profile is only locked when profile merging is enabled.
2020-10-26 16:25:08 -07:00
Teresa Johnson ba71a0746f [MemProf] Decouple memprof build from COMPILER_RT_BUILD_SANITIZERS
The MemProf compiler-rt support relies on some of the support only built
when COMPILER_RT_BUILD_SANITIZERS was enabled. This showed up in some
initial bot failures, and I addressed those by making the memprof
runtime build also conditional on COMPILER_RT_BUILD_SANITIZERS
(3ed77ecd0a). However, this resulted in
another inconsistency with how the tests were set up that was hit by
Chromium:
  https://bugs.chromium.org/p/chromium/issues/detail?id=1142191

Undo the original bot fix and address this with a more comprehensive fix
that enables memprof to be built even when COMPILER_RT_BUILD_SANITIZERS
is disabled, by also building the necessary pieces under
COMPILER_RT_BUILD_MEMPROF.

Tested by configuring with a similar command as to what was used in the
failing Chromium configure. I reproduced the Chromium failure, as well
as the original bot failure I tried to fix in
3ed77ecd0a, with that fix reverted.
Confirmed it now works.

Differential Revision: https://reviews.llvm.org/D90190
2020-10-26 13:52:50 -07:00
Kostya Kortchinsky 612e02ee8c [GWP-ASan] Refactor memory mapping functions
In preparation for Fuchsia support, this CL refactors the memory
mapping functions.

The new functions are as follows:
- for Freeslots and Metadata:
  `void *map(size_t Size, const char *Name) const;`
  `void unmap(void *Ptr, size_t Size) const;`
- for the Pool:
  `void *reservePool(size_t Size);`
  `void commitPool(void *Ptr, size_t Size) const;`
  `void decommitPool(void *Ptr, size_t Size) const;`
  `void unreservePool();`
  Note that those don't need a `Name` parameter as those are fixed per
  function. `{reserve,unreserve}Pool` are not `const` because they will
  modify platform specific class member on Fuchsia.

I added a plethora of `assert()` as the initial code was not enforcing
page alignment for sizes and addresses, which caused problem in the
initial Fuchsia draft. All sizes should now be properly rounded up to
a page.

Differential Revision: https://reviews.llvm.org/D89993
2020-10-26 13:32:08 -07:00
Dmitry Vyukov 5cad535ccf tsan: add mips64 support in lib/tsan/go/buildgo.sh
Enable mips64 support in buildgo.sh.

Author: mzh (Meng Zhuo)
Reviewed-in: https://reviews.llvm.org/D90130
2020-10-26 12:19:52 +01:00
Teresa Johnson 13c62ce99a [MemProf] Temporarily disable part of test
Disable the part of this test that started failing only on the
llvm-avr-linux bot after 5c20d7db9f.
Unfortunately, "XFAIL: avr" does not work. Still in the process of
trying to figure out how to debug.
2020-10-24 23:07:34 -07:00
Drew Fisher 1e09dbb6a9 [asan] Fix stack-use-after-free checks on non-main thread on Fuchsia
While some platforms call `AsanThread::Init()` from the context of the
thread being started, others (like Fuchsia) call `AsanThread::Init()`
from the context of the thread spawning a child.  Since
`AsyncSignalSafeLazyInitFakeStack` writes to a thread-local, we need to
avoid calling it from the spawning thread on Fuchsia.  Skipping the call
here on Fuchsia is fine; it'll get called from the new thread lazily on first
attempted access.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D89607
2020-10-24 14:29:32 -07:00
Drew Fisher 29480c6c74 [asan][fuchsia] set current thread before reading thread state
When enabling stack use-after-free detection, we discovered that we read
the thread ID on the main thread while it is still set to 2^24-1.

This patch moves our call to AsanThread::Init() out of CreateAsanThread,
so that we can call SetCurrentThread first on the main thread.

Reviewed By: mcgrathr

Differential Revision: https://reviews.llvm.org/D89606
2020-10-24 14:23:09 -07:00
Nico Weber 6f9d84bb26 Revert "hwasan: Disable operator {new,delete} interceptors when interceptors are disabled."
This reverts commit fa66bcf4bc.
Seems to break tests, see https://reviews.llvm.org/D89827#2351930
2020-10-24 15:04:22 -04:00
Benjamin Kramer 39a0d6889d [X86] Add a stub for Intel's alderlake.
No scheduling, no autodetection.
2020-10-24 19:01:22 +02:00
Vitaly Buka 21d64c32ec [NFC][UBSAN] Refine CHECK pattern in test
As-is it was failed by unrelated linker warning with filename in the
output.
2020-10-23 21:11:03 -07:00
Peter Collingbourne fa66bcf4bc hwasan: Disable operator {new,delete} interceptors when interceptors are disabled.
Differential Revision: https://reviews.llvm.org/D89827
2020-10-23 21:03:47 -07:00
Vitaly Buka 776a15d8ae [NFC][UBSAN] Avoid "not FileCheck" in tests
It's not clear if "not FileCheck" succeeded because
input is empty or because input does not match "CHECK:"
pattern.
2020-10-23 19:13:01 -07:00
Max Moroz dc62d5ec97 [libFuzzer] Added -print_full_coverage flag.
-print_full_coverage=1 produces a detailed branch coverage dump when run on a single file.
Uses same infrastructure as -print_coverage flag, but prints all branches (regardless of coverage status) in an easy-to-parse format.
Usage: For internal use with machine learning fuzzing models which require detailed coverage information on seed files to generate mutations.

Differential Revision: https://reviews.llvm.org/D85928
2020-10-23 16:05:54 -07:00
Teresa Johnson eeba325b12 [MemProf] Attempt to debug avr bot failure
Reverts the XFAIL added in b67a2aef8a,
which had no effect.

Adjust the test to make sure all output is dumped to stderr, so that
hopefully I can get a better idea of where/why this is failing.

Remove some redundant checking while here.
2020-10-23 16:00:08 -07:00
Amy Huang 3827effe3a [Asan][Windows] Fix asan stack traces on Windows.
While implementing inline stack traces on Windows I noticed that the stack
traces in many asan tests included an inlined frame that shouldn't be there.

Currently we get the PC and then do a stack unwind and use the PC to
find the beginning of the stack trace.
In the failing tests the first thing in the stack trace is inside an inline
call site that shouldn't be in the stack trace, so replace it with the PC.

Differential Revision: https://reviews.llvm.org/D89996
2020-10-23 13:14:14 -07:00
Teresa Johnson b67a2aef8a [MemProf] XFAIL test on avr until issue can be debugged
For unknown reasons, this test started failing only on the
llvm-avr-linux bot after 5c20d7db9f2791367b9311130eb44afecb16829c:
http://lab.llvm.org:8011/#/builders/112/builds/365

The error message is not helpful, and I have an email out to the bot
owner to help with debugging. XFAIL it on avr for now.
2020-10-23 11:32:11 -07:00
Alex Orlov 9df832d1c3 These compiler-rt tests should be UNSUPPORTED instead of XFAIL.
These compiler-rt tests should be UNSUPPORTED instead of XFAIL, which seems to be the real intent of the authors.

Reviewed By: vvereschaka

Differential Revision: https://reviews.llvm.org/D89840
2020-10-23 20:57:18 +04:00
Kostya Kortchinsky 3580a45014 [GWP-ASan] Move random-related code in the allocator (redo)
This is a redo of D89908, which triggered some `-Werror=conversion`
errors with GCC due to assignments to the 31-bit variable.

This CL adds to the original one a 31-bit mask variable that is used
at every assignment to silence the warning.

Differential Revision: https://reviews.llvm.org/D89984
2020-10-22 13:56:24 -07:00
Nikita Popov 04e42f6254 Revert "[GWP-ASan] Move random-related code in the allocator"
This reverts commit 9903b0586c.

Causes build failures (on GCC 10.2) with the following error:

In file included from /home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/combined.h:29,
                 from /home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/allocator_config.h:12,
                 from /home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_cpp.cpp:14:
/home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/../../gwp_asan/guarded_pool_allocator.h: In member function ‘bool gwp_asan::GuardedPoolAllocator::shouldSample()’:
/home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/../../gwp_asan/guarded_pool_allocator.h:82:69: error: conversion from ‘uint32_t’ {aka ‘unsigned int’} to ‘unsigned int:31’ may change value [-Werror=conversion]
   82 |           (getRandomUnsigned32() % (AdjustedSampleRatePlusOne - 1)) + 1;
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
2020-10-22 21:56:37 +02:00
Kostya Kortchinsky 9903b0586c [GWP-ASan] Move random-related code in the allocator
We need to have all thread specific data packed into a single `uintptr_t`
for the upcoming Fuchsia support. We can move the `RandomState` into the
`ThreadLocalPackedVariables`, reducing the size of `NextSampleCounter`
to 31 bits (or we could reduce `RandomState` to 31 bits).

We move `getRandomUnsigned32` into the platform agnostic part of the
class, and `initPRNG` in the platform specific part.

`ScopedBoolean` is replaced by actual assignments since non-const
references to bitfields are prohibited.

`random.{h,cpp}` are removed.

Differential Revision: https://reviews.llvm.org/D89908
2020-10-22 11:52:08 -07:00
Teresa Johnson 5c20d7db9f [MemProf] Allow the binary to specify the profile output filename
This will allow the output directory to be specified by a build time
option, similar to the directory specified for regular PGO profiles via
-fprofile-generate=. The memory profiling instrumentation pass will
set up the variable. This is the same mechanism used by the PGO
instrumentation and runtime.

Depends on D87120 and D89629.

Differential Revision: https://reviews.llvm.org/D89086
2020-10-22 08:30:19 -07:00
Vy Nguyen e2858997ab Do not intercept __libc_memalign and cfree on Android because neither of these exists in Bionic.
Differential Revision: https://reviews.llvm.org/D89616
2020-10-21 23:21:45 -04:00
Teresa Johnson 1bb68c9b18 [sanitizer] Allow log_path to distinguish default from explicit stderr
Split out of D89086 as suggested.

Change the default of the log_path flag to nullptr, and the code
consuming that flag (ReportFile::SetReportPath), to treat nullptr as
stderr (so no change to the behavior of existing users). This allows
code to distinguish between the log_path being specified explicitly as
stderr vs the default.

This is so the flag can be used to override the new report path variable
that will be encoded in the binary for memprof for runtime testing.

Differential Revision: https://reviews.llvm.org/D89629
2020-10-21 19:32:36 -07:00
Vy Nguyen 3b3aef198b [sanitizer]Update tests to be compatible with Android.
Split off from D89251

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D89884
2020-10-21 17:16:54 -07:00
Teresa Johnson 31bc55d602 [sanitizer] Convert PrintModuleMap to DumpProcessMap
As discussed in the review for D87120 (specifically at
https://reviews.llvm.org/D87120#inline-831939), clean up PrintModuleMap
and DumpProcessMap usage differences. The former is only implemented for
Mac OSX, whereas the latter is implemented for all OSes. The former is
called by asan and tsan, and the latter by hwasan and now memprof, under
the same option. Simply rename the PrintModuleMap implementation for Mac
to DumpProcessMap, remove other empty PrintModuleMap implementations,
and convert asan/tsan to new name. The existing posix DumpProcessMap is
disabled for SANITIZER_MAC.

Differential Revision: https://reviews.llvm.org/D89630
2020-10-21 12:46:49 -07:00
Luís Marques 58f6b16c49 [compiler-rt][builtins][RISCV] Always include __mul[sd]i3 builtin definitions
The RISC-V implementations of the `__mulsi3`, `__muldi3` builtins were
conditionally compiling the actual function definitions depending on whether
the M extension was present or not. This caused Compiler-RT testing failures
for RISC-V targets with the M extension, as when these sources were included
the `librt_has_mul*i3` features were still being defined. These `librt_has_*`
definitions are used to conditionally run the respective tests. Since the
actual functions were not being compiled-in, the generic test for `__muldi3`
would fail. This patch makes these implementations follow the normal
Compiler-RT convention of always including the definition, and conditionally
running the respective tests by using the lit conditional
`REQUIRES: librt_has_*`.

Since the `mulsi3_test.c` wasn't actually RISC-V-specific, this patch also
moves it out of the `riscv` directory. It now only depends on
`librt_has_mulsi3` to run.

Differential Revision: https://reviews.llvm.org/D86457
2020-10-21 09:49:03 +01:00
Vitaly Buka 60913ebcbc [NFC][LSAN] Use InitializeCommonFlags in LSAN 2020-10-21 01:41:52 -07:00
Kostya Kortchinsky be8e4de724 [GWP-ASan] Rework utilities (NFC)
Few changes wrt utilities:
- split `Check` into a platform agnostic condition test and a platform
  specific termination, for which we introduce the function `die`.
- add a platform agnostic `utilities.cpp` that gets the allocation
  alignment functions original in the platform specific file, as they
  are reusable by all platforms.

Differential Revision: https://reviews.llvm.org/D89811
2020-10-20 16:04:21 -07:00
Vitaly Buka 343410d1cc [LSAN][NFC] Reformat test 2020-10-20 14:16:27 -07:00
Evgenii Stepanov b3ccfa1e0c [hwasan] Increase max allocation size to 1Tb.
2Gb is unreasonably low on devices with 12Gb RAM and more.

Differential Revision: https://reviews.llvm.org/D89750
2020-10-20 14:01:48 -07:00
Martin Liska ad2be02a83 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.

Differential Revision: https://reviews.llvm.org/D89552
2020-10-20 19:28:12 +02:00
Jianzhou Zhao 91dc545bf2 Set Huge Page mode on shadow regions based on no_huge_pages_for_shadow
It turned out that at dynamic shared library mode, the memory access
pattern can increase memory footprint significantly on OS when transparent
hugepages (THP) are enabled. This could cause >70x memory overhead than
running a static linked binary. For example, a static binary with RSS
overhead 300M can use > 23G RSS if it is built dynamically.
/proc/../smaps shows in 6204552 kB RSS 6141952 kB relates to
AnonHugePages.

Also such a high RSS happens in some rate: around 25% runs may use > 23G RSS, the
rest uses in between 6-23G. I guess this may relate to how user memory
is allocated and distributted across huge pages.

THP is a trade-off between time and space. We have a flag
no_huge_pages_for_shadow for sanitizer. It is true by default but DFSan
did not follow this. Depending on if a target is built statically or
dynamically, maybe Clang can set no_huge_pages_for_shadow accordingly
after this change. But it still seems fine to follow the default setting of
no_huge_pages_for_shadow. If time is an issue, and users are fine with
high RSS, this flag can be set to false selectively.
2020-10-20 16:50:59 +00:00
Jianzhou Zhao cc07fbe37d Release pages to OS when setting 0 label
This is a follow up patch of https://reviews.llvm.org/D88755.

When set 0 label for an address range, we can release pages within the
corresponding shadow address range to OS, and set only addresses outside
the pages to be 0.

Reviewed-by: morehouse, eugenis
Differential Revision: https://reviews.llvm.org/D89199
2020-10-20 16:22:11 +00:00
Luís Marques fc3f9dfad3 [compiler-rt][builtins] Add tests for atomic builtins support functions
Adds some simple sanity checks that the support functions for the atomic
builtins do the right thing. This doesn't test concurrency and memory model
issues.

Differential Revision: https://reviews.llvm.org/D86278
2020-10-20 12:08:57 +01:00
David Carlier 53065c543f [Sanitizers] Remove OpenBSD support (new attempt)
- Fixing VS compiler and other cases settings this time.

Reviewers: dmajor, hans

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D89759
2020-10-20 11:16:09 +01:00
Vitaly Buka f97ca48b1c [sanitizer] Fix compilation on older systems
Fixes https://bugs.llvm.org/show_bug.cgi?id=47896
2020-10-19 22:45:51 -07:00
Kostya Kortchinsky ae9d040028 [GWP-ASan] Cleanup (NFC)
Cleaning up some of the GWP-ASan code base:
- lots of headers didn't have the correct file name
- adding `#ifdef` guard to `utilities.h`
- correcting an `#ifdef` guard based on actual file name
- removing an extra `;`
- clang-format'ing the code (`-style=llvm`)

Differential Revision: https://reviews.llvm.org/D89721
2020-10-19 18:13:11 -07:00
Evgenii Stepanov 7ecd60bb70 Revert "[Sanitizers] Remove OpenBSD support" + 1
Revert "Fix compiler-rt build on Windows after D89640"

This reverts commit a7acee89d6.
This reverts commit d09b08919c.

Reason: breaks Linux / x86_64 build.
2020-10-19 16:11:21 -07:00
Luís Marques 7ddd354d47 [RISCV][ASAN] Fix TLS offsets
Fix a RISC-V ASan test failure: `TestCases/Linux/static_tls.cpp`.

Differential Revision: https://reviews.llvm.org/D89244
2020-10-19 13:41:50 +01:00
Hans Wennborg a7acee89d6 Fix compiler-rt build on Windows after D89640
It moved the cmake code from the else-branch to the if-branch
but forgot to flip the condition.
2020-10-19 14:39:37 +02:00
Dávid Bolvanský 2554619adb [ASAN] Restore and adjust tests
There are optimized out with -fno-builtin
2020-10-18 17:28:05 +02:00
David Carlier d09b08919c [Sanitizers] Remove OpenBSD support
- Removing unused and unusable code.

Reviewers: krytarowski

Reviewed By: krytarowski

Differential Revision: https://reviews.llvm.org/D89640
2020-10-18 14:57:07 +01:00
Dávid Bolvanský 65e94cc946 [InferAttrs] Add argmemonly attribute to string libcalls
Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D89602
2020-10-18 01:33:26 +02:00
Luís Marques b7ff218f1c [RISCV][ASAN] Fix passing XFAIL tests
These tests pass for RV64 Linux, but they are marked as XFAIL. This patch
fixes that.

Differential Revision: https://reviews.llvm.org/D89299
2020-10-17 16:55:11 +01:00
Richard Smith efd02c1548 Fix accidental use of VLAs that causes these tests to fail after Clang
commit 552c6c2328.
2020-10-16 15:14:28 -07:00
Teresa Johnson 3ed77ecd0a [MemProf] Don't build memprof if sanitizer not being built
This should fix a couple of debian bot failures:
http://lab.llvm.org:8011/#builders/14/builds/380
http://lab.llvm.org:8011/#builders/109/builds/533

They disable building of the sanitizer, which memprof relies on. So
disable building of memprof in that case.
2020-10-16 10:47:37 -07:00
Teresa Johnson 3d4bba302d [MemProf] Memory profiling runtime support
See RFC for background:
http://lists.llvm.org/pipermail/llvm-dev/2020-June/142744.html

Follow on companion to the clang/llvm instrumentation support in D85948
and committed earlier.

This patch adds the compiler-rt runtime support for the memory
profiling.

Note that much of this support was cloned from asan (and then greatly
simplified and renamed). For example the interactions with the
sanitizer_common allocators, error handling, interception, etc.

The bulk of the memory profiling specific code can be found in the
MemInfoBlock, MemInfoBlockCache, and related classes defined and used
in memprof_allocator.cpp.

For now, the memory profile is dumped to text (stderr by default, but
honors the sanitizer_common log_path flag). It is dumped in either a
default verbose format, or an optional terse format.

This patch also adds a set of tests for the core functionality.

Differential Revision: https://reviews.llvm.org/D87120
2020-10-16 09:47:02 -07:00
Hiroshi Yamauchi 1ebee7adf8 [PGO] Remove the old memop value profiling buckets.
Following up D81682 and D83903, remove the code for the old value profiling
buckets, which have been replaced with the new, extended buckets and disabled by
default.

Also syncing InstrProfData.inc between compiler-rt and llvm.

Differential Revision: https://reviews.llvm.org/D88838
2020-10-15 10:09:49 -07:00
Petr Hosek 220de1f32a Revert "[CMake] Avoid accidental C++ standard library dependency in sanitizers"
This reverts commit 287c318690 which broke
sanitizer tests that use C++ standard library.
2020-10-14 18:44:09 -07:00
Petr Hosek 287c318690 [CMake] Avoid accidental C++ standard library dependency in sanitizers
While sanitizers don't use C++ standard library, we could still end
up accidentally including or linking it just by the virtue of using
the C++ compiler. Pass -nostdinc++ and -nostdlib++ to avoid these
accidental dependencies.

Differential Revision: https://reviews.llvm.org/D88922
2020-10-14 18:26:56 -07:00
Calixte Denizet 5502bd66bb [profile] Remove useless msync when dumping gcda files
Summary:
According the mmap man page (https://man7.org/linux/man-pages/man2/mmap.2.html) is only required to precisely control updates, so we can safely remove it.
Since gcda files are dumped just before to call exec** functions, dump need to be fast.
On my computer, Firefox built with --coverage needs ~1min40 to display something and in removing msync it needs ~8s.

Reviewers: void

Subscribers: #sanitizers, marco-c, sylvestre.ledru

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D81060
2020-10-14 17:07:20 +02:00
Vitaly Buka 20e78eb304 [sanitizer][NFC] Fix few cpplint warnings 2020-10-13 20:39:37 -07:00
David Tenty 19856c5982 [NFC][compiler-rt] Add ppc32 to the list of arch
This should have been done when it was added to the symmetrical list in
the builtins config-ix in D87383, but it was overlooked.
2020-10-13 23:28:47 -04:00
Kamil Rytarowski d4b0404732 [compiler-rt] [lldb] Mark syscall_acquire and syscall_release as USED
Fixes build warnings on NetBSD.
2020-10-14 03:57:15 +02:00
Vitaly Buka bcdd4359e1 [sanitizer] Escape quotes in tests to fix android bot after D88361 2020-10-13 18:09:38 -07:00
Hafiz Abid Qadeer eddbadfe13 [compiler-rt] Allow override of 'emulator' value from lit_config.
Currently the 'emulator' value is fixed at build time. This patch allows changing the emulator
at testing time and enables us to run the tests on different board or simulators without needing
to run CMake again to change the value of emulator.

With this patch in place, the value of 'emulator' can be changed at test time from the command
line like this:

$ llvm-lit --param=emulator="..."

Reviewed By: delcypher

Differential Revision: https://reviews.llvm.org/D84708
2020-10-13 17:12:34 +01:00