summaryrefslogtreecommitdiff
path: root/cmake
AgeCommit message (Collapse)Author
2017-07-28[sanitizer tests CMake] Factor out CMake logic for compiling sanitizer testsGeorge Karpenkov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309405 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Support compiler-rt builtinsPetr Hosek
This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28[sanitizers] Sanitizer tests CMake clean up: try #2George Karpenkov
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309341 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27Revert "[sanitizers] Sanitizer tests CMake clean up"George Karpenkov
This reverts commit 0ab44db2aa1cd3710355ad79b04f954ce68c0b3a. Fails on some bots, reverting until I can fix it. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309318 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27[sanitizers] Sanitizer tests CMake clean upGeorge Karpenkov
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309306 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26Revert "[sanitizer] Support compiler-rt builtins"Petr Hosek
This reverts commit fd63314d6770e0da62572a3fea2c41c4cc0fc58a. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25[sanitizer] Support compiler-rt builtinsPetr Hosek
This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309060 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12On Darwin, start building the TSan iOS dylib by default.Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12On Darwin, start building the TSan dylib for the iOS simulator.Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12Fix the declaration of DARWIN_PREFER_PUBLIC_SDK cmake variable (move before ↵Kuba Mracek
the return). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07[cmake] Cache results of find_darwin_sdk_dirKuba Mracek
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06[cmake] Add an option to prefer public SDK in find_darwin_sdk_dirKuba Mracek
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-19[scudo] Enabling MIPS support for ScudoSagar Thakur
Adding MIPS 32-bit and 64-bit support for Scudo. Reviewed by cryptoad, sdardis. Differential: D31803 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-24Allow builds to set COMPILER_RT_OS_DIR differently from CMAKE_SYSTEM_NAMEJonathan Roelofs
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-24Allow armv{7,7s,7k,7m,7em} buildsJonathan Roelofs
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303765 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12Enable lsan test suite on Darwin x86_64 buildsFrancis Ricci
Reviewers: kubamracek, alekseyshl Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D32191 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302904 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-04-26[asan] Add support for running lit tests in the iOS SimulatorKuba Mracek
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24Revert [scudo] Enabling MIPS support for ScudoSagar Thakur
This patch broke the buildbot clang-cmake-mips. Investigating the issue. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301173 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24[scudo] Enabling MIPS support for ScudoSagar Thakur
Adding MIPS 32-bit and 64-bit support for Scudo. Reviewed by cryptoad Differential: D31803 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301158 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21Revert "Enable lsan test suite on Darwin x86_64 builds"Ahmed Bougacha
This reverts commit r300897. Most LSan/ASan tests are failing on darwin bots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20Enable lsan test suite on Darwin x86_64 buildsFrancis Ricci
Reviewers: kubamracek, alekseyshl Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D32191 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11Reapply "Enable LSan for arm Linux"Maxim Ostapenko
This patch reapplies r299923 with typo fixed in BLX macros. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11Revert r299923, it doesn't build in bootstrap builds.Nico Weber
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.arm.dir/sanitizer_linux.cc.o lib/sanitizer_common/sanitizer_linux.cc:1340:24: error: invalid instruction BLX(ip) ^ lib/sanitizer_common/sanitizer_linux.cc:1313:19: note: expanded from macro 'BLX' # define BLX(R) "mov lr, pc; bx" #R "\n" ^ <inline asm>:6:13: note: instantiated into assembly here mov lr, pc; bxip ^~~~ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299943 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11[lsan] Enable LSan for arm LinuxMaxim Ostapenko
This patch enables LSan for arm Linux. Differential Revision: https://reviews.llvm.org/D29586 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06Enable builds of darwin lsan by defaultFrancis Ricci
Summary: Testing and asan leak detection are disabled by default. Reviewers: kubamracek, kcc Subscribers: srhines, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D31307 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299669 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28Enable i386 builds for darwin lsanFrancis Ricci
Summary: Now that __thread is no longer used for lsan on darwin, i386 builds can be enabled. Reviewers: kcc, kubamracek Subscribers: danalbert, srhines, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29995 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298946 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27[sanitizers] Upgrade ios min version to 8Kuba Mracek
Differential Revision: https://reviews.llvm.org/D29787 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-22[compiler-rt] build compiler-rt runtimes without LTOBob Haarman
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298525 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-02-18Enable PROFILE, TSAN and UBSAN for AndroidPirama Arumuga Nainar
Summary: These sanitizers are enabled and used in Android but got built with Android's build system. This change enables them in the CMake build system. Reviewers: eugenis Subscribers: llvm-commits, danalbert, srhines, mgorny Differential Revision: https://reviews.llvm.org/D30127 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295523 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17Revert "Upgrade ios min version to 8"Francis Ricci
Accidental commit This reverts commit f21d4a6836ea159e95e5042ba8383f20d4899cda. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295414 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17Upgrade ios min version to 8Francis Ricci
Summary: Version 8 is the first version to support the __thread keyword, which is required for building lsan for 64-bit ios. Reviewers: kubamracek, kcc, glider Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29787 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295412 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-15Re-commit r295017, since we have a potential fix of the tests, r295248, landed.Tim Shen
Differential Revision: https://reviews.llvm.org/D29742 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-15[Compiler-rt][XRAY][MIPS] Support xray on mips/mipsel/mips64/mips64elSagar Thakur
Summary: Adds support for xray on mips/mipsel/mips64/mips64el. Reviewed by sdardis, dberris Differential: D27699 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-14Revert r295017 "Re-commit r294826 and r294781, with a fix on the cmake file ↵Tim Shen
to only" git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295097 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-14Re-commit r294826 and r294781, with a fix on the cmake file to onlyTim Shen
compile on powerpc64le. I cannot locally reproduce this test failure: http://lab.llvm.org:8011/builders/sanitizer-ppc64le-linux/builds/1363/steps/test%20standalone%20compiler-rt/logs/stdio Let's see how the buildbot goes. Differential Revision: https://reviews.llvm.org/D29742 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295017 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-14Add cmake build support for lsan on OS XFrancis Ricci
Summary: Adds a new cmake flag 'COMPILER_RT_ENABLE_LSAN_OSX', which enables lsan compilation and is turned off by default. Patches to fix build errors when this flag is enabled will be uploaded soon. This is part of an effort to port LSan to OS X, but LSan on OS X does not currently work or pass tests currently. Reviewers: kubamracek, kcc, glider, alekseyshl Reviewed By: kubamracek Subscribers: danalbert, srhines, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29783 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295012 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11This reverts commits r294826 and r294781 as they break linking on powerpc.Vitaly Buka
Revert "Fix -Wsign-compare - this might not be quite right, but preserves behavior" Revert "[XRay] Implement powerpc64le xray." This reverts commit r294826. This reverts commit r294781. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@294842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10[XRay] Implement powerpc64le xray.Tim Shen
Summary: powerpc64 big-endian is not supported, but I believe that most logic can be shared, except for xray_powerpc64.cc. Also add a function InvalidateInstructionCache to xray_util.h, which is copied from llvm/Support/Memory.cpp. I'm not sure if I need to add a unittest, and I don't know how. Reviewers: dberris, echristo, iteratee, kbarton, hfinkel Subscribers: mehdi_amini, nemanjai, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29742 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@294781 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31[lsan] Renable LSan for x86 LinuxMaxim Ostapenko
The missed clang part was committed at https://reviews.llvm.org/rL293609 thus we can reenable LSan for x86 Linux. Differential Revision: https://reviews.llvm.org/D28609 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293610 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-25[scudo] Enabling AArch64 support for ScudoKostya Kortchinsky
Summary: Adding ARM64 as a supported architecture for Scudo. The random shuffle is not yet supported for SizeClassAllocator32, which is used by the AArch64 allocator, so disable the associated test for now. Reviewers: kcc, alekseyshl, rengolin Reviewed By: rengolin Subscribers: aemerson, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28960 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293068 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23Revert "[lsan] Enable LSan for x86 Linux."Evgeniy Stepanov
Breaks tests on i686/Linux due to missing clang driver support: error: unsupported option '-fsanitize=leak' for target 'i386-unknown-linux-gnu' git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23[lsan] Enable LSan for x86 Linux.Maxim Ostapenko
People keep asking LSan to be available on 32 bit targets (e.g. https://github.com/google/sanitizers/issues/403) despite the fact that false negative ratio might be huge (up to 85%). This happens for big real world applications that may contain random binary data (e.g. browser), but for smaller apps situation is not so terrible and LSan still might be useful. This patch adds initial support for x86 Linux (disabled by default), ARM32 is in TODO list. We used this patch (well, ported to GCC) on our 32 bit mobile emulators and it worked pretty fine thus I'm posting it here to initiate further discussion. Differential Revision: https://reviews.llvm.org/D28609 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19[Builtin] [ARM] Update CMake to support the build of armv6mWeiming Zhao
Summary: Setting -DCOMPILER_RT_TEST_TARGET_TRIPLE=armv6m-none-eabi will enable the build of builtin functions ARMv6m. Currently, only those asms that support armv6m are added. TODO:All asm sin ARM_EABI_Sources are ported for thumb1 so Thumb1_EABI_Sources will be deprecated. Reviewers: rengolin, compnerd Reviewed By: compnerd Subscribers: aemerson, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28463 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18[scudo] Refactor of CRC32 and ARM runtime CRC32 detectionKostya Kortchinsky
Summary: ARM & AArch64 runtime detection for hardware support of CRC32 has been added via check of the AT_HWVAL auxiliary vector. Following Michal's suggestions in D28417, the CRC32 code has been further changed and looks better now. When compiled with full relro (which is strongly suggested to benefit from additional hardening), the weak symbol for computeHardwareCRC32 is read-only and the assembly generated is fairly clean and straight forward. As suggested, an additional optimization is to skip the runtime check if SSE 4.2 has been enabled globally, as opposed to only for scudo_crc32.cpp. scudo_crc32.h has no purpose anymore and was removed. Reviewers: alekseyshl, kcc, rengolin, mgorny, phosek Reviewed By: rengolin, mgorny Subscribers: aemerson, rengolin, llvm-commits Differential Revision: https://reviews.llvm.org/D28574 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16Reland "[CMake][compiler-rt] Mark libcxx build for tsan as standalone"Petr Hosek
This relands commit r291722. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12Revert "[CMake][compiler-rt] Mark libcxx build for tsan as standalone"Petr Hosek
This reverts commit 08dbefb847bb765b387c67dc2dc2ef90a4927312. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291730 91177308-0d34-0410-b5e6-96231b3b80d8