summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* Use __extension__ to suppress __EH_FRAME_LIST__ warningsFangrui Song2019-05-011-1/+1
| | | | | | | gcc -pedantic => warning: ISO C forbids empty initializer braces clang -pedantic => -Wzero-length-array + -Wgnu-empty-initializer llvm-svn: 359655
* [compiler-rt] Cleanup the --target and --sysroot handlingPetr Hosek2019-05-011-4/+3
| | | | | | This addresses issue introduced in r359646. llvm-svn: 359650
* [compiler-rt] Pass sysroot and disable pedantic for crtbegin.o/crtend.oPetr Hosek2019-05-013-1/+6
| | | | | | | | These are needed to make bots happy. Differential Revision: https://reviews.llvm.org/D61363 llvm-svn: 359646
* [compiler-rt] Rework the object build supportPetr Hosek2019-05-011-8/+33
| | | | | | | | | | The initial implementation didn't properly support cross-compilation via the runtime build, the updated implementation should address that by expanding the CMAKE_C_COMPILE_OBJECT variable with correct values. Differential Revision: https://reviews.llvm.org/D61356 llvm-svn: 359644
* [libFuzzer] Disable i386 on non-Linux platformsJonathan Metzman2019-05-011-1/+5
| | | | | | | | | | | | | | | | Summary: Disable i386 on non-Linux platforms since it is unwanted and broken on Windows. Reviewers: morehouse, rnk Reviewed By: morehouse Subscribers: mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61354 llvm-svn: 359641
* [libFuzzer] Fix failing test: sigint.testJonathan Metzman2019-04-301-3/+1
| | | | | | | | | | | | | | | | | | Summary: Fix sigint.test by making it require msan rather than enumerating unsupported platforms. Reviewers: kcc Reviewed By: kcc Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61353 llvm-svn: 359638
* Added test.Mitch Phillips2019-04-301-0/+16
| | | | llvm-svn: 359632
* [sanitizer_common] Added 64-bit signed flag parser.Mitch Phillips2019-04-301-0/+9
| | | | | | | | | | | | | | Summary: Adds a 64-bit signed flag parser for GWP-ASan's use. Reviewers: vlad.tsyrklevich, eugenis Subscribers: kubamracek, #sanitizers, llvm-commits, vitalybuka, morehouse, pcc, kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61342 llvm-svn: 359631
* [libFuzzer] temporarily disable a test on windows, where there is no memmem ↵Kostya Serebryany2019-04-301-0/+2
| | | | | | in the usual place llvm-svn: 359624
* [libFuzzer] add MagicSeparatorTestKostya Serebryany2019-04-302-0/+51
| | | | llvm-svn: 359620
* Revert r359325 "[NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION ↵Reid Kleckner2019-04-306-20/+48
| | | | | | | | | | | | | | | to void" Changing INTERCEPT_FUNCTION to return void is not functionally correct. IMO the best way to communicate failure or success of interception is with a return value, not some external address comparison. This change was also creating link errors for _except_handler4_common, which is exported from ucrtbase.dll in 32-bit Windows. Also revert dependent changes r359362 and r359466. llvm-svn: 359611
* [libFuzzer] Replace -seed_corpus to better support fork mode on WinJonathan Metzman2019-04-306-10/+56
| | | | | | | | | | | | | | | | | | Summary: Pass seed corpus list in a file to get around argument length limits on Windows. This limit was preventing many uses of fork mode on Windows. Reviewers: kcc, morehouse Reviewed By: kcc Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60980 llvm-svn: 359610
* [compiler-rt][builtins][sanitizers] Update compiler-rt test cases forAmy Kwan2019-04-302-6/+15
| | | | | | | | | | | | | | | | compatibility with system's toolchain This patch aims to: - Guard ompiler-rt/test/builtins/Unit/compiler_rt_logb_test.c with macros, so the test runs on GLIBC versions >= 2.23. This is because the test relies on comparing its computed values to libm. Oolder versions might not compute to the same value as the compiler-rt value. - Update compiler-rt/test/sanitizer_common/TestCases/Posix/getpw_getgr.cc so that std::string is not used, since false positives may be detected. Differential Revision: https://reviews.llvm.org/D60644 llvm-svn: 359606
* Reland "[compiler-rt] Simple crtbegin.o and crtend.o implementation"Petr Hosek2019-04-3013-17/+442
| | | | | | | | | | | | | | | Clang relies on existence of certain symbols that are normally provided by crtbegin.o/crtend.o. However, LLVM does not currently provide implementation of these files, instead relying on either libgcc or implementations provided as part of the system. This change provides an initial implementation of crtbegin.o/crtend.o that can be used on system that don't provide crtbegin.o/crtend.o as part of their C library. Differential Revision: https://reviews.llvm.org/D28791 llvm-svn: 359591
* fix broken testJonathan Metzman2019-04-301-7/+7
| | | | llvm-svn: 359590
* remove extra zerosJonathan Metzman2019-04-301-1/+1
| | | | llvm-svn: 359589
* remove stale commentJonathan Metzman2019-04-301-1/+1
| | | | llvm-svn: 359588
* change orderJonathan Metzman2019-04-301-1/+1
| | | | llvm-svn: 359587
* fix commentJonathan Metzman2019-04-301-1/+1
| | | | llvm-svn: 359586
* [libFuzzer] Enable for i386Jonathan Metzman2019-04-302-2/+4
| | | | | | | | | | | | Summary: Get libFuzzer to build on i386 and fix tests. Subscribers: mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61070 llvm-svn: 359585
* Fix issues with testing for i386Jonathan Metzman2019-04-305-3/+8
| | | | llvm-svn: 359584
* Enable x86 buildsJonathan Metzman2019-04-305-9/+12
| | | | llvm-svn: 359583
* Revert "[compiler-rt] Simple crtbegin.o and crtend.o implementation"Petr Hosek2019-04-3012-420/+17
| | | | | | This reverts commit r359576 since it's failing on Windows bots. llvm-svn: 359579
* [compiler-rt] Simple crtbegin.o and crtend.o implementationPetr Hosek2019-04-3012-17/+420
| | | | | | | | | | | | | | | Clang relies on existence of certain symbols that are normally provided by crtbegin.o/crtend.o. However, LLVM does not currently provide implementation of these files, instead relying on either libgcc or implementations provided as part of the system. This change provides an initial implementation of crtbegin.o/crtend.o that can be used on system that don't provide crtbegin.o/crtend.o as part of their C library. Differential Revision: https://reviews.llvm.org/D28791 llvm-svn: 359576
* [scudo][standalone] Add the memory reclaiming mechanismKostya Kortchinsky2019-04-306-3/+527
| | | | | | | | | | | | | | | | | | | | | | Summary: This CL implements the memory reclaiming function `releaseFreeMemoryToOS` and its associated classes. Most of this code was originally written by Aleksey for the Primary64 in sanitizer_common, and I made some changes to be able to implement 32-bit reclaiming as well. The code has be restructured a bit to accomodate for freelist of batches instead of the freearray used in the current sanitizer_common code. Reviewers: eugenis, vitalybuka, morehouse, hctim Reviewed By: vitalybuka Subscribers: srhines, mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D61214 llvm-svn: 359567
* Fix FIXME added in r359339Reid Kleckner2019-04-292-15/+12
| | | | | | | | | We have windows.h in asan_win.cc, so we can just use the correct prototypes for these EH-related interceptors without worrying. Also fix an unused variable warning while I'm here. llvm-svn: 359500
* Pacify sanitizer lint script after r359498Reid Kleckner2019-04-291-1/+0
| | | | llvm-svn: 359499
* [AddressSanitizer] [Windows] Fix HeapReAlloc and _recalloc bugs in ↵Matthew G McGovern2019-04-293-14/+101
| | | | | | | | | | | asan_malloc_win.cc HeapReAlloc should allow for 0 sized reallocations without freeing the memory block provided by the user. _recalloc previously did not zero new memory after reallocation. https://reviews.llvm.org/D61268 llvm-svn: 359498
* [Sanitizer] Cleanup {ASAN, MSAN}_INTERCEPT_FUNC[_VER] macroJulian Lettner2019-04-292-7/+4
| | | | | | | | | | | | Note that this change is not strictly NFC since we add the `(&(name) != &WRAP(name)` part to the conditional for the `_VER` variant of the macro. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D61204 llvm-svn: 359466
* [builtins] Use __APPLE__ instead of __MACH__ in checkPetr Hosek2019-04-291-1/+1
| | | | | | | The latter doesn't seem to be working for all targets. This addresses the issue introduced in r359413. llvm-svn: 359423
* [builtins] Fix the missing assembly on DarwinPetr Hosek2019-04-291-1/+1
| | | | | | This was introduced in r359413. llvm-svn: 359421
* [builtins] Fix the typo in the preprocessor checkPetr Hosek2019-04-291-1/+1
| | | | | | This was introduced in r359413. llvm-svn: 359419
* [builtins] Use aliases for function redirectsPetr Hosek2019-04-2941-95/+85
| | | | | | | | | | | | | Symbol aliases are supported by all platforms that compiler-rt builtins target, and we can use these instead of function redirects to avoid the extra indirection. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60931 llvm-svn: 359413
* [builtins] Use single line C++/C99 comment stylePetr Hosek2019-04-28240-3869/+3489
| | | | | | | | | | | Use the uniform single line C++/99 style for code comments. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60352 llvm-svn: 359411
* [builtins] Reformat builtins with clang-formatPetr Hosek2019-04-28193-5873/+5341
| | | | | | | | | | | Update formatting to use the LLVM style. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60351 llvm-svn: 359410
* [CMake] Don't modify `FUZZER_SUPPORTED_ARCH` is place.Dan Liew2019-04-281-2/+3
| | | | | | | | | | | | | | On a Darwin host we were modifying the `FUZZER_SUPPORTED_ARCH` in place which would strip out non-x86 architectures. This unhelpful if we want to use `FUZZER_SUPPORTED_ARCH` later. To fix this we introduce `FUZZER_TEST_ARCH` which is similar to what we have for for the other sanitizers. For non-Darwin host platforms `FUZZER_TEST_ARCH` is the same as `FUZZER_SUPPORTED_ARCH` but for Darwin host platforms we use `darwin_filter_host_archs(...)` as the previous code did. llvm-svn: 359394
* [sanitizer] Calculate SizeClassAllocator32::ByteMap type from ↵Vitaly Buka2019-04-278-102/+17
| | | | | | | | | | | | | | Params::kSpaceSize and Params::kRegionSizeLog Reviewers: eugenis Subscribers: kubamracek, cryptoad, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61206 llvm-svn: 359374
* [sanitizer] NFC: add static_assert to confirm that we use reasonable ByteMap ↵Vitaly Buka2019-04-271-3/+21
| | | | | | | | | | | | | | | | | | | type Summary: If bots work we can replace #ifs with template specialization by TwoLevelByteMapSize1. There is known users of TwoLevelByteMap with TwoLevelByteMapSize1 equal 8, and users of FlatByteMap with TwoLevelByteMapSize1 equal 2. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61200 llvm-svn: 359364
* [NFC][Sanitizer] Remove GetRealFunctionAddress and replace usagesJulian Lettner2019-04-274-46/+11
| | | | | | | | Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D61205 llvm-svn: 359362
* Revert "[sanitizer] NFC: add static_assert to confirm that we use optimal ↵JF Bastien2019-04-261-7/+3
| | | | | | | | | | | | | | | | | ByteMap type" Fails on bots with: /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-expensive/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h:69:3: error: static_assert failed due to requirement 'TwoLevelByteMapSize1 > 128' "TwoLevelByteMap should be used" static_assert(TwoLevelByteMapSize1 > 128, "TwoLevelByteMap should be used"); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-expensive/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h:29:34: note: in instantiation of template class '__sanitizer::SizeClassAllocator32<__sanitizer::AP32>' requested here typename PrimaryAllocator::AddressSpaceView>::value, ^ http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/13960/console llvm-svn: 359352
* [Sanitizer][Windows] Speculative fix for broken build on WindowsJulian Lettner2019-04-261-2/+7
| | | | llvm-svn: 359339
* [Sanitizer] Fix testJulian Lettner2019-04-261-0/+2
| | | | | | | I broke the build, panicked and applied the wrong fix in my previous commit. The ASSERT was obsolete, but not the call INTERCEPT_FUNCTION. llvm-svn: 359336
* [Sanitizer] Fix compliation error in testJulian Lettner2019-04-261-2/+0
| | | | | | | Remove obsolete assert. I missed this in my previous patch: https://reviews.llvm.org/D61145 llvm-svn: 359335
* Implement __sanitizer::conditional<B, T, F>Vitaly Buka2019-04-262-0/+24
| | | | llvm-svn: 359334
* [sanitizer] NFC: add static_assert to confirm that we use optimal ByteMap typeVitaly Buka2019-04-261-3/+7
| | | | | | | | | | | | | | Summary: If bots work we can replace #ifs with template specialization by TwoLevelByteMapSize1. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61200 llvm-svn: 359333
* Revert "[CMake] Fix the value of `config.target_cflags` for non-macOS Apple"Dan Liew2019-04-265-55/+9
| | | | | | | | | | | | | | | | | | | | | This reverts commit 1bcdbd68616dc7f8debe126caafef7a7242a0e6b. It's been reported that some bots are failing with this change with CMake error like: ``` CMake Error at /b/s/w/ir/k/llvm-project/compiler-rt/cmake/config-ix.cmake:177 (message): Unsupported architecture: arm64 Call Stack (most recent call first): /b/s/w/ir/k/llvm-project/compiler-rt/cmake/config-ix.cmake:216 (get_target_flags_for_arch) /b/s/w/ir/k/llvm-project/compiler-rt/test/tsan/CMakeLists.txt:78 (get_test_cflags_for_apple_platform) ``` I'm reverting the patch now to unbreak builds. I will investigate properly when time permits. rdar://problem/50124489 llvm-svn: 359327
* [NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION to voidJulian Lettner2019-04-263-8/+18
| | | | | | | | | | | | This temporary change tells us about all the places where the return value of the INTERCEPT_FUNCTION macro is actually used. In the next patch I will cleanup the macro and remove GetRealFuncAddress. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D61145 llvm-svn: 359325
* [NFC] Remove ::kForTest from AP64, it does not use it.Vitaly Buka2019-04-262-8/+8
| | | | llvm-svn: 359323
* [asan_symbolize] Teach `asan_symbolize.py` to symbolicate using a module mapDan Liew2019-04-262-0/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The use case here is to be able get the UUIDs of the modules that need to be symbolicated so that external plugins can see them. This information can be extracted from ASan reports if the `print_module_map` ASan option is enabled. Currently printing of the module map is only implemented on Darwin and so this is effectively a Darwin only feature right now. The module map hooks into symbolization using the new plugin infrastructure. A new hook in `AsanSymbolizerPlugInProxy` (and in `AsanSymbolizerPlugIn`) is also provided to allow external plugins to hook into the module look up process. This will allow external plugins to look up modules with knowledge of their UUID. The new plug-in is currently stored in the `asan_symbolize.py` script. We could potentially move this into a separate file in the future (to reduce clutter) if we can come up with a policy for where to search for plugins that should always get loaded. rdar://problem/49476995 Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka Subscribers: #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60531 llvm-svn: 359322
* [CMake] Fix the value of `config.target_cflags` for non-macOS AppleDan Liew2019-04-265-9/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platforms. The main problem here is that `-*-version_min=` was not being passed to the compiler when building test cases. This can cause problems when testing on devices running older OSs because Clang would previously assume the minimum deployment target is the the latest OS in the SDK which could be much newer than what the device is running. Previously the generated value looked like this: `-arch arm64 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` With this change it now looks like: `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk` This mirrors the setting of `config.target_cflags` on macOS. This change is made for ASan, LibFuzzer, TSan, and UBSan. To implement this a new `get_test_cflags_for_apple_platform()` function has been added that when given an Apple platform name and architecture returns a string containing the C compiler flags to use when building tests. This also calls a new helper function `is_valid_apple_platform()` that validates Apple platform names. rdar://problem/50124489 Differential Revision: https://reviews.llvm.org/D58578 llvm-svn: 359305
OpenPOWER on IntegriCloud