summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)Author
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
2015-09-14[CMake] Add options to control building sanitizers and builtins.Chris Bieneman
There are situations where a user may want to build only the compiler-rt builtins, or only the sanitizer runtimes. This exposes options to do that. Both default to On, so there should be no implicit change in behavior. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@247607 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-14[CMake] If COMPILER_RT_INCLUDE_TESTS is off we shouldn't include the root ↵Chris Bieneman
test directory. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@247606 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08[CMake] Remove all uses of LLVM_NATIVE_ARCH.Alexey Samsonov
Instead, assume we're going to target triple specified by COMPILER_RT_DEFAULT_TARGET_TRIPLE and build runtimes for this triple (and hope that the host compiler can target them). This will help users that use cross-compiler on their host to build Clang that would work on a different architecture. This will also come in handy if one would want to configure several compiler-rt build trees on the same host, using just-built Clang that can target many architectures. This doesn't change the behavior in the default build configuration. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@247099 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08[CMake] Rename COMPILER_RT_TEST_TARGET_TRIPLE to more appropriate ↵Alexey Samsonov
COMPILER_RT_DEFAULT_TARGET_TRIPLE. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@247094 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-08-11NFC. Fixing a red squiggly line in my editor.Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244699 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11Revert the rest of r244634, since it breaks the standalone buildReid Kleckner
compiler-rt can apparently be built without an installed copy of LLVM, so we can't call its cmake code. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244647 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11Revert part of the last cmake change, it broke configuring with libcxx on ↵Reid Kleckner
Linux for me git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244635 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11[cmake] Handle external source for lld and libcxxReid Kleckner
As requested in post-commit review of r244549. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244634 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11[cmake] Hoist check for LLD sources up into root CMakeLists.txtReid Kleckner
We will use this for ASan on Windows soon. When the ELF port of LLD matures, we can add other sanitizer integration tests to make sure they work with LLD. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244549 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28Let cmake infer source file language by the file extension.Douglas Katzman
This applies default compiler flags to .S files, in particular removing the "-pedantic" option, which is desirable because there is nothing to reasonably warn about; and the only thing that gcc warns about is that you allegedly can't correctly invoke GLUE2 in lib/builtins/assembly.h on platforms for which USER_LABEL_PREFIX is the empty string. In the gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33305 that added the warning, a commenter notes that giving a macro of zero characters to another macro is not precisely the same as failing to supply an argument, and "there is a widespread belief in C++ community that such usage is valid". Unfortunately the only way to silence the warning is to avoid -pedantic. Differential Revision: http://reviews.llvm.org/D10713 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243446 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24[CMake] Workaround for PR24222: don't fail if we can't target ↵Alexey Samsonov
COMPILER_RT_TEST_TARGET_TRIPLE unless it was explicitly set. Summary: Although we assume that we can always target host triple, relax this check to avoid failing at configure-time for cases when we are not able to correctly infer/verify host triple for some reasons. See http://llvm.org/bugs/show_bug.cgi?id=24222 for more details. Reviewers: hans Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11496 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17compiler-rt: add support for mingw-w64 in builtinsReid Kleckner
The is so that we can avoid using libgcc and use compiler-rt with mingw-w64. Related driver patch http://reviews.llvm.org/D11077 I have tested this with mingw-w64 and everything seems to be in order. I also sent this patch to the mingw-w64 mailing list for them to look at. Patch by Martell Malone. Differential Revision: http://reviews.llvm.org/D11085 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@242539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16[CMake] Revisit PR23539: allow to override SANITIZER_MIN_OSX_VERSION at ↵Alexey Samsonov
configure time. Some users may need to configure Clang/compiler-rt with -DMACOSX_DEPLOYMENT_TARGET=10.6, as they expect Clang to produce working (non-sanitized) binaries on 10.6. In this case they would need to additionally provide -DSANITIZER_MIN_OSX_VERSION=10.7 to mark that sanitizer runtimes may only be used on 10.7+ (where they are supported). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@242363 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08CFI: Get check-cfi passing on Windows.Peter Collingbourne
Specifically: - Start using %expect_crash. - Provide an implementation of __ubsan::getDynamicTypeInfoFromVtable for the Microsoft C++ ABI. This is all that is needed for CFI diagnostics; UBSan's -fsanitize=vptr also requires an implementation of __ubsan::checkDynamicType. - Build the sanitizer runtimes against the release version of the C runtime, even in debug builds. - Accommodate demangling differences in tests. Differential Revision: http://reviews.llvm.org/D11029 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02UBSan: Enable runtime library tests on Windows, and get most tests passing.Peter Collingbourne
Specifically: - Disable int128 tests on Windows, as MSVC cl.exe does not support int128, so we might not have been able to build the runtime with int128 support. - XFAIL the vptr tests as we lack Microsoft ABI support. - XFAIL enum.cpp as UBSan fails to add the correct instrumentation code for some reason. - Modify certain tests that build executables multiple times to use unique names for each executable. This works around a race condition observed on Windows. - Implement IsAccessibleMemoryRange for Windows to fix the last misaligned.cpp test. - Introduce a substitution for testing crashes on Windows using KillTheDoctor. Differential Revision: http://reviews.llvm.org/D10864 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241303 91177308-0d34-0410-b5e6-96231b3b80d8