aboutsummaryrefslogtreecommitdiff
path: root/compiler-rt
AgeCommit message (Collapse)AuthorFilesLines
2024-03-15[asan][windows] Make tests more flexable (#85274)Charlie Barto25-241/+143
Contains test changes from https://github.com/llvm/llvm-project/pull/81677 that are simple test changes. For the most part just makes the tests allow more flexibility in the callstacks produced by asan. Note: this PR has the exact changes from https://github.com/llvm/llvm-project/pull/81677 in addition to a revert commit to remove the ones that require other things from that PR. This will be squashed, ofc. I just left things unsquashed for reviewing pleasure :). This is a non-functional-change
2024-03-15[msan] Re-exec with no ASLR if memory layout is incompatible on Linux (#85142)Thurston Dang3-14/+50
This ports the change from TSan (https://github.com/llvm/llvm-project/commit/0784b1eefa36d4acbb0dacd2d18796e26313b6c5). Testing notes: run 'sudo sysctl vm.mmap_rnd_bits=32; ninja check-msan' before and after this patch. N.B. aggressive ASLR may also cause the app to overlap with the allocator region; for MSan, this was fixed in https://github.com/llvm/llvm-project/commit/af2bf86a372cacf5f536bae06e2f2d3886eefb7b
2024-03-15Revert "[compiler-rt] Avoid generating coredumps when piped to a tool" (#85390)antoine moynault2-24/+2
This reverts commit 27e5312a8bc8935f9c5620ff061c647d9fbcec85. This commit broke some bots: - clang-aarch64-sve-vla https://lab.llvm.org/buildbot/#/builders/197/builds/13609 - clang-aarch64-sve-vls https://lab.llvm.org/buildbot/#/builders/184/builds/10988 - clang-aarch64-lld-2stage https://lab.llvm.org/buildbot/#/builders/185/builds/6312 https://github.com/llvm/llvm-project/pull/83701
2024-03-15[compiler-rt] Also consider SIGPROF as a synchronous signalserge-sans-paille5-10/+12
Blocking that signal causes inter-blocking for profilers that monitor threads through that signal. Update tests accordingly to use an uncaught signal. This is a recommit of 6f3f659ce9ab91002b4a490b0ce4b085981383cd with the tests fixed. Fix #83844 and #83561
2024-03-14[msan] Add 'MappingDesc::ALLOCATOR' type and check it is available (#85153)Thurston Dang3-13/+34
MSan divides the virtual address space into APP, INVALID, SHADOW and ORIGIN memory. The allocator usually just steals a bit of the APP address space: typically the bottom portion of the PIE binaries section, which works because the Linux kernel maps from the top of the PIE binaries section. However, if ASLR is very aggressive, the binary may end up mapped in the same location where the allocator wants to live; this results in a segfault. This patch adds in a MappingDesc::ALLOCATOR type and enforces that the memory range for the allocator is not occupied by anything else. Since the allocator range information is not readily available in msan.h, we duplicate the information from msan_allocator.cpp. Note: aggressive ASLR can also lead to a different type of failure, where the PIE binaries/libraries are mapped entirely outside of the APP/ALLOCATOR sections; that will be addressed in a separate patch (https://github.com/llvm/llvm-project/pull/85142).
2024-03-14Revert "[compiler-rt] Also consider SIGPROF as a synchronous signal ↵dyung1-3/+1
(#85188)" (#85296) This reverts commit 6f3f659ce9ab91002b4a490b0ce4b085981383cd. This change is causing TSAN failures on a bot as reported in #85188: https://lab.llvm.org/buildbot/#/builders/247/builds/15279
2024-03-14[compiler-rt] Also consider SIGPROF as a synchronous signal (#85188)serge-sans-paille1-1/+3
Blocking that signal causes inter-blocking for profilers that monitor threads through that signal. Fix #83844 and #83561
2024-03-13[lsan] Disable symbolization in testVitaly Buka1-5/+2
With internal symbolizer leaking pointers can be copied into alive memory used by symbolizer.
2024-03-13Reapply "[sanitizer][asan][win] Intercept _strdup on Windows (#85006)Charlie Barto3-16/+31
Reapply "[sanitizer][asan][win] Intercept _strdup on Windows instead of strdup This includes test changes and interface changes that are duplicated in https://github.com/llvm/llvm-project/pull/81677 This reverts commit 03dc87e93937bf25a48bc77d0006c59f37b1855d.
2024-03-13[scudo] Refactor allocator config to support optional flags (#81805)ChiaHungDuan15-170/+498
Instead of explicitly disabling a feature by declaring the variable and set it to false, this change supports the optional flags. I.e., you can skip certain flags if you are not using it. This optional feature supports both forms, 1. Value: A parameter for a feature. E.g., EnableRandomOffset 2. Type: A C++ type implementing a feature. E.g., ConditionVariableT On the other hand, to access the flags will be through one of the wrappers, BaseConfig/PrimaryConfig/SecondaryConfig/CacheConfig (CacheConfig is embedded in SecondaryConfig). These wrappers have the getters to access the value and the type. When adding a new feature, we need to add it to `allocator_config.def` and mark the new variable with either *_REQUIRED_* or *_OPTIONAL_* macro so that the accessor will be generated properly. In addition, also remove the need of `UseConditionVariable` to flip on/off of condition variable. Now we only need to define the type of condition variable.
2024-03-13[asan][windows] fix issue64990 test (#85137)Charlie Barto1-2/+2
This was broken by https://github.com/llvm/llvm-project/pull/84971
2024-03-13[compiler-rt] Avoid generating coredumps when piped to a toolAlexander Richardson2-2/+24
I was trying to debug why `ninja check-compiler-rt` was taking so long to run on my system and after some debugging it turned out that most of the time was being spent generating core dumps. On many current Linux systems, coredumps are no longer dumped in the CWD but instead piped to a utility such as systemd-coredumpd that stores them in a deterministic location. This can be done by setting the kernel.core_pattern sysctl to start with a '|'. However, when using such a setup the kernel ignores a coredump limit of 0 (since there is no file being written) and we can end up piping many gigabytes of data to systemd-coredumpd which causes the test suite to freeze for a long time. While most piped coredump handlers do respect the crashing processes' RLIMIT_CORE, this is notable not the case for Debian's systemd-coredump due to a local patch that changes sysctl.d/50-coredump.conf to ignore the specified limit and instead use RLIM_INFINITY (https://salsa.debian.org/systemd-team/systemd/-/commit/64599ffe44f0d). Fortunately there is a workaround: the kernel recognizes the magic value of 1 for RLIMIT_CORE to disable coredumps when piping. One byte is also too small to generate any coredump, so it effectively behaves as if we had set the value to zero. The alternative to using RLIMIT_CORE=1 would be to use prctl() with the PR_SET_DUMPABLE flag, however that also prevents ptrace(), so makes it impossible to attach a debugger. Fixes: https://github.com/llvm/llvm-project/issues/45797 Reviewed By: vitalybuka Pull Request: https://github.com/llvm/llvm-project/pull/83701
2024-03-13[compiler-rt] Remove llvm_gtest dependency from unit testsAlexander Richardson10-11/+9
All these unit tests already include ${COMPILER_RT_GTEST_SOURCE} as an input source file and the target llvm_gtest does not exist for standalone builds. Currently the DEPS argument is ignored for standalone builds so the missing target is not a problem, but as part of fixing a build race for standalone builds I am planning to include those dependencies in COMPILER_RT_TEST_STANDALONE_BUILD_LIBS configurations. Reviewed By: vitalybuka Pull Request: https://github.com/llvm/llvm-project/pull/83649
2024-03-13[compiler-rt] reimplements GetMemoryProfile for netbsd. (#84841)David CARLIER3-2/+15
The actual solution relies on the premise /proc/self/smaps existence. instead relying on native api like freebsd. fixing fuzzer build too.
2024-03-13[compiler-rt] Fix interceptors with AArch64 BTI (#84061)Marco Elver2-4/+14
On AArch64 with BTI, we have to start functions with the appropriate BTI hint to indicate that the function is a valid call target. To support interceptors with AArch64 BTI, add "BTI c".
2024-03-12[sanitizer] Reject unsupported -static at link time (#83524)Fangrui Song5-0/+8
Most sanitizers don't support static linking. One primary reason is the incompatibility with interceptors. `GetTlsSize` is another reason. asan/memprof use `__interception::DoesNotSupportStaticLinking` (`_DYNAMIC` reference) to reject -static at link time. Port this detector to other sanitizers. dfsan actually supports -static for certain cases. Don't touch dfsan.
2024-03-12[tsan] Disabled test dead locking on glibc-2.38Vitaly Buka2-1/+5
https://github.com/google/sanitizers/issues/1733
2024-03-12[sanitizer][windows] report symbols in clang_rt. or \compiler-rt\lib\ as ↵Charlie Barto1-0/+4
internal. (#84971) This is the windows equivalent to the existing filters. Work from https://github.com/llvm/llvm-project/pull/81677 that can be applied separately (and is actually not critical for that PR)
2024-03-12[tsan] Add missing link option to tsan test after #84923Dave Clausen1-1/+1
Pull Request: https://github.com/llvm/llvm-project/pull/85003
2024-03-12Fix race in the implementation of __tsan_acquire() (#84923)Dave Clausen2-1/+44
`__tsan::Acquire()`, which is called by `__tsan_acquire()`, has a performance optimization which attempts to avoid acquiring the atomic variable's mutex if the variable has no associated memory model state. However, if the atomic variable was recently written to by a `compare_exchange_weak/strong` on another thread, the memory model state may be created *after* the atomic variable is updated. This is a data race, and can cause the thread calling `Acquire()` to not realize that the atomic variable was previously written to by another thread. Specifically, if you have code that writes to an atomic variable using `compare_exchange_weak/strong`, and then in another thread you read the value using a relaxed load, followed by an `atomic_thread_fence(memory_order_acquire)`, followed by a call to `__tsan_acquire()`, TSAN may not realize that the store happened before the fence, and so it will complain about any other variables you access from both threads if the thread-safety of those accesses depended on the happens-before relationship between the store and the fence. This change eliminates the unsafe optimization in `Acquire()`. Now, `Acquire()` acquires the mutex before checking for the existence of the memory model state.
2024-03-12[AArch64][SME] Add BTI and No Exec Stack markers to sme-abi.S (#84895)Dani1-12/+22
Adding BTI landing pads compiler-rt is built with -mbranch-protectoin. Tabulators are changed to 2 spaces for consistency.
2024-03-12[AArch64] Fix COMPILER_RT_HAS_AUXV for builtins. (#84816)Dani1-0/+3
COMPILER_RT_HAS_AUXV is used now in builtins so the test need to be in the builtin-config-ix.cmake too.
2024-03-11[NFC] [scudo] Move static_assert to class it concerns (#84245)Florian Mayer1-4/+5
2024-03-11[NFC] [scudo] move static_assert closer to class it relates to (#84257)Florian Mayer2-10/+4
delete other static_assert
2024-03-11Typo: ponitHans Wennborg1-1/+1
2024-03-11[compiler-rt] Mark more calls as blocking (#77789)Pavel Labath3-39/+107
If we're in a blocking call, we need to run the signal immediately, as the call may not return for a very long time (if ever). Not running the handler can cause deadlocks if the rest of the program waits (in one way or another) for the signal handler to execute. I've gone through the list of functions in sanitizer_common_interceptors and marked as blocking those that I know can block, but I don't claim the list to be exhaustive. In particular, I did not mark libc FILE* functions as blocking, because these can end up calling user functions. To do that correctly, /I think/ it would be necessary to clear the "is in blocking call" flag inside the fopencookie wrappers. The test for the bug (deadlock) uses the read call (which is the one that I ran into originally), but the same kind of test could be written for any other blocking syscall.
2024-03-09[sanitizer] Disable COMPILER_RT_HAS_TRIVIAL_AUTO_INIT on PowerPC to fix the botVitaly Buka1-1/+4
See issue #84654.
2024-03-09Revert "[NFC][compiler-rt] Try to collect more info about crashes on bot"Vitaly Buka1-1/+0
Catches nothing, reported #84654. This reverts commit 6f7ebcb71f4e89309c613da9600991850f15f74f.
2024-03-09[NFC][compiler-rt] Try to collect more info about crashes on botVitaly Buka1-0/+1
2024-03-09[asan] [test] Mark a new test UNSUPPORTED for MinGW targetsMartin Storsjö1-0/+2
This test uses the MSVC/clang-cl specific -EHsc flag. This test was recently added, in ea12c1fa15093e24818785b2ca6e06588372a3bf.
2024-03-09[compiler-rt] Adds builtins support for xros. (#83484)rohit-rao2-0/+8
Adds support for xros when compiling builtins. This is disabled by default and controlled with COMPILER_RT_ENABLE_XROS, similar to watchOS/tvOS.
2024-03-08[tsan] Intercept __tls_get_addr_earlierAlexander Richardson1-9/+11
This can be useful because dlsym() may call malloc on failure which could result in other interposed functions being called that could eventually make use of TLS. While the crash that I experienced originally has been fixed differently (by not using global-dynamic TLS accesses in the mutex deadlock detector, see https://github.com/llvm/llvm-project/pull/83890), moving this interception earlier is still a good since it makes the code a bit more robust against initialization order problems. Reviewed By: MaskRay, vitalybuka Pull Request: https://github.com/llvm/llvm-project/pull/83886
2024-03-08[tsan] Fix running check-ubsan with COMPILER_RT_DEBUG=ONAlexander Richardson1-2/+4
TestCases/Misc/Linux/sigaction.cpp fails because dlsym() may call malloc on failure. And then the wrapped malloc appears to access thread local storage using global dynamic accesses, thus calling ___interceptor___tls_get_addr, before REAL(__tls_get_addr) has been set, so we get a crash inside ___interceptor___tls_get_addr. For example, this can happen when looking up __isoc23_scanf which might not exist in some libcs. Fix this by marking the thread local variable accessed inside the debug checks as "initial-exec", which does not require __tls_get_addr. This is probably a better alternative to https://github.com/llvm/llvm-project/pull/83886. This fixes a different crash but is related to https://github.com/llvm/llvm-project/issues/46204. Backtrace: ``` #0 0x0000000000000000 in ?? () #1 0x00007ffff6a9d89e in ___interceptor___tls_get_addr (arg=0x7ffff6b27be8) at /path/to/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:2759 #2 0x00007ffff6a46bc6 in __sanitizer::CheckedMutex::LockImpl (this=0x7ffff6b27be8, pc=140737331846066) at /path/to/llvm/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp:218 #3 0x00007ffff6a448b2 in __sanitizer::CheckedMutex::Lock (this=0x7ffff6b27be8, this@entry=0x730000000580) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_mutex.h:129 #4 __sanitizer::Mutex::Lock (this=0x7ffff6b27be8, this@entry=0x730000000580) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_mutex.h:167 #5 0x00007ffff6abdbb2 in __sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock (mu=0x730000000580, this=<optimized out>) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_mutex.h:383 #6 __sanitizer::SizeClassAllocator64<__tsan::AP64>::GetFromAllocator (this=0x7ffff7487dc0 <__tsan::allocator_placeholder>, stat=stat@entry=0x7ffff570db68, class_id=11, chunks=chunks@entry=0x7ffff5702cc8, n_chunks=n_chunks@entry=128) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_allocator_primary64.h:207 #7 0x00007ffff6abdaa0 in __sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__tsan::AP64> >::Refill (this=<optimized out>, c=c@entry=0x7ffff5702cb8, allocator=<optimized out>, class_id=<optimized out>) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_allocator_local_cache.h:103 #8 0x00007ffff6abd731 in __sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__tsan::AP64> >::Allocate (this=0x7ffff6b27be8, allocator=0x7ffff5702cc8, class_id=140737311157448) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_allocator_local_cache.h:39 #9 0x00007ffff6abc397 in __sanitizer::CombinedAllocator<__sanitizer::SizeClassAllocator64<__tsan::AP64>, __sanitizer::LargeMmapAllocatorPtrArrayDynamic>::Allocate (this=0x7ffff5702cc8, cache=0x7ffff6b27be8, size=<optimized out>, size@entry=175, alignment=alignment@entry=16) at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_allocator_combined.h:69 #10 0x00007ffff6abaa6a in __tsan::user_alloc_internal (thr=0x7ffff7ebd980, pc=140737331499943, sz=sz@entry=175, align=align@entry=16, signal=true) at /path/to/llvm/compiler-rt/lib/tsan/rtl/tsan_mman.cpp:198 #11 0x00007ffff6abb0d1 in __tsan::user_alloc (thr=0x7ffff6b27be8, pc=140737331846066, sz=11, sz@entry=175) at /path/to/llvm/compiler-rt/lib/tsan/rtl/tsan_mman.cpp:223 #12 0x00007ffff6a693b5 in ___interceptor_malloc (size=175) at /path/to/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:666 #13 0x00007ffff7fce7f2 in malloc (size=175) at ../include/rtld-malloc.h:56 #14 __GI__dl_exception_create_format (exception=exception@entry=0x7fffffffd0d0, objname=0x7ffff7fc3550 "/path/to/llvm/compiler-rt/cmake-build-all-sanitizers/lib/linux/libclang_rt.tsan-x86_64.so", fmt=fmt@entry=0x7ffff7ff2db9 "undefined symbol: %s%s%s") at ./elf/dl-exception.c:157 #15 0x00007ffff7fd50e8 in _dl_lookup_symbol_x (undef_name=0x7ffff6af868b "__isoc23_scanf", undef_map=<optimized out>, ref=0x7fffffffd148, symbol_scope=<optimized out>, version=<optimized out>, type_class=0, flags=2, skip_map=0x7ffff7fc35e0) at ./elf/dl-lookup.c:793 --Type <RET> for more, q to quit, c to continue without paging-- #16 0x00007ffff656d6ed in do_sym (handle=<optimized out>, name=0x7ffff6af868b "__isoc23_scanf", who=0x7ffff6a3bb84 <__interception::InterceptFunction(char const*, unsigned long*, unsigned long, unsigned long)+36>, vers=vers@entry=0x0, flags=flags@entry=2) at ./elf/dl-sym.c:146 #17 0x00007ffff656d9dd in _dl_sym (handle=<optimized out>, name=<optimized out>, who=<optimized out>) at ./elf/dl-sym.c:195 #18 0x00007ffff64a2854 in dlsym_doit (a=a@entry=0x7fffffffd3b0) at ./dlfcn/dlsym.c:40 #19 0x00007ffff7fcc489 in __GI__dl_catch_exception (exception=exception@entry=0x7fffffffd310, operate=0x7ffff64a2840 <dlsym_doit>, args=0x7fffffffd3b0) at ./elf/dl-catch.c:237 #20 0x00007ffff7fcc5af in _dl_catch_error (objname=0x7fffffffd368, errstring=0x7fffffffd370, mallocedp=0x7fffffffd367, operate=<optimized out>, args=<optimized out>) at ./elf/dl-catch.c:256 #21 0x00007ffff64a2257 in _dlerror_run (operate=operate@entry=0x7ffff64a2840 <dlsym_doit>, args=args@entry=0x7fffffffd3b0) at ./dlfcn/dlerror.c:138 #22 0x00007ffff64a28e5 in dlsym_implementation (dl_caller=<optimized out>, name=<optimized out>, handle=<optimized out>) at ./dlfcn/dlsym.c:54 #23 ___dlsym (handle=<optimized out>, name=<optimized out>) at ./dlfcn/dlsym.c:68 #24 0x00007ffff6a3bb84 in __interception::GetFuncAddr (name=0x7ffff6af868b "__isoc23_scanf", trampoline=140737311157448) at /path/to/llvm/compiler-rt/lib/interception/interception_linux.cpp:42 #25 __interception::InterceptFunction (name=0x7ffff6af868b "__isoc23_scanf", ptr_to_real=0x7ffff74850e8 <__interception::real___isoc23_scanf>, func=11, trampoline=140737311157448) at /path/to/llvm/compiler-rt/lib/interception/interception_linux.cpp:61 #26 0x00007ffff6a9f2d9 in InitializeCommonInterceptors () at /path/to/llvm/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:10315 ``` Reviewed By: vitalybuka, MaskRay Pull Request: https://github.com/llvm/llvm-project/pull/83890
2024-03-08[compiler-rt] Simplify and rename of operator_new_size_typeAlexander Richardson3-12/+5
We can rely on the compiler-provided macro __SIZE_TYPE__ for all non-MSVC compilers and fall back to `uptr` otherwise. I verified via https://godbolt.org/z/MW9KMjv5f that this works for MSVC as well as GCC 4.5 Clang 3.0, so that should cover supported compilers. While touching this also rename operator_new_size_type to usize which makes it more obvious that this is the equivalent to size_t within the sanitizers runtime (which I plan to use in follow-up changes). Reviewed By: vitalybuka Pull Request: https://github.com/llvm/llvm-project/pull/83912
2024-03-08Revert "[builtins] Disable COMPILER_RT_CRT_USE_EH_FRAME_REGISTRY by d… ↵Daniel Thornburgh2-1/+11
(#84580) …efault (#83201)" This reverts commit 062cfada643c1aa48a1bb81894e2920d390fe8cf. See issue #84574.
2024-03-08Skip MemtagBasicDeathTest#Unsupported when running with HWASan (#84243)Florian Mayer1-0/+5
Tested in AOSP.
2024-03-08[Asan] Add "funclet" OpBundle to generated runtime calls if required by EH ↵sylvain-audi1-0/+18
personality (#82533) Previously, runtime calls introduced by ASan instrumentation into EH pads were missing the funclet token expected by WinEHPrepare. WinEHPrepare would then identify the containing BB as invalid and discard it, causing invalid code generation that most likely crashes. Also fixed localescape test, switching its EH personality to match code without funclets. This PR is based on the Phabricator patch https://reviews.llvm.org/D143108 Fixes https://github.com/llvm/llvm-project/issues/64990
2024-03-08[compiler-rt] Unbreak GCC builds after bfa6444a332f82843Alex Richardson1-1/+2
GCC complains if we pass -Werror=format-security without -Wformat. Reported at https://github.com/llvm/llvm-project/pull/83779#issuecomment-1985246797
2024-03-07[compiler-rt] Fix incorrect usages of check_cxx_compiler_flagAlexander Richardson1-16/+16
These checks have been broken since 6afe972195454a1110ed8d20c6f2a547e6366379. The check_cxx_compiler_flag macro only takes two arguments and passing three to it ends up calling `cmake_check_compiler_flag(CXX "${_FLAG}" ${_RESULT})` with ${_FLAG} equal to `-Werror` and the result variable being the actually tested compiler flag. I noticed this because some of the flags that I know should be supported were being flagged as not supported. `--debug-trycompile` shows the following surprising line in the generated CMakeLists.txt: `add_definitions([==[-D-Wempty-body]==] [==[-Werror]==])` which then results in the following error while running the check: ``` FAILED: CMakeFiles/cmTC_72736.dir/src.cxx.o tmp/upstream-llvm-readonly/bin/clang++ -nodefaultlibs -std=c++17 -fcolor-diagnostics -D-Wempty-body -Werror -MD -MT CMakeFiles/cmTC_72736.dir/src.cxx.o -MF CMakeFiles/cmTC_72736.dir/src.cxx.o.d -o CMakeFiles/cmTC_72736.dir/src.cxx.o -c .../cmake-build-all-sanitizers/CMakeFiles/CMakeScratch/TryCompile-nyh3QR/src.cxx In file included from <built-in>:450: <command line>:1:9: error: macro name must be an identifier 1 | #define -Wempty-body 1 | ^ 1 error generated. ``` It would be great if CMake could be a bit more helpful here so I've filed https://gitlab.kitware.com/cmake/cmake/-/issues/25735. See also https://reviews.llvm.org/D146920. Reviewed By: nikic Pull Request: https://github.com/llvm/llvm-project/pull/83779
2024-03-08[compiler-rt][Fuzzer] fix windows typo (#84407)David CARLIER1-1/+1
2024-03-08[compiler-rt] adding fchmodat2 syscall introduced in Linux 6.6. (#82275)David CARLIER1-0/+9
2024-03-07[compiler-rt][fuzzer] Reland "SetThreadName windows implementation" (#83562)David CARLIER1-4/+21
Following-up on GH-76761.
2024-03-06[compiler-rt] Only query llvm-config in the orc testsAlexander Richardson2-16/+12
This check for assertions is only used inside the test/orc directory, but doing it in the top level lit config means all testsuites depend on llvm-config being present. This is not necessarily needed e.g. when testing just the builtins. While touching this code, simplify it a bit by using subprocess.check_output() instead of Popen() and use a string comparison instead of a regex match. Reviewed By: lhames Pull Request: https://github.com/llvm/llvm-project/pull/83705
2024-03-06[MSan] Pass -fsanitize-ignorelist to the instrumented libcxxabiAlexander Richardson1-1/+2
This ensures that the MSan unit tests are able to pass with an uninstrumented libunwind. We need to avoid instrumentation for __gxx_personality_v0, which is part of the default msan_ignorelist.txt that is installed into the resource directory. However, if we are trying to test the just-built libraries, this global ignore list may not be present yet, so we still instrument the function. Arguably this function should not be on the default ignore list since it is only a problem when building libcxxabi with MSan instrumentation and without an instrumented libunwind, so maybe the logic should really be part of the libcxxabi build. However, that could be done as a follow-up. See 2f856a36e0b270b184051d10a18d4b4238b4c033 for more context. Reviewed By: vitalybuka Pull Request: https://github.com/llvm/llvm-project/pull/83652
2024-03-06[NFC] [scudo] remove DCHECK (#84255)Florian Mayer1-1/+0
this gets checked in StackDepot::init anyway
2024-03-06[test] Make two sanitize-coverage tests pass with glibc 2.39+Fangrui Song2-2/+6
glibc 2.39 added `nonnull` attribute to most libio functions accepting a `FILE*` parameter, including fprintf[1]. The -fsanitize=undefined mode checks the argument to fprintf and has extra counters, not expected by two tests. Specify -fno-sanitize=nonnull-attribute to make the two tests pass. Fix #82883 [1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=64b1a44183a3094672ed304532bedb9acc707554 Pull Request: https://github.com/llvm/llvm-project/pull/84231
2024-03-06[Profile][Windows] Fix flakyness when checking existence of binary id (#84196)Zequan Wu1-2/+3
There is a small chance that binary id starting with 0 (1/256). It is not sufficient to just check the first byte.
2024-03-05[compiler-rt/darwin] Disable building sanitizers on platforms without ↵rohit-rao1-1/+1
fork(). (#83485) The watchOS and tvOS sanitizers do not compile with publicly-available SDKs, failing on calls such as fork() and posix_spawn(). Updating the darwin_test_archs test program to include a call to fork() allows cmake to exclude those platforms when compiling runtimes. This allows public builds to enable watchOS/tvOS and compile builtins but not sanitizers.
2024-03-04[SelectionDAG] Add `STRICT_BF16_TO_FP` and `STRICT_FP_TO_BF16` (#80056)Shilei Tian3-0/+29
This patch adds the support for `STRICT_BF16_TO_FP` and `STRICT_FP_TO_BF16`.
2024-03-04Revert "[SelectionDAG] Add `STRICT_BF16_TO_FP` and `STRICT_FP_TO_BF16` (#80056)"Shilei Tian3-21/+0
This reverts commit b0c158bd947c360a4652eb0de3a4794f46deb88b. The changes in `compiler-rt` broke tests.