summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* [scudo] 32-bit and hardware agnostic supportKostya Kortchinsky2016-11-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This update introduces i386 support for the Scudo Hardened Allocator, and offers software alternatives for functions that used to require hardware specific instruction sets. This should make porting to new architectures easier. Among the changes: - The chunk header has been changed to accomodate the size limitations encountered on 32-bit architectures. We now fit everything in 64-bit. This was achieved by storing the amount of unused bytes in an allocation rather than the size itself, as one can be deduced from the other with the help of the GetActuallyAllocatedSize function. As it turns out, this header can be used for both 64 and 32 bit, and as such we dropped the requirement for the 128-bit compare and exchange instruction support (cmpxchg16b). - Add 32-bit support for the checksum and the PRNG functions: if the SSE 4.2 instruction set is supported, use the 32-bit CRC32 instruction, and in the XorShift128, use a 32-bit based state instead of 64-bit. - Add software support for CRC32: if SSE 4.2 is not supported, fallback on a software implementation. - Modify tests that were not 32-bit compliant, and expand them to cover more allocation and alignment sizes. The random shuffle test has been deactivated for linux-i386 & linux-i686 as the 32-bit sanitizer allocator doesn't currently randomize chunks. Reviewers: alekseyshl, kcc Subscribers: filcab, llvm-commits, tberghammer, danalbert, srhines, mgorny, modocache Differential Revision: https://reviews.llvm.org/D26358 llvm-svn: 288255
* [sanitizer] Add macOS minimum deployment target to all compiler invocations ↵Kuba Mracek2016-11-291-0/+18
| | | | | | | | | | in lit tests The Clang driver on macOS decides the deployment target based on various things, like your host OS version, the SDK version and some environment variables, which makes lit tests pass or fail based on your environment. Let's make sure we run all lit tests with `-mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}` (10.9 unless overriden). Differential Revision: https://reviews.llvm.org/D26929 llvm-svn: 288186
* Revert "Revert "[ASan] Enable on SystemZ.""Marcin Koscielnicki2016-11-291-1/+1
| | | | | | | | This reverts commit r287767. Hopefully, the tests should be fixed by D27118. llvm-svn: 288116
* builtins: switch to c11 from c99Saleem Abdulrasool2016-11-291-1/+1
| | | | | | | | | | | | | | This fixes an incorrect standard usage of GNU99 when the compiler check was for the ISO standard C99. Furthermore, bump the dependency up to C11. The motivation for this change is ARM EHABI compatibility with clang 3.8. We rely on a type definition redefinition which causes an error with -Werror builds. This is problematic for FreeBSD builds. Switching to C11 allows the compatibility without the unnecessary pedantic warning. The alternative would be to clutter the support header with a `pragma clang diagnostic ignore`. GCC 4.8+ and the supported clang revisions along with MSVC support enough of C11 to allow building the builtins in C11 mode. No functional change intended. llvm-svn: 288099
* Revert "[ASan] Enable on SystemZ."Marcin Koscielnicki2016-11-231-1/+1
| | | | | | | | | This reverts commit r287764. Two tests broke on the clang-s390x-linux buildbot: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/1293. llvm-svn: 287767
* [ASan] Enable on SystemZ.Marcin Koscielnicki2016-11-231-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D21831 llvm-svn: 287764
* [profile] Enable on SystemZ.Marcin Koscielnicki2016-11-231-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D21738 llvm-svn: 287748
* [XRay] Support AArch64 in compiler-rtDean Michael Berris2016-11-211-1/+1
| | | | | | | | | | | | | | | | | | This patch adds XRay support in compiler-rt for AArch64 targets. This patch is one of a series: LLVM: https://reviews.llvm.org/D26412 Clang: https://reviews.llvm.org/D26415 Author: rSerge Reviewers: rengolin, dberris Subscribers: aemerson, mgorny, llvm-commits, iid_iunknown Differential Revision: https://reviews.llvm.org/D26413 llvm-svn: 287517
* [XRay][compiler-rt] Disable XRay instrumentation of the XRay runtime.Dean Michael Berris2016-11-161-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: Adds a CMake check for whether the compiler used to build the XRay library supports XRay-instrumentation. If the compiler we're using does support the `-fxray-instrument` flag (i.e. recently-built Clang), we define the XRAY_NEVER_INSTRUMENT macro that then makes sure that the XRay runtime functions never get XRay-instrumented. This prevents potential weirdness involved with building the XRay library with a Clang that supports XRay-instrumentation, and is attempting to XRay-instrument the build of compiler-rt. Reviewers: majnemer, rSerge, echristo Subscribers: mehdi_amini, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D26597 llvm-svn: 287068
* [sanitizer] Max out allowed macOS deployment targets to 10.9Kuba Brecka2016-11-141-1/+5
| | | | | | | | It's not a good idea to build the sanitizers with e.g. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12, because some deprecated functions that we intercept will cause build errors. Let's limit the allowed deployment targets to 10.9 (which is the default anyway), and warn when it's set above. Differential Revision: https://reviews.llvm.org/D26557 llvm-svn: 286859
* Remove a VS 2012 workaround, we require 2015 now.Nico Weber2016-10-251-6/+0
| | | | llvm-svn: 285096
* [ESan][MIPS] Adds support for MIPS64Sagar Thakur2016-10-061-1/+1
| | | | | | | | | With this patch 12 out of 13 tests are passing. Reviewed by zhaoqin. Differential: D23799 llvm-svn: 283435
* [compiler-rt] Enable building iOS by default.Anna Zaks2016-10-051-1/+1
| | | | llvm-svn: 283379
* cfi: Fixes for check-cfi when configured as an external project.Peter Collingbourne2016-09-222-1/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D24817 llvm-svn: 282189
* [CMake] Rename back SIMPLE_SOURCE to compile as C++Jonas Hahnfeld2016-09-212-2/+6
| | | | | | | | | | | | | 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
* [CMake] Fix error preventing simulator sanitizers from buildingChris Bieneman2016-09-201-1/+1
| | | | | | | This should be checking for sim archs not target archs. This bug has been around for a long time. llvm-svn: 282025
* [CMake] Explicitly add --target option to compiler flagsChris Bieneman2016-09-201-0/+12
| | | | | | | | | | | | | | | 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 llvm-svn: 282024
* [XRay] ARM 32-bit no-Thumb support in compiler-rtDean Michael Berris2016-09-201-1/+1
| | | | | | | | | | | | This is a port of XRay to ARM 32-bit, without Thumb support yet. This is one of 3 commits to different repositories of XRay ARM port. The other 2 are: https://reviews.llvm.org/D23931 (LLVM) https://reviews.llvm.org/D23932 (Clang test) Differential Revision: https://reviews.llvm.org/D23933 llvm-svn: 281971
* [compiler-rt] Disable building of profiling runtime when LLVM_USE_SANITIZER ↵Kuba Brecka2016-09-171-1/+1
| | | | | | | | | | is set Currently, when doing a ASanified build of LLVM (with Clang, compiler-rt and libcxx) via -DLLVM_USE_SANITIZER=Address and not using any other options, we already disable building of sanitizer runtimes (because they themselves can’t be sanitized) and also exclude the sanitizer tests. However, the same is not done for the profiling runtime, which will build fine, but then all the tests fail due to linking errors. Let’s disable the profiling runtime as well (when LLVM_USE_SANITIZER is set). Differential Revision: https://reviews.llvm.org/D24657 llvm-svn: 281815
* [cmake] Support overriding llvm-config query resultsMichal Gorny2016-09-141-4/+9
| | | | | | | | | | | | | | | | 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 llvm-svn: 281461
* Revert "[XRay] ARM 32-bit no-Thumb support in compiler-rt"Renato Golin2016-09-081-1/+1
| | | | | | This reverts commit r280890, as the related LLVM commit broke the thumb bots. llvm-svn: 280969
* Really fix warnings about passing -std=gnu99 to MSVCReid Kleckner2016-09-081-2/+3
| | | | llvm-svn: 280958
* Revert "[ESan][MIPS] Adds support for MIPS64"Qin Zhao2016-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This reverts commit 62b3eecdbe72af0255f0639b0446087a47efbf48. (D23799) The CL cause 13 ESan test failure on x86_64: Failing Tests (13): EfficiencySanitizer-x86_64 :: TestCases/large-stack-linux.c EfficiencySanitizer-x86_64 :: TestCases/libc-intercept.c EfficiencySanitizer-x86_64 :: TestCases/mmap-shadow-conflict.c EfficiencySanitizer-x86_64 :: TestCases/struct-simple.cpp EfficiencySanitizer-x86_64 :: TestCases/verbose-simple.c EfficiencySanitizer-x86_64 :: TestCases/workingset-early-fault.c EfficiencySanitizer-x86_64 :: TestCases/workingset-memset.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-midreport.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-samples.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-signal-posix.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-simple.cpp EfficiencySanitizer-x86_64 :: Unit/circular_buffer.cpp EfficiencySanitizer-x86_64 :: Unit/hashtable.cpp Unexpected Failures: 13 Reviewers: bruening, slthakur Subscribers: sdardis, kubabrecka, beanz Differential Revision: https://reviews.llvm.org/D24350 llvm-svn: 280954
* [XRay] ARM 32-bit no-Thumb support in compiler-rtDean Michael Berris2016-09-081-1/+1
| | | | | | | | | | | | | This is a port of XRay to ARM 32-bit, without Thumb support yet. This is one of 3 commits to different repositories of XRay ARM port. The other 2 are: 1. https://reviews.llvm.org/D23931 (LLVM) 2. https://reviews.llvm.org/D23932 (Clang test) Differential Revision: https://reviews.llvm.org/D23933 llvm-svn: 280890
* [compiler-rt] Allow sanitizers to be compiled for windows with clangFrancis Ricci2016-09-071-1/+1
| | | | | | | | | | | | | | Summary: A few small changes required to permit building the sanitizers with Clang instead of only with MSVC. Reviewers: compnerd, beanz, rnk Subscribers: beanz, timurrrr, kubabrecka, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D24092 llvm-svn: 280863
* [compiler-rt] Fix library suffixes on windowsFrancis Ricci2016-09-072-2/+17
| | | | | | | | | | | | | | | Summary: Make sure that windows libraries contain the suffixes expected by clang. This is expecially important when compiling the windows builtins with clang, as cmake will use .a as the suffix by default. Reviewers: beanz, compnerd Subscribers: llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D24046 llvm-svn: 280854
* [ESan][MIPS] Adds support for MIPS64Sagar Thakur2016-09-071-1/+1
| | | | | | | | | | | | | | | With this patch 10 out of 13 tests are passing. Following is the list of failing tests: struct-simple.cpp workingset-signal-posix.cpp mmap-shadow-conflict.c Reviewed by bruening Differential: D23799 llvm-svn: 280795
* build: profile is not a sanitizerSaleem Abdulrasool2016-09-011-1/+1
| | | | | | | There was an invalid entry in the sanitizer list, remove it. This has no effect on the building, just removes the definition of a cached variable. llvm-svn: 280378
* [CMake] Connect Compiler-RT targets to LLVM Runtimes directoryChris Bieneman2016-08-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch builds on LLVM r279776. In this patch I've done some cleanup and abstracted three common steps runtime components have in their CMakeLists files, and added a fourth. The three steps I abstract are: (1) Add a top-level target (i.e asan, msan, ...) (2) Set the target properties for sorting files in IDE generators (3) Make the compiler-rt target depend on the top-level target The new step is to check if a command named "runtime_register_component" is defined, and to call it with the component name. The runtime_register_component command is defined in llvm/runtimes/CMakeLists.txt, and presently just adds the component to a list of sub-components, which later gets used to generate target mappings. With this patch a new workflow for runtimes builds is supported. The new workflow when building runtimes from the LLVM runtimes directory is: > cmake [...] > ninja runtimes-configure > ninja asan The "runtimes-configure" target builds all the dependencies for configuring the runtimes projects, and runs CMake on the runtimes projects. Running the runtimes CMake generates a list of targets to bind into the top-level CMake so subsequent build invocations will have access to some of Compiler-RT's targets through the top-level build. Note: This patch does exclude some top-level targets from compiler-rt libraries because they either don't install files (sanitizer_common), or don't have a cooresponding `check` target (stats). llvm-svn: 279863
* [builtins] Make sure builtin compile tests respect CMAKE_C_COMPILER_TARGETFrancis Ricci2016-08-251-1/+7
| | | | | | | | | | | | | | Summary: Since we generate the compiler invocation on our own, we need to manually add -target if CMAKE_C_COMPILER_TARGET has been specified. Reviewers: compnerd, beanz Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23823 llvm-svn: 279747
* [compiler-rt] Use flags found when configuring builtins during compilationFrancis Ricci2016-08-221-3/+0
| | | | | | | | | | | | Summary: This fixes the omission of -fPIC when building the builtins. Reviewers: compnerd, beanz Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D23729 llvm-svn: 279469
* [cmake] Fix append_rtti_flag macro and bad var nameFilipe Cabecinhas2016-08-221-1/+1
| | | | llvm-svn: 279450
* [CMake] Support building on OS X without Xcode installationChris Bieneman2016-08-192-2/+14
| | | | | | | | This should resolve PR23162. This patch has two parts. First we need to check the error code from xcodebuild when querying for SDKs, second if the OS X SDK is not discovered, we ensure that /usr/include exists and use / as the OS X sysroot. llvm-svn: 279336
* [CMake] Add top-level install-compiler-rt targetChris Bieneman2016-08-192-0/+2
| | | | | | This is a wrapper target of all the component install targets. This wrapper target will be used by the new LLVM runtimes directory to connect top-level targets to the runtime project target. llvm-svn: 279333
* build: allow building a specific set of sanitizersSaleem Abdulrasool2016-08-192-0/+17
| | | | | | | | | | | 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. llvm-svn: 279253
* [CMake] Stop building eprintf library on DarwinChris Bieneman2016-08-181-26/+0
| | | | | | In r278988 clang stopped using the eprintf library, so we should stop generating it too. llvm-svn: 279090
* [CMake] Renaming test variable to be consistentChris Bieneman2016-08-151-1/+1
| | | | | | Based on post-commit review by compnerd. llvm-svn: 278728
* [CMake] If the compiler supports _Atomic include atomic.c in builtins librariesChris Bieneman2016-08-122-3/+30
| | | | | | This fixes a long-standing TODO by implementing a compiler check for supporting the _Atomic keyword. If the _Atomic keyword is supported by the compiler we should include it in the builtin library sources. llvm-svn: 278454
* builtins: windows has only one flavour on ARMSaleem Abdulrasool2016-08-051-2/+6
| | | | | | | Windows on ARM is a hard-float only environment. Don't try to build two copies of the same library. llvm-svn: 277834
* Revert "[CMake] Pass -nostdlib if supported"Jonas Hahnfeld2016-08-021-1/+0
| | | | | | This reverts commit r277419. llvm-svn: 277420
* [CMake] Pass -nostdlib if supportedJonas Hahnfeld2016-08-021-0/+1
| | | | | | | | The sanitizers use C++ but don't require linking with the library. Differential Revision: https://reviews.llvm.org/D23005 llvm-svn: 277419
* [CMake] Load LLVMConfig for standalone build of builtinsJonas Hahnfeld2016-08-021-0/+54
| | | | | | | | Therefore move some code into reusable macros. Differential Revision: https://reviews.llvm.org/D22866 llvm-svn: 277418
* [CMake] Don't trust compiler error code, also check for errorsChris Bieneman2016-08-011-1/+13
| | | | | | | | | | | | Summary: rnk reported that MSVC ignores unknown flags and still returns 0. This should cause unknown flags to be an error during the compiler check. Reviewers: rnk Subscribers: brad.king, llvm-commits Differential Revision: https://reviews.llvm.org/D23030 llvm-svn: 277377
* [compiler-rt][cmake] Don't reset CAN_TARGET_${arch} on every cmake invocation.Daniel Sanders2016-07-221-10/+12
| | | | | | | | | | 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. llvm-svn: 276402
* Revert r276256 - Attempt to fix clang-cmake-mips after r268977.Daniel Sanders2016-07-211-6/+0
| | | | | | It didn't fix the problem on the buildbot. CAN_TARGET_mips64 is still true. llvm-svn: 276258
* Attempt to fix clang-cmake-mips after r268977.Daniel Sanders2016-07-211-0/+6
| | | | | | | | I think it's wiped out the build area and fully-reconfigured for the first time since r268977. This seems to have caused Mips64 to become enabled when it wasn't before because compiling with -mabi=64 succeeds but linking with -mabi=64 fails. llvm-svn: 276256
* [compiler-rt][XRay] re-submitting r276117, with fixes for build breakage due ↵Dean Michael Berris2016-07-211-0/+11
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 276251
* Revert r276117 "[XRay] Basic initialization and flag definition for XRay ↵Hans Wennborg2016-07-201-12/+0
| | | | | | | | | | | | | | | | | | | | | | | runtime" and also the follow-up "[xray] Only build xray on Linux for now" Two build errors were reported on the llvm-commits list: [ 88%] Building CXX object lib/xray/CMakeFiles/clang_rt.xray-x86_64.dir/xray_flags.cc.o /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/lib/xray/xray_init.cc:23:10: fatal error: 'llvm/Support/ELF.h' file not found #include "llvm/Support/ELF.h" ^ and In file included from /w/src/llvm.org/projects/compiler-rt/lib/xray/xray_interface.cc:16: /w/src/llvm.org/projects/compiler-rt/lib/xray/xray_interface_internal.h:36:8: error: no type named 'size_t' in namespace 'std' std::size_t Entries; ~~~~~^ llvm-svn: 276186
* [compiler-rt] Don't require c++ headers when configuring compiler-rt buildsFrancis Ricci2016-07-201-2/+2
| | | | | | | | | | | | | | Summary: A sysroot without c++ headers is able to build compiler-rt, don't require them when configuring available architectures from cmake. Reviewers: samsonov, beanz, compnerd Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D22469 llvm-svn: 276151
OpenPOWER on IntegriCloud