summaryrefslogtreecommitdiff
path: root/lib/lsan/CMakeLists.txt
AgeCommit message (Collapse)Author
2017-07-28Support compiler-rt builtinsPetr Hosek
This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26Revert "[sanitizer] Support compiler-rt builtins"Petr Hosek
This reverts commit fd63314d6770e0da62572a3fea2c41c4cc0fc58a. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25[sanitizer] Support compiler-rt builtinsPetr Hosek
This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309060 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-19Add lsan interceptors for libdispatch functions on darwinFrancis Ricci
Summary: This is required for standalone LSan to work with libdispatch worker threads, and is a slimmed down version of the functionality provided for ASan in asan_mac.cc. Re-commit of r305695 with use_stacks=0 to get around a racy lingering pointer. Reviewers: alekseyshl, kubamracek, glider, kcc Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D34247 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305732 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-19Revert "Add lsan interceptors for libdispatch functions on darwin"Francis Ricci
This reverts r305695 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-19Add lsan interceptors for libdispatch functions on darwinFrancis Ricci
Summary: This is required for standalone LSan to work with libdispatch worker threads, and is a slimmed down version of the functionality provided for ASan in asan_mac.cc. Reviewers: alekseyshl, kubamracek, glider, kcc Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D34247 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305695 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11Implement standalone lsan interceptors for OS XFrancis Ricci
Summary: Mimicks the existing tsan and asan implementations of Darwin interception. Reviewers: kubamracek, kcc, glider Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D31889 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299979 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06Enable builds of darwin lsan by defaultFrancis Ricci
Summary: Testing and asan leak detection are disabled by default. Reviewers: kubamracek, kcc Subscribers: srhines, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D31307 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299669 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27Move lsan allocator cache from lsan_common_linux to lsan_linuxFrancis Ricci
Having this function in common seems to trigger a lot of unrelated test failures. Given that this isn't really common code anyway, move this to a new linux-specific lsan file. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-14Add cmake build support for lsan on OS XFrancis Ricci
Summary: Adds a new cmake flag 'COMPILER_RT_ENABLE_LSAN_OSX', which enables lsan compilation and is turned off by default. Patches to fix build errors when this flag is enabled will be uploaded soon. This is part of an effort to port LSan to OS X, but LSan on OS X does not currently work or pass tests currently. Reviewers: kubamracek, kcc, glider, alekseyshl Reviewed By: kubamracek Subscribers: danalbert, srhines, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29783 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295012 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13Add lsan function stubs for darwinFrancis Ricci
Summary: This patch provides stubs for all of the lsan platform-specific functions which need to be implemented for darwin. Currently all of these functions are stubs, for the purpose of fixing compilation. Reviewers: kcc, glider, kubamracek Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29784 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@294983 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12Revert "[sancov] moving sancov rt to sancov/ directory"Mike Aizatsky
This reverts commit https://reviews.llvm.org/rL291734 Reason: mac breakage http://lab.llvm.org:8080/green//job/clang-stage1-configure-RA_build/28798/consoleFull#1657087648e9a0fee5-ebcc-4238-a641-c5aa112c323e git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291736 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12[sancov] moving sancov rt to sancov/ directoryMike Aizatsky
Subscribers: kubabrecka, mgorny Differential Revision: https://reviews.llvm.org/D28541 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291734 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06Ensure that only one compiler-rt component is created for lsanFrancis Ricci
Summary: The lsan cmake configuration failed when targeting more than one architecture, because it would attempt to create multiple components with the same name. Ensure that only one lsan component is ever created. Reviewers: beanz, bogner Subscribers: dberris, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28151 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-26[CMake] Connect Compiler-RT targets to LLVM Runtimes directoryChris Bieneman
This patch builds on LLVM r279776. In this patch I've done some cleanup and abstracted three common steps runtime components have in their CMakeLists files, and added a fourth. The three steps I abstract are: (1) Add a top-level target (i.e asan, msan, ...) (2) Set the target properties for sorting files in IDE generators (3) Make the compiler-rt target depend on the top-level target The new step is to check if a command named "runtime_register_component" is defined, and to call it with the component name. The runtime_register_component command is defined in llvm/runtimes/CMakeLists.txt, and presently just adds the component to a list of sub-components, which later gets used to generate target mappings. With this patch a new workflow for runtimes builds is supported. The new workflow when building runtimes from the LLVM runtimes directory is: > cmake [...] > ninja runtimes-configure > ninja asan The "runtimes-configure" target builds all the dependencies for configuring the runtimes projects, and runs CMake on the runtimes projects. Running the runtimes CMake generates a list of targets to bind into the top-level CMake so subsequent build invocations will have access to some of Compiler-RT's targets through the top-level build. Note: This patch does exclude some top-level targets from compiler-rt libraries because they either don't install files (sanitizer_common), or don't have a cooresponding `check` target (stats). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11[compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron
Summary: This patch is a refactoring of the way cmake 'targets' are grouped. It won't affect non-UI cmake-generators. Clang/LLVM are using a structured way to group targets which ease navigation through Visual Studio UI. The Compiler-RT projects differ from the way Clang/LLVM are grouping targets. This patch doesn't contain behavior changes. Reviewers: kubabrecka, rnk Subscribers: wang0109, llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21952 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05[cmake] Address Samsonov's post-commit review of r262723Filipe Cabecinhas
Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17896 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262770 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10Revert "[CMake] Provide options for toggling on and off various runtime ↵Chris Bieneman
libraries." This reverts r255170. This change caused a bunch of bot failures and needs to be revised. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-09[CMake] Provide options for toggling on and off various runtime libraries.Chris Bieneman
Summary: Rather than having to add new "experimental" options each time someone wants to work on bringing a sanitizer to a new platform, this patch makes options for all of them. The default values for the options are set by the platform checks that would have enabled them, but they can be overridden on or off. Reviewers: kubabrecka, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14846 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-25[CMake] merge add_compiler_rt_runtime and add_compiler_rt_darwin_runtime ↵Chris Bieneman
into a single function Summary: This refactoring moves much of the Apple-specific behavior into a function in AddCompilerRT. The next cleanup patch will remove more of the if(APPLE) checks in the outlying CMakeLists. This patch adds a bunch of new functionality to add_compiler_rt_runtime so that the target names don't need to be reconstructed outside the call. It also updates some of the call sites to exercise the new functionality, but does not update all uses fully. Subsequent patches will further update call sites and move to using the new features. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: beanz, rengolin, llvm-commits Differential Revision: http://reviews.llvm.org/D12292 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245970 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas
Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240120 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19Revert "Revert "[CMake] LSan is not actually available on Darwin.""Alexey Samsonov
Re-land fixed version of r239955. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240108 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18Revert "[CMake] LSan is not actually available on Darwin."Justin Bogner
This change makes cmake fail to even run on Darwin with errors evaluating "$<TARGET_OBJECTS:RTInterception.x86_64>". This reverts r239955 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239985 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17[CMake] LSan is not actually available on Darwin.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239955 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-10[CMake] Cleanup add_compiler_rt_object_library to be platform-agnosticChris Bieneman
Summary: This change takes darwin-specific goop that was scattered around CMakeLists files and spread between add_compiler_rt_object_library and add_compiler_rt_darwin_object_library and moves it all under add_compiler_rt_object_library. The goal of this is to try to push platform handling as low in the utility functions as possible. Reviewers: rnk, samsonov Reviewed By: rnk, samsonov Subscribers: rnk, rsmith, llvm-commits Differential Revision: http://reviews.llvm.org/D10250 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239498 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-29[sanitizer] Android build cleanup.Evgeniy Stepanov
* Detect Android toolchain target arch and set correct runtime library name. * Merged a lot of Android and non-Android code paths. * Android is only supported in standalone build of compiler-rt now. * Linking lsan-common in ASan-Android (makes lsan annotations work). * Relying on -fsanitize=address linker flag when building tests (again, unification with non-Android path). * Runtime library moved from lib/asan to lib/linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-11Fix build on some architectures caused by r215247.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215380 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-24[asan] adding support of 32-bit address sanitizer for MIPSDaniel Sanders
Summary: The patch supports both the clang cross-compiler and native compiler Patch by Kumar Sukhani <Kumar.Sukhani@imgtec.com> Test Plan: Kumar had the following asan test results when compiled on a MIPS board: Expected Passes : 96 Expected Failures : 2 Unsupported Tests : 84 Unexpected Passes : 4 Unexpected Failures: 19 The list of unexpected failures can be found in the review. Reviewers: kcc, petarj, dsanders Reviewed By: kcc Subscribers: farazs, kcc, llvm-commits Differential Revision: http://reviews.llvm.org/D4208 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211587 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29light up sanitizers for ARM, take 2Greg Fitzgerald
Differential Revision: http://reviews.llvm.org/D3794 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209856 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29Revert "light up sanitizers for ARM"Greg Fitzgerald
This commit broke the Windows build, where CMAKE_C_COMPILER can compile and link with -march=armv7-a but the just-built-clang cannot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209851 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29light up sanitizers for ARMGreg Fitzgerald
You can expect the sanitizers to be built under any of the following conditions: 1) CMAKE_C_COMPILER is GCC built to cross-compile to ARM 2) CMAKE_C_COMPILER is Clang built to cross-compile to ARM (ARM is default target) 3) CMAKE_C_COMPILER is Clang and CMAKE_C_FLAGS contains -target and --sysroot Differential Revision: http://reviews.llvm.org/D3794 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209835 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31[CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.Alexey Samsonov
Soon there will be an option to build compiler-rt parts as shared libraries on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205183 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Add top-level target for each compiler-rt library, and add ↵Alexey Samsonov
'compiler-rt' target encompassing them all. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201556 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Simplify setting compile flag disabling RTTIAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201547 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14Move LSan test suite under test/Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201408 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14Delete LSan unit testsAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201406 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31Enable compilation of RT on ARMRenato Golin
Adding the ARM RT sources to the CMake files, and enabling some sanitizers to also build on ARM. This is far from supported or production quality, but enabling it to build will get us errors that we can actually fix. Having said that, the Compiler-RT and the Asan libraries are know to work on some variations of ARM. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200546 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-25[lsan] Unbreak standalone LSan's initialization by making it more like ASan's.Sergey Matveev
No longer allow interceptors to be called during initialization, use the preinit array (instead of initializing at the first call to an intercepted function) and adopt the calloc() hack from ASan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195642 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-07[ASan] Add CMake configs for libclang_rt.asan_iossim_dynamic.dylib Alexander Potapenko
CMake changes to build the ASan runtime for the iOS simulator. This is a universal library targeting the same architectures as the OSX ASan runtime does, thus the iossim version can't live in the same universal libclang_rt.asan_osx_dynamic.dylib The difference between the OSX and iossim builds is in the -mios-simulator-version-min and -ios_simulator_version_min flags that tell Clang to compile and link iossim code. The iossim runtime can only be built on a machine with both Xcode and the iOS Simulator SDK installed. If xcodebuild -version -sdk iphonesimulator Path returns a nonempty path, it is used when compiling and linking the iossim runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194199 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22[lsan] Build standalone LSan with -fno-rtti.Sergey Matveev
Fix issue where C code could not be built with -fsanitize=leak. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189010 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-22Add cmake rules for building LSan common on Mac OSAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184639 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07Drop support for 32-bit PowerPC in sanitizer tools.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183499 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-23[lsan] Add lit test support.Sergey Matveev
"check-lsan" now runs both the tests from lib/lsan/tests and any lit tests found under lib/lsan/lit_tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182583 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-21[lsan] Change CMakeLists to build the common LSan module for ASan.Sergey Matveev
Also, define CAN_SANITIZE_LEAKS. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182383 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20Build LSan on x86_64 only if this target is supportedAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182272 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20[lsan] CMakeLists and lit test configs for LSan.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182251 91177308-0d34-0410-b5e6-96231b3b80d8