summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake/Modules/AddCompilerRT.cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[CMake] Install resource files into a share/ directory"Petr Hosek2018-01-101-1/+1
| | | | | | This reverts commit r322153 because it broke the sanitizer bots. llvm-svn: 322156
* [CMake] Install resource files into a share/ directoryPetr Hosek2018-01-101-1/+1
| | | | | | | | | | | Currently these files are being installed into a root installation directory, but this triggers an error when the installation directory is set to an empty string which is often the case when DESTDIR is used to control the installation destination. Differential Revision: https://reviews.llvm.org/D41673 llvm-svn: 322153
* [CMake] Allow passing extra CMake arguments to custom libc++Petr Hosek2017-12-211-1/+2
| | | | | | | | This can be used to customize the libc++ build. Differential Revision: https://reviews.llvm.org/D41103 llvm-svn: 321299
* [CMake] Support runtimes and monorepo layouts when looking for libcxxPetr Hosek2017-12-121-1/+1
| | | | | | | | | This also slightly refactors the code that's checking the directory presence which allows eliminating one unnecessary variable. Differential Revision: https://reviews.llvm.org/D40637 llvm-svn: 320446
* [compiler-rt] Add install-*-stripped targetsShoaib Meenai2017-12-011-0/+16
| | | | | | | | | | | These targets strip during installation, and are required to support install-distribution-stripped in LLVM (to support a stripped distribution). LLVM has an add_llvm_install_targets function for this purpose, but we can't rely on LLVM being present. Differential Revision: https://reviews.llvm.org/D40687 llvm-svn: 319569
* [sanitizer] Refactor how assembly files are handledKuba Mracek2017-11-291-0/+11
| | | | | | | | This renames ASM_TSAN_SYMBOL and ASM_TSAN_SYMBOL_INTERCEPTOR to just ASM_SYMBOL and ASM_SYMBOL_INTERCEPTOR, because they can be useful in more places than just TSan. Also introduce a CMake function to add ASM sources to a target. Differential Revision: https://reviews.llvm.org/D40143 llvm-svn: 319339
* Allow compiler-rt test targets to work with multi-config CMake generatorsGreg Bedwell2017-11-131-0/+11
| | | | | | | | | | Multi-config CMake generators need lit to be able to resolve paths of artifacts from previous build steps at lit time, rather than expect them to be fully resolved at CMake time as they may contain the build mode. Differential Revision: https://reviews.llvm.org/D38471 llvm-svn: 318037
* [cmake] Work around more -Wunused-driver-argument warningsVedant Kumar2017-09-071-1/+8
| | | | | | | add_compiler_rt_object_libraries should strip out the -msse3 option on non-macOS Apple platforms. llvm-svn: 312688
* [cmake] Remove accidentally committed warning messagesVedant Kumar2017-09-011-2/+0
| | | | llvm-svn: 312393
* [cmake] Work around -Wunused-driver-argument warningsVedant Kumar2017-09-011-0/+8
| | | | | | | Fix the Darwin logic so that -msse3 is only used on macOS, and -fomit-frame-pointer is not used on armv7/armv7k/armv7s. llvm-svn: 312390
* Restore clang_rt library name on i686-android.Evgeniy Stepanov2017-08-291-3/+11
| | | | | | | | | | | | | | | | | Summary: Recent changes canonicalized clang_rt library names to refer to "i386" on all x86 targets. Android historically uses i686. This change adds a special case to keep i686 in all clang_rt libraries when targeting Android. Reviewers: hans, mgorny, beanz Subscribers: srhines, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D37278 llvm-svn: 312048
* Move libFuzzer to compiler_rt.George Karpenkov2017-08-211-4/+3
| | | | | | | | | 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 llvm-svn: 311407
* [NFC CMake] Do not relink test targets every time in compiler-rtGeorge Karpenkov2017-08-211-6/+9
| | | | | | | | | | | | | CMake's add_custom_target is considered to be *always* out of date. This patch changes it to a combination of add_custom_target and add_custom_command which actually tracks dependencies' timestamps. On my machine this reliably saves 6-7 seconds on each test group. This can be a large difference when debugging small tests. Differential Revision: https://reviews.llvm.org/D36912 llvm-svn: 311384
* Quickfix to the refactoring commit: typo in the link flags variableGeorge Karpenkov2017-08-151-1/+1
| | | | | | name. llvm-svn: 310973
* [sanitizers CMake] NFC Refactor the logic for compiling and generating testsGeorge Karpenkov2017-08-151-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | into a function. Most CMake configuration under compiler-rt/lib/*/tests have almost-the-same-but-not-quite functions of the form add_X_[unit]tests for compiling and running the tests. Much of the logic is duplicated with minor variations across different sub-folders. This can harm productivity for multiple reasons: For newcomers, resulting CMake files are very large, hard to understand, and hide the intention of the code. Changes for enabling certain architectures end up being unnecessarily large, as they get duplicated across multiple folders. Adding new sub-projects requires more effort than it should, as a developer has to again copy-n-paste the configuration, and it's not even clear from which sub-project it should be copy-n-pasted. With this change the logic of compile-and-generate-a-set-of-tests is extracted into a function, which hopefully makes writing and reading CMake much easier. Differential Revision: https://reviews.llvm.org/D36116 llvm-svn: 310971
* [compiler-rt CMake] CMake refactoring: create directories in helper func.George Karpenkov2017-08-151-5/+7
| | | | | | | | | Change macro to a function, move creating test directory into `add_compiler_rt_test`. Differential Revision: https://reviews.llvm.org/D36724 llvm-svn: 310943
* [sanitizers] Sanitizer tests CMake clean up: try #2George Karpenkov2017-07-281-4/+1
| | | | | | | | | | | | | | | | | This patch addresses two issues: Most of the time, hacks with `if/else` in order to get support for multi-configuration builds are superfluous. The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it expands to `.` on all single-configuration builds, and to a configuration name otherwise. The `if/else` hacks for the library name generation should also not be done, as CMake has `TARGET_FILE` generator expression precisely for this purpose, as it expands to the exact filename of the resulting target. Differential Revision: https://reviews.llvm.org/D35952 llvm-svn: 309341
* Revert "[sanitizers] Sanitizer tests CMake clean up"George Karpenkov2017-07-271-1/+4
| | | | | | | | This reverts commit 0ab44db2aa1cd3710355ad79b04f954ce68c0b3a. Fails on some bots, reverting until I can fix it. llvm-svn: 309318
* [sanitizers] Sanitizer tests CMake clean upGeorge Karpenkov2017-07-271-4/+1
| | | | | | | | | | | | | | | | | This patch addresses two issues: Most of the time, hacks with `if/else` in order to get support for multi-configuration builds are superfluous. The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it expands to `.` on all single-configuration builds, and to a configuration name otherwise. The `if/else` hacks for the library name generation should also not be done, as CMake has `TARGET_FILE` generator expression precisely for this purpose, as it expands to the exact filename of the resulting target. Differential Revision: https://reviews.llvm.org/D35952 llvm-svn: 309306
* [asan] Add support for running lit tests in the iOS SimulatorKuba Mracek2017-04-261-0/+8
| | | | | | | | This patch adds a basic support for running the ASan lit test suite against an iOS Simulator. This is done by generating more lit.site.cfg configurations into subdirectories such as IOSSimI386Config and IOSSimX86_64Config. These test suites are not added into "check-all" or into "check-asan", they have to be run manually. Differential Revision: https://reviews.llvm.org/D31477 llvm-svn: 301443
* [compiler-rt] build compiler-rt runtimes without LTOBob Haarman2017-03-221-2/+9
| | | | | | | | | | | | | | Summary: Currently, we build the compiler-rt runtimes with link-time optimization if LTO is configured for the LLVM project. This will break external programs that don't invoke the linker in such a way that it supports LLVM's LTO. To avoid this, this change causes the compiler-rt runtimes to be compiled with -fno-lto. This also makes the check-profile tests work on systems when doing a lld LTO build on a system where the system linker does not support LLVM LTO. Reviewers: rnk, davidxl Reviewed By: davidxl Subscribers: dberris, mgorny, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D31218 llvm-svn: 298525
* Reland "[CMake][compiler-rt] Mark libcxx build for tsan as standalone"Petr Hosek2017-01-161-0/+1
| | | | | | This relands commit r291722. llvm-svn: 292083
* Revert "[CMake][compiler-rt] Mark libcxx build for tsan as standalone"Petr Hosek2017-01-121-1/+0
| | | | | | This reverts commit 08dbefb847bb765b387c67dc2dc2ef90a4927312. llvm-svn: 291730
* [CMake][compiler-rt] Mark libcxx build for tsan as standalonePetr Hosek2017-01-111-0/+1
| | | | | | | | This is to ensure that the libcxx build is properly configured. Differential Revision: https://reviews.llvm.org/D28579 llvm-svn: 291722
* Make cmake link flag naming consistentFrancis Ricci2017-01-101-6/+6
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 291539
* [gtest] Teach the sanitizer's custom gtest compilations to disableChandler Carruth2017-01-051-0/+1
| | | | | | | | | | a warning that 'gtest-all.cc' directly triggers in the newer 1.8.0 version. This should fix a warning in folks' build and bring a couple of -Werror bots back to life. llvm-svn: 291070
* Remove a VS 2012 workaround, we require 2015 now.Nico Weber2016-10-251-6/+0
| | | | llvm-svn: 285096
* [compiler-rt] Fix library suffixes on windowsFrancis Ricci2016-09-071-2/+8
| | | | | | | | | | | | | | | Summary: Make sure that windows libraries contain the suffixes expected by clang. This is expecially important when compiling the windows builtins with clang, as cmake will use .a as the suffix by default. Reviewers: beanz, compnerd Subscribers: llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D24046 llvm-svn: 280854
* [CMake] Connect Compiler-RT targets to LLVM Runtimes directoryChris Bieneman2016-08-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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). llvm-svn: 279863
* [CMake] Add top-level install-compiler-rt targetChris Bieneman2016-08-191-0/+1
| | | | | | This is a wrapper target of all the component install targets. This wrapper target will be used by the new LLVM runtimes directory to connect top-level targets to the runtime project target. llvm-svn: 279333
* [compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron2016-07-111-24/+34
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 275111
* [compiler-rt] Split cflags and link flags to avoid warningsEtienne Bergeron2016-06-211-1/+2
| | | | | | | | | | | | | | Summary: The MSVC compiler is complaining about invalid flags. The CFLAGS are passed to the linker (i.e. /Gy-, ...). Reviewers: rnk Subscribers: llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21554 llvm-svn: 273265
* [compiler-rt] Fix multi-configuration output pathsEtienne Bergeron2016-05-161-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When using a multi-configuration build (i.e. MSVC) the output path where libraries are dropped is incorrect. Example: ``` C:\src\llvm\examples>d:\src\llvm\build\Release\bin\clang-cl.exe -fsanitize=address test.cc LINK : fatal error LNK1181: cannot open input file 'd:\src\llvm\build\Release\bin\..\lib\clang\3.9.0\lib\windows\clang_rt.asan-i386.lib' ``` The dropped executable path contains the configuration 'Release': ``` 'd:\src\llvm\build\Release\bin\..\lib\clang\3.9.0\lib\windows\Release\clang_rt.asan-i386.lib' ``` The variable 'RUNTIME_OUTPUT_DIRECTORY' is used to specify the output directory. But CMAKE is appending the current configuration (i.e. Debug, Release). see: https://cmake.org/cmake/help/v3.0/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.html ``` "Multi-configuration generators (VS, Xcode) append a per-configuration subdirectory to the specified directory." ``` To avoid this problem, the configuration specific variable must be set: 'RUNTIME_OUTPUT_DIRECTORY_DEBUG', 'RUNTIME_OUTPUT_DIRECTORY_RELEASE', and so on. Reviewers: ddunbar, chapuni, rnk Subscribers: kubabrecka, llvm-commits Differential Revision: http://reviews.llvm.org/D20261 llvm-svn: 269658
* [CMake] Provide the ability to skip stripping when generating dSYMsChris Bieneman2016-03-311-1/+5
| | | | | | For debugging it is useful to be able to generate dSYM files but not strip the executables. This change adds the ability to skip stripping by setting COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP=On. llvm-svn: 265057
* [CMake] Fix a typo in add_compiler_rt_library.Alexey Samsonov2016-02-261-1/+1
| | | | llvm-svn: 262063
* [CMake] Support component-based installation for runtime librariesChris Bieneman2016-02-231-2/+38
| | | | | | This enables targets like "install-ubsan" and "install-asan" to install all associated runtime libraries. llvm-svn: 261700
* [CMake] Assign components and dependencies during add_compiler_rt_resource_fileChris Bieneman2016-02-231-2/+5
| | | | | | This makes it so that component-based installations will include resource files (i.e. blacklists). My next patch will add support for component-based installations. llvm-svn: 261699
* [CMake] Push the dependency on AddLLVM into the test and unites layersChris Bieneman2016-02-171-1/+0
| | | | | | Compiler-rt only relies on LLVM for lit support. Pushing this dependency down into the test and unitest layers will allow builtin libraries to be built without LLVM. llvm-svn: 261105
* [compiler-rt] add_custom_libcxx should pass LLVM_PATH and a C++ compilerDaniel Sanders2016-02-021-1/+2
| | | | | | | | | | Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16681 llvm-svn: 259493
* [compiler-rt] list_union() is actually an intersect operation. Rename it.Daniel Sanders2016-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: Given: set(T1 a b c) set(T2 b c d) message("T1=${T1}") message("T2=${T2}") list_union(T3 T1 T2) message("T3=${T3}") cmake emitted: T1=a;b;c T2=b;c;d T3=b;c Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16580 llvm-svn: 258916
* Fix the cross compilation of unit tests. NFC (second attempt)Sumanth Gundapaneni2016-01-141-4/+7
| | | | | | | | | | | | | | | | With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compiling environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision: http://reviews.llvm.org/D16165 llvm-svn: 257783
* Revert r257686 "With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross ↵Hans Wennborg2016-01-131-7/+4
| | | | | | | | | | | | | | | compiling" This broke the build. For example, from http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/1191/steps/cmake%20stage%201/logs/stdio: -- Compiler-RT supported architectures: aarch64 CMake Error at projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:170 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): projects/compiler-rt/lib/CMakeLists.txt:4 (include) llvm-svn: 257694
* With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compilingSumanth Gundapaneni2016-01-131-4/+7
| | | | | | | | | | | | | | | environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision:http://reviews.llvm.org/D15082 llvm-svn: 257686
* [CMake] CMake calls to set_property with APPEND string need to have a ↵Chris Bieneman2015-12-031-1/+1
| | | | | | leading space. llvm-svn: 254660
* [CMake] set_target_properties doesn't append link flagsChris Bieneman2015-12-031-1/+1
| | | | | | This fixes a bug I introduced in r254643. llvm-svn: 254658
* [CMake] Support externalizing debug info on DarwinChris Bieneman2015-12-031-0/+25
| | | | | | | | * Adds COMPILER_RT_EXTERNALIZE_DEBUGINFO option * On Darwin this results in calling dsymutil and strip after linking * This generates an error on non-darwin platforms, matching the LLVM behavior llvm-svn: 254643
* Pass along correct 'make' to sub-builds.Andy Gibbs2015-12-021-1/+2
| | | | | | | | If the top-level cmake has a custom make specified through -DCMAKE_MAKE_PROGRAM then this must be passed along to the sub-build processes in compiler-rt or the build process will fail. llvm-svn: 254509
* [CMake] Add OBJECT_LIBS option to add_compiler_rt_runtime, and refactored ↵Chris Bieneman2015-08-261-2/+16
| | | | | | | | | | | | | | asan call site to use it. Summary: This is one more step to allow us to eliminate platform-specific code from the library CMakeLists files. Subsequent patches will refactor all call sites to use this and other new features. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12339 llvm-svn: 246047
* [CMake] merge add_compiler_rt_runtime and add_compiler_rt_darwin_runtime ↵Chris Bieneman2015-08-251-70/+91
| | | | | | | | | | | | | | | | 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 llvm-svn: 245970
* [CMake] Refactoring add_compiler_rt functions for darwin runtimes.Chris Bieneman2015-08-181-39/+37
| | | | | | | | | | | | Summary: This patch consolidates add_compiler_rt_osx_static_runtime and add_compiler_rt_darwin_dynamic_runtime into a single new function add_compiler_rt_darwin_runtime. Reviewers: filcab, samsonov, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12106 llvm-svn: 245317
OpenPOWER on IntegriCloud