summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)Author
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-03-20Revert r298174, r298173, r298169, r298159.Evgeniy Stepanov
Revert "Fix sanitizer tests with LLVM_TOOL_LLD_BUILD=OFF." Revert "[asan] Remove gc-sections test with bfd." Revert "[asan] Disable globals-gc test with ld.bfd." Revert "[asan] Fix dead stripping of globals on Linux (compiler-rt)" OOM in gold linker. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298287 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-18Fix sanitizer tests with LLVM_TOOL_LLD_BUILD=OFF.Evgeniy Stepanov
Only depend on LLD if it is going to be built. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298174 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30[sanitizer] Re-enable -fno-function-sections for powerpc64leKostya Kortchinsky
Summary: For a reason that hasn't been investigated for lack of powerpc knowledge and hardware, -fno-function-sections is required for the Sanitizers to work properly on powerpc64le. Without, the function-sections-are-bad test fails on that architecture (and that architecture only). This patch re-enables the flag in the powerpc64le cflags. I have to admit I am not entirely sure if my way is the proper way to do this, so if anyone has a better way, I'll be happy to oblige. Reviewers: kcc, eugenis Reviewed By: eugenis Subscribers: nemanjai, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29285 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26[sanitizer] Remove -fno-function-sections from SANITIZER_COMMON_CFLAGSKostya Kortchinsky
Summary: -fno-function-sections was added as a default Sanitizer common cflag with https://reviews.llvm.org/rL200683, the reasoning behind was that things would break if linked with --gc-sections. This appears to not be necessary anymore, as tests pass without, including function-sections-are-bad.cc. There is a large benefit to having function-sections when dealing with static libraries in terms of size and dependencies that go away with --gc-sections. Reviewers: kcc, eugenis Reviewed By: eugenis Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D29132 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293220 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04[compiler-rt] suppress LNK4221 warning when creating static librariesBob Haarman
Summary: We put empty object files in archives, which causes MSVC's linker to complain about these objects not defining any previously undefined symbols. Since we do it on purpose, this only creates noise during the build process. This patch causes us to suppress the warnings. Reviewers: rnk, samsonov Subscribers: dberris, mgorny Differential Revision: https://reviews.llvm.org/D28262 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08[compiler-rt] Exclude compiler-rt from using -fmodules when ↵Kuba Brecka
LLVM_ENABLE_MODULES=On Sanitizers are intentionally not including system headers and often declare slightly different function prototypes, which is incompatible with -fmodules and -fcxx-modules. Let’s simply exclude compiler-rt from using -fmodules. Differential Revision: https://reviews.llvm.org/D25230 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@283658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06[ubsan] Turn on 'Has CXXABI' to enable support for -fsanitize=vptr on DarwinVedant Kumar
Differential Revision: https://reviews.llvm.org/D24990 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@283466 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08[compiler-rt] Don't use -fPIC when building for WindowsFrancis Ricci
Summary: This flag doesn't make sense on Windows systems. Reviewers: beanz, kubabrecka, compnerd Subscribers: dberris, llvm-commits, beanz Differential Revision: https://reviews.llvm.org/D24320 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22[compiler-rt] Make cxxabi availability configurable in cmakeFrancis Ricci
Summary: Allow for use of cxxabi to be disabled from cmake. This will make sanitizers usable when c++ abi is unavailable. Reviewers: pcc, rnk, samsonov, beanz, compnerd Subscribers: llvm-commits, compnerd, dberris Differential Revision: https://reviews.llvm.org/D23639 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19[CMake] Fix ASM building in llvm/runtimesJonas Hahnfeld
When compiler-rt's CMake is not directly invoked, it will currently not call project() and thus ASM will not be enabled. We also don't need to put the .S files through the C compiler then. Differential Revision: https://reviews.llvm.org/D23656 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake ↵Francis Ricci
configuration" This reverts commit dbb6e905684e2e9488887b26c02ee8881849f09f. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16[compiler-rt] Allow c++ abi to be explictly disabled in cmake configurationFrancis Ricci
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable. Reviewers: samsonov, beanz, pcc, rnk Subscribers: llvm-commits, kubabrecka, compnerd, dberris Differential Revision: https://reviews.llvm.org/D23376 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake ↵Francis Ricci
configuration" This reverts commit cd5fa595648378f38cdad8b07e18433639c28a9c. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 [compiler-rt] Allow c++ abi to be explictly disabled in cmake configurationFrancis Ricci
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable. Reviewers: samsonov, beanz, pcc, rnk Subscribers: llvm-commits, kubabrecka, compnerd, dberris Differential Revision: https://reviews.llvm.org/D23376 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278772 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake ↵Francis Ricci
configuration" This reverts commit 9528d86531b1289600e18c407b8e992d7fedb94f. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16[compiler-rt] Allow c++ abi to be explictly disabled in cmake configurationFrancis Ricci
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable. Reviewers: samsonov, beanz, pcc, rnk Subscribers: llvm-commits, kubabrecka, compnerd, dberris Differential Revision: https://reviews.llvm.org/D23376 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08[compiler-rt][XRay] Default COMPILER_RT_BUILD_XRAY to ONDean Michael Berris
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02Revert "[CMake] Pass -nostdlib if supported"Jonas Hahnfeld
This reverts commit r277419. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02[CMake] Pass -nostdlib if supportedJonas Hahnfeld
The sanitizers use C++ but don't require linking with the library. Differential Revision: https://reviews.llvm.org/D23005 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277419 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-08-02[winasan] Try to fix LNK4099 warnings seen by usersReid Kleckner
/Zi creates a separate PDB that we're supposed to pass along with our sanitizer libraries, but the object library compilation rules aren't set up to handle that. Rather than set that up, put the debug info in the object files the way every other platform does it with /Z7. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277406 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27Revert "Default COMPILER_RT_BUILD_XRAY=ON"Dean Michael Berris
This reverts commit 23240d8de38c79220a888f645a1f4b686bfb87c6. Broke the build because the build bots haven't gotten the latest config from zorg yet. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27Default COMPILER_RT_BUILD_XRAY=ONDean Michael Berris
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21Disable thread safe statics in clang-cl, they call the CRTReid Kleckner
Also remove the needless static that was using them. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21Default XRay building to OFF to let build bots that do not support building ↵Dean Michael Berris
sanitizers to disable explicitly too git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276255 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-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-27[CMake] Check for androidabi in CMakeLists.txt not base-config-ix.cmakeChris Bieneman
COMPILER_RT_DEFAULT_TARGET_ABI is not set in base-config-ix.cmake, so we need to move this check into CMakeLists.txt. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27Revert "Parse the triple in base-config-ix to propagate ANDROID variable ↵Chris Bieneman
correctly" This reverts commit r273914. This commit broke bots building compiler-rt using LLVM_BUILD_EXTERNAL_COMPILER_RT. See: http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/22221/console git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27Parse the triple in base-config-ix to propagate ANDROID variable correctlySumanth Gundapaneni
The triple must be parsed in base-config-ix.cmake. Otherwise, the cmake variable ANDROID won't be set and this will confuse cmake to build unsupported targets targeted for android. Diferential revision: http://reviews.llvm.org/D21474 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273914 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21[CMake] NFC. An unset variable evaluates to false, so this else is unneededChris Bieneman
This change is mostly to enable me to do some experimentation with building runtime libraries (See: D20992). It is harmless because unset variables evaluate to false in conditional expressions. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17Turn off -Wunused-parameter when building compiler-rt with clang on Windows, ↵Reid Kleckner
it is very noisy It is turned on as part of "clang-cl /W4", which enables -Wextra. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17Fix some warnings in the MSVC buildReid Kleckner
- Fixes warnings about the ignored -fms-compatibility-version flag. - Fixes warnings about overriding /W4 with /W3 and back. - Fixes a warning where PREFETCH() expanded to nothing in a braceless if block. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09[CMake] Cleanup CMake version checking for 2.8.12Chris Bieneman
Now that we're on CMake 3.4.3 this stuff isn't needed anymore. The cmake_2_8_12_* variables were unused in Compiler-RT, and the policies being set to NEW are all NEW by default now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02Fix build failure with cmake version bumpXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31[CMake] Update to requiring CMake 3.4.3Chris Bieneman
Summary: This is as per the discussions on developer lists: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098780.html http://lists.llvm.org/pipermail/llvm-dev/2016-May/100058.html Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20824 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-22[sanitizer] Don't use -fomit-frame-pointer in COMPILER_RT_DEBUG=On buildsKuba Brecka
Using -fomit-frame-pointer sometimes makes a crash log miss some frames. Let's not use this optimization in debug builds. Differential Revision: http://reviews.llvm.org/D20425 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@270376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09[CMake] Support platform building builtins without a full toolchainChris Bieneman
Summary: This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake. This patch contains the following specific changes: * Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake * Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake * Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64. This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653. Reviewers: samsonov, iains, jroelofs Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits Differential Revision: http://reviews.llvm.org/D19742 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21[asan] Disable thread-safe static initilization with VS 2015Reid Kleckner
ASan interceptors contain local statics which run before the CRT is initialized. Thread-safe statics appear to rely on CRT-internal state, and will crash without this flag. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263979 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-24[CMake] Fix a really simple, silly bug from r261797Chris Bieneman
This should fix bots with CMake older than 2.8.12. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-24[CMake] Default CMAKE_MACOSX_RPATH to On, this is the default with CMP0042Chris Bieneman
Summary: Building the sanitizer libraries without rpaths causes all sorts of problems when you try to use them. This simple fix should make it all work. Reviewers: samsonov, zaks.anna Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17556 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20[CMake] Add partial support for MSVC in compiler-rt builtins, by Roman Shirokiy.Andrey Turetskiy
This enables MSVC build of complex number arithmetic compiler-rt builtins. Differential Revision: http://reviews.llvm.org/D17452 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04Fix the libdir suffix for LLVM_CMAKE_PATHNiels Ole Salscheider
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04Fix the search path for CMake filesNiels Ole Salscheider
This fixes the build after moving LLVM's CMake files in r259821. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02[compiler-rt] add_custom_libcxx should pass LLVM_PATH and a C++ compilerDaniel Sanders
Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16681 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01[ubsan] Stop thinking we can rely on C++ ABI knowledge on WindowsReid Kleckner
We already disabled various tests relying on C++ ABI knowledge, but we still tried to build in this configuration on Windows which was a mistake. Fixes PR26415. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259388 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03[CMake] Support externalizing debug info on DarwinChris Bieneman
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254643 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30[CMake] Moving -fvisibility-inlines-hidden append as per post-commit reviewChris Bieneman
Thanks Alexey. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254316 91177308-0d34-0410-b5e6-96231b3b80d8