summaryrefslogtreecommitdiff
path: root/cmake/Modules/SanitizerUtils.cmake
AgeCommit message (Collapse)Author
2018-06-28Support for multiarch runtimes layoutPetr Hosek
This change adds a support for multiarch style runtimes layout, so in addition to the existing layout where runtimes get installed to: lib/clang/$version/lib/$os Clang now allows runtimes to be installed to: lib/clang/$version/$target/lib This also includes libc++, libc++abi and libunwind; today those are assumed to be in Clang library directory built for host, with the new layout it is possible to install libc++, libc++abi and libunwind into the runtime directory built for different targets. The use of new layout is enabled by setting the LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both projects and runtimes layouts. The runtimes CMake build has been further modified to use the new layout when building runtimes for multiple targets. Differential Revision: https://reviews.llvm.org/D45604 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335809 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-27[CMake] Tidy up the organisation of compiler-rt when configured as a standaloneDan Liew
build with an IDE (e.g. Xcode) as the generator. Previously the global `USE_FOLDERS` property wasn't set in standalone builds leading to existing settings of FOLDER not being respected. In addition to this there were several targets that appeared at the top level that were not interesting and clustered up the view. These have been changed to be displayed in "Compiler-RT Misc". Now when an Xcode project is generated from a standalone compiler-rt build the project navigator is much less cluttered. The interesting libraries should appear in "Compiler-RT Libraries" in the IDE. Differential Revision: https://reviews.llvm.org/D48378 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335728 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-25[UBsan] Enable ubsan minimal unit tests on OpenBSDDavid Carlier
OpenBSD needs lld linker for sanitisers. Disabling lint checking as some symbols cannot be defined and block the proper unit tests launch. Reviewers: lebedev.ri, vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D48528 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335524 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10Make cmake link flag naming consistentFrancis Ricci
Summary: The build system was inconsistent in its naming conventions for link flags. This patch changes all uses of LINKFLAGS to LINK_FLAGS, for consistency with cmake's LINK_FLAGS property. This patch should make it easier to search the source code for uses of link flags, as well as providing the benefit of improved style and consistency. Reviewers: compnerd, beanz Subscribers: kubabrecka, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28506 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291539 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09Enable weak hooks on darwinFrancis Ricci
Summary: By default, darwin requires a definition for weak interface functions at link time. Adding the '-U' link flag with each weak function allows these weak interface functions to be used without definitions, which mirrors behavior on linux and windows. Reviewers: compnerd, eugenis Subscribers: kubabrecka, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28203 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07Revert "Enable weak hooks on darwin"Francis Ricci
Reverts accidental upload. This reverts commit 421408c0f2cc811bcf9a945be6e95e46f76cb358. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291316 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07Enable weak hooks on darwinFrancis Ricci
Summary: By default, darwin requires a definition for weak interface functions at link time. Adding the '-U' link flag with each weak function allows these weak interface functions to be used without definitions, which mirrors behavior on linux and windows. Reviewers: compnerd, eugenis Subscribers: kubabrecka, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28203 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09[CMake] Cleanup CMake version checkingChris Bieneman
CMAKE_VERSION is always greater than 3.0 now. No reason not to remove the extra compatibility code. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06Use `CMAKE_HOST_UNIX` to check the host.Sean Silva
`UNIX` is for the target. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265595 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17[CMake] Remove bash-ism in SanitizerLintCheckAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27[CMake] Add ARCHS option to add_sanitizer_rt_symbols.Chris Bieneman
Summary: This is another step in a multi-step refactoring to move add_sanitizer_rt_symbols in the direction of other add_* functions in compiler-rt. Changes to CMakeLists files are all minimal except ubsan which tests the new ARCHS loop. Further cleanup patches will follow. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12410 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246199 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27[CMake] Add PARENT_TARGET option to add_sanitizer_rt_symbols.Chris Bieneman
Summary: This is another step in a multi-step refactoring to move add_sanitizer_rt_symbols in the direction of other add_* functions in compiler-rt. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12409 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246178 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26[CMake] Converting add_sanitizer_rt_symbols to use cmake_parse_arguments.Chris Bieneman
Summary: This is the first step in a multi-step refactoring to move add_sanitizer_rt_symbols in the direction of other add_* functions in compiler-rt. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12386 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246102 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-05-05[asan] Use a version script to limit the symbols exported by the ASan shared ↵Evgeniy Stepanov
runtime library. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@236551 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21fixed check_lint.sh in standalone buildGreg Fitzgerald
Change-Id: I30d340bbe6b2028cc0f831399b62521912dcac60 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04[CMake] Port add_sanitizer_rt_symbols to CMake 3.0Alexey Samsonov
Patch by Brad King. Our add_sanitizer_rt_symbols macro reads the LOCATION property of a library to compute the location of the "lib<name>.a.syms" file to generate next to the corresponding "lib<name>.a" library file. CMake 3.0 introduces policy CMP0026 to disallow reading of the LOCATION target property from non-imported targets in favor of the more powerful $<TARGET_FILE> generator expression. Teach add_sanitizer_rt_symbols to use the $<TARGET_FILE> generator expression to compute the location of the symbols file to generate with a custom command. CMake 3.0 also adds support for generator expressions to install(FILES) so use it when available to simplify installation of the symbols file of the proper configuration. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202797 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04[CMake] Fix add_sanitizer_rt_symbols on multi-config CMake generators.Alexey Samsonov
Patch by Brad King. When using a multi-config generator with CMake, such as for VS or Xcode, the LOCATION target property value contains a placeholder such as "$(Configuration)" that is meant for substitution by the native build tool. The install(FILES) command does not understand this name and will not install the symbols file correctly when using these generators. Teach add_sanitizer_rt_symbols to read the more-specific target property LOCATION_<CONFIG> that has a per-configuration value and no placeholder. On single-configuration generators (Makefile, Ninja), CMAKE_BUILD_TYPE contains the name of the one configuration to be built. On multi-config generators (VS, Xcode), CMAKE_CONFIGURATION_TYPES contains the list of possible configurations. In the latter case, loop over the configs and add a configuration-specific install(FILES) rule for each one. Place the code block inside an if(TRUE) block so it can be made conditional in a following change without updating indentation. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202796 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
2013-10-01Add top-level CMake 'compiler-rt' target to build all compiler-rt librariesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191747 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29[sanitizer] Refine CMake rules for generating exported symbols and lint checkingAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189577 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-28sanitizer_common: Use PYTHON_EXECUTABLE to choose appropriate python.Will Dietz
Fixes build on systems where 'python' is not python2. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189486 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27Properly generate lists of exported symbols for sanitizer runtimesAlexey Samsonov
This change adds a Python script that is invoked for the just-built sanitizer runtime to generate the list of exported symbols passed to the linker. By default, it contains interceptors and sanitizer interface functions, but can be extended with tool-specific lists. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189356 91177308-0d34-0410-b5e6-96231b3b80d8