summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* [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-012-1/+22
| | | | | | | 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
* [builtins] Prevent duplicate definitions for overridden functionsFrancis Ricci2017-08-302-32/+32
| | | | | | | | | | | | | | | Summary: Some architecture-specific function overrides (for example, i386/ashrdi3.S) duplicate generic functions (in that case, ashrdi3.c). Prevent duplicate definitions by filtering out the generic files before compiling. Reviewers: compnerd, beanz Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D37166 llvm-svn: 312140
* 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
* Reland r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-281-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 llvm-svn: 311924
* Proper dependency check for clang in compiler_rt.George Karpenkov2017-08-281-1/+1
| | | | | | | | | | - Not having a dependency does not work in standalone build, as Clang does not exist. - if (TARGET clang) check is useless, as it is order-dependent, and Clang may not be registered yet. Differential Revision: https://reviews.llvm.org/D37228 llvm-svn: 311911
* Revert r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-271-0/+3
| | | | | | | The required change in clang is being reverted because of the Android build bot failure. llvm-svn: 311859
* [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-271-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 llvm-svn: 311842
* Revert "Add Clang dependency to the check for Clang C++ headers."Adrian Prantl2017-08-251-4/+6
| | | | | | | This temporarily reverts commit r311733, because of bot breakage. http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/38139/consoleFull#-256426522e9a0fee5-ebcc-4238-a641-c5aa112c323e llvm-svn: 311757
* Add Clang dependency to the check for Clang C++ headers.George Karpenkov2017-08-241-6/+4
| | | | | | | | | | | | | | | | | The problem is that CMake is mostly imperative and the result of processing "if (TARGET blah)" checks depends on the order of import of CMake files. In this case, "projects" folder is registered before "tools", and calling "CheckClangHeaders" [renamed to have a better name] errors out without even giving Clang a chance to be built. This, in turn, leads to libFuzzer bot failures in some circumstances on some machines (depends on whether LIT or UNIT tests are scheduled first). Differential Revision: https://reviews.llvm.org/D37126 llvm-svn: 311733
* 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
* [CMake compiler-rt] NFC: Minor CMake refactoring.George Karpenkov2017-08-151-2/+6
| | | | | | | | | Detect ObjC files in `clang_compile` and pass an appropriate flag to a compiler, also change `clang_compile` to a function. Differential Revision: https://reviews.llvm.org/D36727 llvm-svn: 310945
* [compiler-rt CMake] NFC: Minor CMake refactoring.George Karpenkov2017-08-151-9/+6
| | | | | | | | | | Change macro to a function, and use a generic variable instead of branching for handling multi-output build with CMAKE_CONFIGURATION_TYPES. Differential Revision: https://reviews.llvm.org/D36725 llvm-svn: 310944
* [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
* Revert rL309634 until upstream buildbots have upgraded libc.Sterling Augustine2017-08-011-6/+0
| | | | llvm-svn: 309704
* Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine2017-07-311-0/+6
| | | | | | | | | | | | | | Summary: Add powerpc64 to compiler-rt build infrastructure. Reviewers: timshen Reviewed By: timshen Subscribers: nemanjai, dberris, mgorny, aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D36108 llvm-svn: 309634
* [sanitizer tests CMake] Factor out CMake logic for compiling sanitizer testsGeorge Karpenkov2017-07-281-0/+35
| | | | | | | | | | | Currently there's a large amount of CMake logic duplication for compiling sanitizer tests. If we add more sanitizers, the duplication will get even worse. This change factors out common compilation commands into a macro available to all sanitizers. llvm-svn: 309405
* Support compiler-rt builtinsPetr Hosek2017-07-281-0/+21
| | | | | | | | | This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 llvm-svn: 309361
* [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
* Revert "[sanitizer] Support compiler-rt builtins"Petr Hosek2017-07-261-21/+0
| | | | | | This reverts commit fd63314d6770e0da62572a3fea2c41c4cc0fc58a. llvm-svn: 309083
* [sanitizer] Support compiler-rt builtinsPetr Hosek2017-07-251-0/+21
| | | | | | | | | This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 llvm-svn: 309060
* Fix the declaration of DARWIN_PREFER_PUBLIC_SDK cmake variable (move before ↵Kuba Mracek2017-07-121-1/+2
| | | | | | the return). llvm-svn: 307815
* [cmake] Cache results of find_darwin_sdk_dirKuba Mracek2017-07-071-0/+6
| | | | | | | | This improves find_darwin_sdk_dir to cache the results of executing xcodebuild to find the SDK. Should significantly reduce the CMake re-configure time. Differential Revision: https://reviews.llvm.org/D34736 llvm-svn: 307344
* [cmake] Add an option to prefer public SDK in find_darwin_sdk_dirKuba Mracek2017-07-061-8/+11
| | | | | | | | Adds a CMake option DARWIN_PREFER_PUBLIC_SDK, off by default. When on, this prefers to use the public SDK, even when an internal one is present. With this, it's easy to emulate a build that the public buildbots are doing. Differential Revision: https://reviews.llvm.org/D35071 llvm-svn: 307330
* Roll back r301831 to fix broken powerpc64le tests.Sterling Augustine2017-05-021-6/+0
| | | | | | http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/5941 llvm-svn: 301935
* Add powerpc64 and powerpc64le to build infrastructure.Sterling Augustine2017-05-011-0/+6
| | | | | | From Phab D32031. llvm-svn: 301831
* [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
* [compiler-rt] respect CMAKE_EXE_LINKER_FLAGS in compiler and library testsBob Haarman2017-03-212-4/+7
| | | | | | | | | | | | | | Summary: check_cxx_compiler_flag and check_library_exists could fail because they ignored CMAKE_EXE_LINKER_FLAGS and therefore would always fail to produce executables. Cmake policy CMP0056 fixes this, but was explicitly set to OLD in our CMakeLists because it caused problems with test_target_arch. This change sets the policy to NEW to fix the problem with the compiler and library tests, and temporarily clears CMAKE_EXE_LINKER_FLAGS inside test_target_arch to emulate the old behavior there. This allows, for example, LTO builds that require lld to succeed. Reviewers: davidxl, beanz Reviewed By: beanz Subscribers: fjricci, dberris, mgorny, mehdi_amini, tejohnson, rnk, llvm-commits Differential Revision: https://reviews.llvm.org/D31098 llvm-svn: 298413
* [Compiler-rt] Broken compiler-rt CMake configuring on WindowsOleg Ranevskyy2017-01-261-1/+2
| | | | | | | | | | | | | | | | | | | | Summary: Hi Michal, Would you be able to review this simple fix, please? Since r291504 compiler-rt uses `llvm-config --cmakedir` to get the path to the LLVM CMake modules. On Windows this option returns Windows style path with backslashes. CMake treats backslashes as beginning of an escaped character and thus fails to append the path to `CMAKE_MODULE_PATH`. Reviewers: compnerd, mgorny Reviewed By: mgorny Subscribers: compnerd, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D28908 llvm-svn: 293195
* 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-105-15/+15
| | | | | | | | | | | | | | | | | | | 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
* [cmake] Obtain LLVM_CMAKE_PATH from llvm-config if availableMichal Gorny2017-01-091-2/+12
| | | | | | | | Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from llvm-config. Fallback to local reconstruction if llvm-config does not support this option. llvm-svn: 291504
* Enable weak hooks on darwinFrancis Ricci2017-01-091-0/+11
| | | | | | | | | | | | | | | | 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 llvm-svn: 291417
* Revert "Enable weak hooks on darwin"Francis Ricci2017-01-071-9/+0
| | | | | | | | Reverts accidental upload. This reverts commit 421408c0f2cc811bcf9a945be6e95e46f76cb358. llvm-svn: 291316
* Enable weak hooks on darwinFrancis Ricci2017-01-071-0/+9
| | | | | | | | | | | | | | | | 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 llvm-svn: 291314
* [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
* [compiler-rt] Support building builtins for a single targetPetr Hosek2016-12-121-3/+21
| | | | | | | | | This is used when building builtins for multiple targets as part of LLVM runtimes. Differential Revision: https://reviews.llvm.org/D26653 llvm-svn: 289489
* Remove a VS 2012 workaround, we require 2015 now.Nico Weber2016-10-251-6/+0
| | | | llvm-svn: 285096
* cfi: Fixes for check-cfi when configured as an external project.Peter Collingbourne2016-09-221-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D24817 llvm-svn: 282189
* [CMake] Rename back SIMPLE_SOURCE to compile as C++Jonas Hahnfeld2016-09-211-1/+5
| | | | | | | | | | | | | This was changed in rL276151 and causes problems if the C++ compiler does not support the same arches as the C compiler. For the builtins, only the C compiler is tested in try_compile_only. Additionally, -fno-exceptions is passed in (if available) to work around the case where no libunwind is available. Differential Revision: https://reviews.llvm.org/D23654 llvm-svn: 282054
* Revert "[CMake] Explicitly add --target option to compiler flags"Chris Bieneman2016-09-201-12/+0
| | | | | | | | | This reverts commit r282024. This broke some bots, and I'm going to revert while I figure it out. See: http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/21120 llvm-svn: 282033
OpenPOWER on IntegriCloud