summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTUtils.cmake
AgeCommit message (Collapse)Author
2017-11-30Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine
Now that we have disabled the run-forever tests, and cleaned up the intel 80-bit float based tests, we should be able to enable testing compiler-rt for powerpc64. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319474 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-30[builtins] Prevent duplicate definitions for overridden functionsFrancis Ricci
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312140 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-28Reland r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311924 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27Revert r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
The required change in clang is being reverted because of the Android build bot failure. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27[cmake] Remove i686 target that is duplicate to i386Michal Gorny
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-01Revert rL309634 until upstream buildbots have upgraded libc.Sterling Augustine
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02Roll back r301831 to fix broken powerpc64le tests.Sterling Augustine
http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/5941 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301935 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-01Add powerpc64 and powerpc64le to build infrastructure.Sterling Augustine
From Phab D32031. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21[compiler-rt] respect CMAKE_EXE_LINKER_FLAGS in compiler and library testsBob Haarman
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26[Compiler-rt] Broken compiler-rt CMake configuring on WindowsOleg Ranevskyy
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293195 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-09[cmake] Obtain LLVM_CMAKE_PATH from llvm-config if availableMichal Gorny
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-12[compiler-rt] Support building builtins for a single targetPetr Hosek
This is used when building builtins for multiple targets as part of LLVM runtimes. Differential Revision: https://reviews.llvm.org/D26653 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@289489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22cfi: Fixes for check-cfi when configured as an external project.Peter Collingbourne
Differential Revision: https://reviews.llvm.org/D24817 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21[CMake] Rename back SIMPLE_SOURCE to compile as C++Jonas Hahnfeld
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20Revert "[CMake] Explicitly add --target option to compiler flags"Chris Bieneman
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20[CMake] Explicitly add --target option to compiler flagsChris Bieneman
Summary: Much of the non-Darwin build system assumes that COMPILER_RT_DEFAULT_TARGET_TRIPLE is the default target triple for the compiler being used. With clang as your compiler this isn't necessarily true. To ensure that the rest of the build system behaves as expected this patch adds "--target=${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" to the compiler flags for C, CXX and ASM sources. Reviewers: compnerd, rengolin, fjricci Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24156 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14[cmake] Support overriding llvm-config query resultsMichal Gorny
Support overriding LLVM_* variables obtained from llvm-config when doing stand-alone builds. The override of LLVM_MAIN_SRC_DIR is necessary to provide LLVM sources when the initial directory used to build LLVM does no longer exist when compiler-rt is built stand-alone. This is especially the case when building the projects separately in temporary directories with unpredictable names. The code is based on existing CMakeLists.txt from clang. Alike clang, it extends the override to all queried variables. Differential Revision: https://reviews.llvm.org/D24005 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22[cmake] Fix append_rtti_flag macro and bad var nameFilipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279450 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-08-02[CMake] Load LLVMConfig for standalone build of builtinsJonas Hahnfeld
Therefore move some code into reusable macros. Differential Revision: https://reviews.llvm.org/D22866 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22[compiler-rt][cmake] Don't reset CAN_TARGET_${arch} on every cmake invocation.Daniel Sanders
Allowing this variable to be cached makes it possible to repair the MIPS buildbots in lieu of either fixing the mips64 sanitizer issues or fixing the detection of mips64 support (which I think was changed by r268977 but didn't take effect on this buildbot until the last couple days) so that it returns to not being built on these buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[compiler-rt] Fix target architecture matchingFrancis Ricci
Summary: Use stricter comparisons for architecture. This prevents cmake from failing for sysroots which can only compile armhf and not arm, since arm MATCHES armhf is true, while arm STREQUAL armhf is false. Reviewers: beanz, compnerd Subscribers: aemerson, llvm-commits Differential Revision: https://reviews.llvm.org/D22473 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21[compiler-rt] Split cflags and link flags to avoid warningsEtienne Bergeron
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03[CMake] detect_target_arch needs to be moved to UtilsChris Bieneman
This macro is called from the base config, so it can't live in config-ix, it needs to be in the utils. I suspect the only reason this hasn't caused problems is that nobody is building the Android builtins from the builtins subdirectory. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271693 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03[CMake] NFC. Add support for testing the compiler without testing the linkerChris Bieneman
Summary: One of the big limitations we have in the compiler-rt build system today is that we cannot bootstrap building the builtins because you need a fully functional toolchain to pass CMake's tests. This change adds support for compile only tests. It is NFC because nothing is using the compile-only tests yet. I believe this is the last separable part of D16653. Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19692 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28[CMake] Adding some missing CMake includes. NFC.Chris Bieneman
This happens to be working now because the includes exist in another CMake file that is included before this one. That will change with upcoming refactoring. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267912 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
2016-02-17[CMake] [NFC] Move macro definitions out of config-ix.cmakeChris Bieneman
This change should have no functional impact, it just moves some macro definitions out of config-ix.cmake into CompilerRTUtils.cmake. This step will allow these macros to be re-used by the separated builtin build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27[compiler-rt] list_union() is actually an intersect operation. Rename it.Daniel Sanders
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258916 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-13[CMake] Add experimental support for building compiler-rt for iOSChris Bieneman
Summary: This is a reunification of three separate reviews D11073, D11082, D11083. Having them separate was not constructive even though the patches were smaller because it led to fragmented conversations, and this is really all about one change. This patch incorporates feedback from samsonov, and refactors the hacky darwin code out of the root CMakeLists.txt and int config-ix.cmake. Reviewers: zaks.anna, bogner, kubabrecka, chandlerc, samsonov Subscribers: jevinskie, filcab, llvm-commits Differential Revision: http://reviews.llvm.org/D11820 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244948 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20Silence some CMake 3.3 dev warnings in compiler-rtReid Kleckner
Fix a trivial instance of CMP0054 that came up on llvmdev. The other warnings were CMP0057, which is about using the same file as a MAIN_DEPENDENCY multiple times. The old behavior hasn't been a problem yet, so I silenced the warning and filed PR23595 to document the issue if someone cares. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@237808 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-09[ASan] Only include rpc headers if they are available.Yury Gribov
Reviewed at http://reviews.llvm.org/D8698 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@234470 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23Cmake variables are global, which is why we would get crud like /machine:X86 ↵Aaron Ballman
in the list of compiler options for MSVC. Clear out the variable before attempting to enumerate arguments and set them. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220522 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, ↵Kuba Brecka
let's rename it to append_list_if Doing s/append_if/append_list_if/, no functional change. http://reviews.llvm.org/D5739 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219860 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15[CMake] Cleanup CMake rules after r219302. NFC.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219825 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13[CMake] Use /W3 instead of -Wall on Windows. Remove add_definitions abuse.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203786 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13[CMake] Make append_if semantics similar to those used in LLVMAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203773 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-24[CMake] Better support for COMPILER_RT_ENABLE_WERROR. Make sure compiler-rt ↵Alexey Samsonov
libraries are build by 'make all' command git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202023 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 setting compile flag disabling RTTIAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201547 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25Add a CMake option COMPILER_RT_DEBUG for building runtimes with full debug info.Peter Collingbourne
Differential Revision: http://llvm-reviews.chandlerc.com/D1984 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193449 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08[CMake] set -mmacosx-version-min to 10.7 if compiler-rt is built with ↵Alexey Samsonov
-stdlib=libc++ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174699 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18CMake: create AddCompilerRT module and implement convenience ↵Alexey Samsonov
add_compiler_rt_object_library function git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172826 91177308-0d34-0410-b5e6-96231b3b80d8