summaryrefslogtreecommitdiff
path: root/lib/CMakeLists.txt
AgeCommit message (Collapse)Author
2017-10-02[cmake] Add a separate CMake var to control profile runtimeMichal Gorny
Make it possible to control building profile runtime separately from other options. Before r313549, the profile runtime building was controlled along with sanitizers. However, since that commit it is built unconditionally which results in multiple builds for people building different runtimes separately. Differential Revision: https://reviews.llvm.org/D38441 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[cmake] Make it possible to build and test profile without sanitizersVedant Kumar
This should fix an issue which arises when running check-compiler-rt on the coverage bot: http://green.lab.llvm.org/green/job/clang-stage2-coverage-R_build/1590/ The bot doesn't build the sanitizers, but the check-compiler-rt target always expects the profile runtime to exist. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313549 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-21Move libFuzzer to compiler_rt.George Karpenkov
Resulting library binaries will be named libclang_rt.fuzzer*, and will be placed in Clang toolchain, allowing redistribution. Differential Revision: https://reviews.llvm.org/D36908 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27Don't build tsan/dd when COMPILER_RT_HAS_TSAN is falseFrancis Ricci
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306463 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27Loop directly over sanitizers to build in cmakeFrancis Ricci
Summary: Cleaner than computing the intersection for each possible sanitizer Reviewers: compnerd, beanz Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D34693 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306453 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27Only test sanitizers that are built when COMPILER_RT_SANITIZERS_TO_BUILD is usedFrancis Ricci
Summary: This allows check-all to be used when only a subset of the sanitizers are built. Reviewers: beanz, compnerd, rnk, pcc Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D34644 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306450 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27Revert "Only test sanitizers that are built when ↵Francis Ricci
COMPILER_RT_SANITIZERS_TO_BUILD is used" This breaks cfi testing in cases when the cfi runtime isn't built. This reverts commit 1c6a7b07545f0c9ce68e8b226f5397694ce48af7. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306431 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27Only test sanitizers that are built when COMPILER_RT_SANITIZERS_TO_BUILD is usedFrancis Ricci
Summary: This allows check-all to be used when only a subset of the sanitizers are built. Reviewers: beanz, compnerd Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D34644 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306415 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
2016-08-19build: allow building a specific set of sanitizersSaleem Abdulrasool
Introduce a new CMake option `COMPILER_RT_SANITIZERS_TO_BUILD` which takes either a special token `all` (default) which will preserve the current behaviour or a CMake list of sanitizers to build. It will still perform the normal checks if the sanitizer is requested. It only permits a further means to exclude a particular sanitizer. This gives finer grained control than `COMPILER_RT_BUILD_SANITIZERS` which only gives an all or nothing control. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279253 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21[compiler-rt][XRay] re-submitting r276117, with fixes for build breakage due ↵Dean Michael Berris
to extraneous and missing dependencies and attempts to build on unsupported OSes Summary: This is a fixed-up version of D21612, to address failure identified post-commit. Original commit description: This patch implements the initialisation and patching routines for the XRay runtime, along with the necessary trampolines for function entry/exit handling. For now we only define the basic hooks for allowing an implementation to define a handler that gets run on function entry/exit. We expose a minimal API for controlling the behaviour of the runtime (patching, cleanup, and setting the handler to invoke when instrumenting). Fixes include: - Gating XRay build to only Linux x86_64 and with the right dependencies in case it is the only library being built - Including <cstddef> to fix std::size_t issue Reviewers: kcc, rnk, echristo Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D22611 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Revert r276117 "[XRay] Basic initialization and flag definition for XRay ↵Hans Wennborg
runtime" and also the follow-up "[xray] Only build xray on Linux for now" Two build errors were reported on the llvm-commits list: [ 88%] Building CXX object lib/xray/CMakeFiles/clang_rt.xray-x86_64.dir/xray_flags.cc.o /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/lib/xray/xray_init.cc:23:10: fatal error: 'llvm/Support/ELF.h' file not found #include "llvm/Support/ELF.h" ^ and In file included from /w/src/llvm.org/projects/compiler-rt/lib/xray/xray_interface.cc:16: /w/src/llvm.org/projects/compiler-rt/lib/xray/xray_interface_internal.h:36:8: error: no type named 'size_t' in namespace 'std' std::size_t Entries; ~~~~~^ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[xray] Only build xray on Linux for nowReid Kleckner
Should fix the Windows buildbots, and maybe some other non-Linux Unix bots too. XRay currently depends on sanitizer_common, so associate it with the "build sanitizers" option and remove the option for separately controlling the XRay build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[compiler-rt] [XRay] Basic initialization and flag definition for XRay runtimeDean Michael Berris
Summary: This patch implements the initialisation and patching routines for the XRay runtime, along with the necessary trampolines for function entry/exit handling. For now we only define the basic hooks for allowing an implementation to define a handler that gets run on function entry/exit. We expose a minimal API for controlling the behaviour of the runtime (patching, cleanup, and setting the handler to invoke when instrumenting). Depends on D19904 Reviewers: echristo, kcc, rnk Subscribers: rnk, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D21612 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07[sanitizer] Initial implementation of a Hardened AllocatorKostya Serebryany
Summary: This is an initial implementation of a Hardened Allocator based on Sanitizer Common's CombinedAllocator. It aims at mitigating heap based vulnerabilities by adding several features to the base allocator, while staying relatively fast. The following were implemented: - additional consistency checks on the allocation function parameters and on the heap chunks; - use of checksum protected chunk header, to detect corruption; - randomness to the allocator base; - delayed freelist (quarantine), to mitigate use after free and overall determinism. Additional mitigations are in the works. Reviewers: eugenis, aizatsky, pcc, krasin, vitalybuka, glider, dvyukov, kcc Subscribers: kubabrecka, filcab, llvm-commits Differential Revision: http://reviews.llvm.org/D20084 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21[esan] EfficiencySanitizer base runtime libraryDerek Bruening
Summary: Adds the initial version of a runtime library for the new EfficiencySanitizer ("esan") family of tools. The library includes: + Slowpath code via callouts from the compiler instrumentation for each memory access. + Registration of atexit() to call finalization code. + Runtime option flags controlled by the environment variable ESAN_OPTIONS. The common sanitizer flags are supported such as verbosity and log_path. + An initial simple test. Still TODO: common code for libc interceptors and shadow memory mapping, and tool-specific code for shadow state updating. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, vkalintiris, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19168 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-16Introduce stats and stats_client libraries.Peter Collingbourne
This is part of a new statistics gathering feature for the sanitizers. See clang/docs/SanitizerStats.rst for further info and docs. Differential Revision: http://reviews.llvm.org/D16176 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257972 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15Cross-DSO control flow integrity (compiler-rt part).Evgeniy Stepanov
This is an initial version of the runtime cross-DSO CFI support library. It contains a number of FIXMEs, ex. it does not support the diagnostic mode nor dlopen/dlclose, but it works and can be tested. Diagnostic mode, in particular, would require some refactoring (we'd like to gather all CFI hooks in the UBSan library into one function so that we could easier pass the diagnostic information down to __cfi_check). It will be implemented later. Once the diagnostic mode is in, I plan to create a second test configuration to run all existing tests in both modes. For now, this patch includes only a few new cross-DSO tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255695 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-09-29[CFI] Make CFI tests require UBSan (for diagnostic mode).Alexey Samsonov
CFI itself, on the other hand, doesn't require anything, including sanitizer_common. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-14[CMake] Add options to control building sanitizers and builtins.Chris Bieneman
There are situations where a user may want to build only the compiler-rt builtins, or only the sanitizer runtimes. This exposes options to do that. Both default to On, so there should be no implicit change in behavior. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@247607 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-15CFI: Add a default blacklist.Peter Collingbourne
Differential Revision: http://reviews.llvm.org/D11095 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@242287 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02Re-apply r241217 with build fixes:Peter Collingbourne
- Disable building of the interceptor library on 64-bit Windows. - Mangle names in /alternatename directive for 32-bit Windows. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241224 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15Protection against stack-based memory corruption errors using SafeStack: ↵Peter Collingbourne
compiler-rt runtime support library This patch adds runtime support for the Safe Stack protection to compiler-rt (see http://reviews.llvm.org/D6094 for the detailed description of the Safe Stack). This patch is our implementation of the safe stack on top of compiler-rt. The patch adds basic runtime support for the safe stack to compiler-rt that manages unsafe stack allocation/deallocation for each thread. Original patch by Volodymyr Kuznetsov and others at the Dependable Systems Lab at EPFL; updates and upstreaming by myself. Differential Revision: http://reviews.llvm.org/D6096 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-01[UBSan] Embed UBSan into ASan runtime (compiler-rt part).Alexey Samsonov
Summary: Change the way we use ASan and UBSan together. Instead of keeping two separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on a platform, all UBSan sources are just compiled into dummy empty object files. UBSan initialization code (e.g. flag parsing) is directly called from ASan initialization, so we are able to enforce correct initialization order. This mirrors the approach we already use for ASan+LSan. This change doesn't modify the way we use standalone UBSan. Test Plan: regression test suite Reviewers: kubabrecka, zaks.anna, rsmith, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8646 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233861 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-25[LSan] Don't explicitly exclude LSan from Windows build - it should just ↵Alexey Samsonov
produce dummy object files. NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233231 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-18[msan] Remove MSanDR and supporting code.Evgeniy Stepanov
MSanDR is a dynamic instrumentation tool that can instrument the code (prebuilt libraries and such) that could not be instrumented at compile time. This code is unused (to the best of our knowledge) and unmaintained, and starting to bit-rot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222232 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-08-08[CMake] Determine which compiler-rt libraries are supported onAlexey Samsonov
a given platform in a top-level CMakeLists.txt to use it both in lib/ and in test/ subdirectories. Move architecture/platform checks to config-ix. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215247 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09Enable building of sanitizers on FreeBSDViktor Kutuzov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205919 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03tsan: replace deadlock detector custom build script with cmake fileDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202708 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26Revert r201783 until all FreeBSD fixes are submitted.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202244 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20[FreeBSD] Enable building a few runtime libraries on FreeBSD.Alexey Samsonov
Patch by Viktor Kutuzov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201783 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19[CMake] Rudimentary support for standalone CompilerRT build system.Alexey Samsonov
This change allows to build compiler-rt libraries separately from LLVM/Clang (path to LLVM build directory should be specified at configure time). Running tests is not yet supported. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201647 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Simplify code for detecting/setting compiler flagsAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201543 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14Move shared configs for lit test suites to test/ and unittests/ directoriesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201399 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14Move original compiler-rt functions (libgcc replacement) to lib/builtins ↵Alexey Samsonov
directory git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201393 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31Sorting ARM Sources alphabeticallyRenato Golin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200552 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-17[ASan] Build ASan on Windows only if MSVC is usedAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194963 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17CMake: don't build sanitizer runtimes on 64-bit Windows (it's unsupported ↵Alexey Samsonov
for now) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15Don't build unsupported compiler-rt pieces on WindowsAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194796 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02[CMake] Don't build sanitizer runtimes if LLVM_USE_SANITIZER is specifiedAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189745 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27cmake: fix the compiler-rt build with MSVCHans Wennborg
This sets flags and excludes things that aren't working with MSVC yet, allowing us to build the ASan runtime as part of the cmake build. Differential Revision: http://llvm-reviews.chandlerc.com/D1525 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189304 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07DataFlowSanitizer; compiler-rt changes.Peter Collingbourne
DataFlowSanitizer is a generalised dynamic data flow analysis. Unlike other Sanitizer tools, this tool is not designed to detect a specific class of bugs on its own. Instead, it provides a generic dynamic data flow analysis framework to be used by clients to help detect application-specific issues within their own code. Differential Revision: http://llvm-reviews.chandlerc.com/D967 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187924 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-06[ASan] create common autogenerated config for running compiler-rt unit ↵Alexey Samsonov
tests, and use it in ASan git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183401 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-06[ASan] lit tests: create common autogenerated config for running compiler-rt ↵Alexey Samsonov
lit tests, and use it in ASan git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183400 91177308-0d34-0410-b5e6-96231b3b80d8