summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)Author
2015-06-25[Sanitizer] Set minimum supported Mac OS X version to 10.9, if it wasn't ↵Alexey Samsonov
specified explicitly. -fsanitize=vptr is a UBSan feature that doesn't work on older Mac OS X versions, and we don't want to penalize users that use modern OS with default configuration. Those who want to target older OS versions, can specify that versions explicitly. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240688 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-25[CMake] Fix PR23539: Don't reference C++ ABI symbols prior to Mac OS 10.9.Alexey Samsonov
Summary: This patch implements step 1 from https://llvm.org/bugs/show_bug.cgi?id=23539#c10 I'd appreciate if you could test it on Mac OS and verify that parts of UBSan runtime that reference C++ ABI symbols are properly excluded, and fix ASan/UBSan builds. Test Plan: regression test suite Reviewers: thakis, hans Subscribers: llvm-commits, zaks.anna, kubabrecka Differential Revision: http://reviews.llvm.org/D10621 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240617 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22[CMake] Respect the value of -mmacosx-version-min flag.Alexey Samsonov
Make sure that sanitizer runtimes target OS X version provided in -mmacosx-version-min= flag. Enforce that it should be at least 10.7. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15Protection against stack-based memory corruption errors using SafeStack: ↵Peter Collingbourne
compiler-rt runtime support library This patch adds runtime support for the Safe Stack protection to compiler-rt (see http://reviews.llvm.org/D6094 for the detailed description of the Safe Stack). This patch is our implementation of the safe stack on top of compiler-rt. The patch adds basic runtime support for the safe stack to compiler-rt that manages unsafe stack allocation/deallocation for each thread. Original patch by Volodymyr Kuznetsov and others at the Dependable Systems Lab at EPFL; updates and upstreaming by myself. Differential Revision: http://reviews.llvm.org/D6096 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-10[CMake] Cleanup add_compiler_rt_object_library to be platform-agnosticChris Bieneman
Summary: This change takes darwin-specific goop that was scattered around CMakeLists files and spread between add_compiler_rt_object_library and add_compiler_rt_darwin_object_library and moves it all under add_compiler_rt_object_library. The goal of this is to try to push platform handling as low in the utility functions as possible. Reviewers: rnk, samsonov Reviewed By: rnk, samsonov Subscribers: rnk, rsmith, llvm-commits Differential Revision: http://reviews.llvm.org/D10250 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239498 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-20Revert some of "Silence some CMake 3.3 dev warnings in compiler-rt"Reid Kleckner
This reverts part of r237808. The CMP0057 warnings came from an old development build of CMake that nobody else has. We don't need the cruft. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@237819 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-10[sanitizer][MIPS] Fix warnings on MIPSDmitry Vyukov
Fixed: - stack frame size warning. - msse3 flag unused warning. - GoTsanRuntimeCheck dependency warning reported by cmake. Change by Sagar Thakur Reviewed in http://reviews.llvm.org/D8963 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@234579 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-01[UBSan] Embed UBSan into ASan runtime (compiler-rt part).Alexey Samsonov
Summary: Change the way we use ASan and UBSan together. Instead of keeping two separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on a platform, all UBSan sources are just compiled into dummy empty object files. UBSan initialization code (e.g. flag parsing) is directly called from ASan initialization, so we are able to enforce correct initialization order. This mirrors the approach we already use for ASan+LSan. This change doesn't modify the way we use standalone UBSan. Test Plan: regression test suite Reviewers: kubabrecka, zaks.anna, rsmith, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8646 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233861 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-25On OS X, explicitly use libc++Kuba Brecka
For OS X builds, both Make and CMake, let's be very explicit about using libc++ and libc++abi with: 1) -stdlib=libc++ in CFLAGS and LDFLAGS for all platforms 2) -lc++ in LDFLAGS for all platforms 3) switch from -undefined dynamic_lookup to -lc++abi for UBSan in Makefile-based builds Reviewed at http://reviews.llvm.org/D8617 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-24[ASan] Do not link ASan OSX runtime with -lc++abi (which was added in r233036)Alexander Potapenko
This should fix the OSX Jenkins build at http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA_check/ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233071 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23[UBSan] Use shared library for UBSan on OS X (compiler-rt part).Alexey Samsonov
Summary: Switch to shared library for UBSan. Add support for building UBSan on OSX and iossim by cargo-culting ASan build rules. Test Plan: regression test suite Reviewers: zaks.anna, kubabrecka Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8473 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233036 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28build: remove the stub linux SDKSaleem Abdulrasool
The SDK is insufficient to really build much. The builtins can be built standalone now which is what the stub SDK was meant to permit. Remove the unnecessary files. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@230869 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28Fix OS X build failure with Command Line Tools and without full Xcode ↵Kuba Brecka
installation On OS X, if you don't have a full Xcode installation, but just the Command Line Tools package, xcrun and xcodebuild don't return a valid SDK root path. In these cases, let's use "/" as the SDK root (which is where the headers and libraries are installed). Reviewed at http://reviews.llvm.org/D7641 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@230847 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29[compiler-rt] OS X: Update the CMake and Make builds to explicitely use ↵Kuba Brecka
libc++, mmacosx-version-min and SDKs In both CMake and Makefiles, we are inconsistent about the use of libstdc++ vs. libc++, SDKs and minimum deployment targets for OS X. Let's fix the detection of SDKs, and let's explicitely set that we link against libc++ and mmacosx-version-min is 10.7. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29[CMake] Get rid of TARGET_64_BIT_CFLAGS: explicitly list required flags for ↵Alexey Samsonov
each architecture. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227496 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15[sanitizer] Restore -fno-lto accidentally removed in r226169.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226177 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15[sanitizer] Flag parser rewrite.Evgeniy Stepanov
The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14builtins: avoid duplicating unwind declarationsSaleem Abdulrasool
Use unwind.h to get the declarations for unwinding interfaces. This header is already provided by clang and gcc, so this adds no additional dependencies for building the builtins library. It avoids the duplication which may drift over time though. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225990 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06Use -DSANITIZER_DEBUG=1 if COMPILER_RT_DEBUG=ON, now that PR22083 is fixed.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225293 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-03Remove TSAN_DEBUG in favor of SANITIZER_DEBUG.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225111 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-31Avoid building compiler-rt with LTO.Rafael Espindola
During a LTO we still need to build a compiler_rt with regular object files in the .a. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225049 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-29[cmake/multilib] Support multilib libdir suffixes by applying theChandler Carruth
LLVM_LIBDIR_SUFFIX variable to one place in the cmake file. This is all that I had to do to get everything from compiler-rt working for me, but there may be more work required if folks are relying on more parts of compiler-rt. Notably, I'm mostly using it for the sanitizers. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224928 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-23Change the CMake build to generate full debugging info when COMPILER_RT_DEBUG=ONKuba Brecka
The compiler-rt CMake build currently uses -gline-tables-only for all builds. While this makes the debugger correctly map source files, debugging of the runtime libraries in general is pretty tough, because you don't see any local variables, parameters, etc. Let's allow emitting full debugging info by setting COMPILER_RT_DEBUG=ON. Reviewed at http://reviews.llvm.org/D6764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224749 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-17[ASan] Always build shared ASan runtime on Linux.Alexey Samsonov
This commit changes the strategy for building shared ASan runtime and the way we test it: - COMPILER_RT_BUILD_SHARED_ASAN CMake option is removed. We now always build shared ASan runtime (it is the default on Android, Windows and Mac, and not the default on Linux and FreeBSD). - Platforms, which use static runtime by default now have "check-asan-dynamic" testsuite. This testsuite contains instrumented unit tests, and ASan lit tests, and runs them with shared ASan runtime. This testsuite is *not* a part of "check-asan" and *not* a part of "check-all", as adding 1000 more test cases, which duplicate existing ones is costly. However, you're welcome to add this command to your buildbot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224470 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-28[asan] Remove the local copy of Android ucontext.h.Evgeniy Stepanov
This header is present in the r10c release of the NDK. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222915 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-13[CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC ↵Alexey Samsonov
occasionally silently discards unknown -Wno-foo flags. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221925 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-10Build Darwin libclang_rt libraries against real SDKs.Bob Wilson
The minimal fake SDK was very useful in allowing us to build for all Darwin platforms without needing access to the real SDKs, but it did not support building any of the sanitizer runtimes. It's important to fix that. As a consequence, if you don't have the iOS SDKs installed, we will now skip building the iOS-specific libclang_rt libraries. rdar://problem/18825276 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221621 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23Disabling some MSVC warnings that are of questionable value. Note, these are ↵Aaron Ballman
disabled by default in LLVM as well, so there is precedence. C4146: 'unary minus operator applied to unsigned type, result still unsigned' C4291: ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception' C4800: ''type' : forcing value to bool 'true' or 'false' (performance warning)' git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220507 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23Change all of the build flags to switch /MD and /MDd into /MT, instead of ↵Aaron Ballman
just some of the targets. Fixes PR21241. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220506 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-10-08[ASan] Bump the minimum OSX version required to run ASan to 10.7.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219302 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-29[sanitizer] Android build cleanup.Evgeniy Stepanov
* Detect Android toolchain target arch and set correct runtime library name. * Merged a lot of Android and non-Android code paths. * Android is only supported in standalone build of compiler-rt now. * Linking lsan-common in ASan-Android (makes lsan annotations work). * Relying on -fsanitize=address linker flag when building tests (again, unification with non-Android path). * Runtime library moved from lib/asan to lib/linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27[ASan/Win] Enable building the MD runtime by defaultTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216534 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26[ASan/Win] Disable warning C4391: incorrect return type for intrinsic functionTimur Iskhodzhanov
This warning makes it a bit hard to define strlen and wcslen interceptors in an elegant yet portable way git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216450 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12Fix the CMake build when setting MACOSX_DEPLOYMENT_TARGETHans Wennborg
If we don't reset CMAKE_OSX_DEPLOYMENT_TARGET, it will end up in CFLAGS together with the -mmacosx-version-min that we set, and the compiler errors about the conflict. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215468 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12[ASan/Win] Fix PR18987: warning about overriding '/MD' with '/MT'Timur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215435 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08[CMake] Determine which compiler-rt libraries are supported onAlexey Samsonov
a given platform in a top-level CMakeLists.txt to use it both in lib/ and in test/ subdirectories. Move architecture/platform checks to config-ix. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215247 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-28Exclude ASM from CompilerRT languages as an attempt to fix CMake failure in ↵Alexey Samsonov
standalone mode git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214130 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-26builtins: re-enable building assembly sourcesSaleem Abdulrasool
Re-apply SVN r213684 which was reverted in SVN r213724 since it broke the build bots. Add a tweak to enable inclusion of the assembly sources in standalone build as well. Original commit message: This patch address the PR20360. The CMake assembler build system ignores the .S assembly files in builtins library build. This patch fixes the issue. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214013 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-24[asan] adding support of 32-bit address sanitizer for MIPSDaniel Sanders
Summary: The patch supports both the clang cross-compiler and native compiler Patch by Kumar Sukhani <Kumar.Sukhani@imgtec.com> Test Plan: Kumar had the following asan test results when compiled on a MIPS board: Expected Passes : 96 Expected Failures : 2 Unsupported Tests : 84 Unexpected Passes : 4 Unexpected Failures: 19 The list of unexpected failures can be found in the review. Reviewers: kcc, petarj, dsanders Reviewed By: kcc Subscribers: farazs, kcc, llvm-commits Differential Revision: http://reviews.llvm.org/D4208 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211587 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-03Fix Android build after r210053Greg Fitzgerald
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210069 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-02Cleanup Android build and provide better diagnosticsGreg Fitzgerald
No longer need to set ANDROID if COMPILER_RT_TEST_TARGET_TRIPLE is arm-linux-androideabi. No need to set ANDROID_COMMON_FLAGS. These flags are already in CMAKE_CXX_FLAGS which are used in try_compile(). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210053 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29light up sanitizers for ARM, take 2Greg Fitzgerald
Differential Revision: http://reviews.llvm.org/D3794 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209856 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29Revert "light up sanitizers for ARM"Greg Fitzgerald
This commit broke the Windows build, where CMAKE_C_COMPILER can compile and link with -march=armv7-a but the just-built-clang cannot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209851 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29light up sanitizers for ARMGreg Fitzgerald
You can expect the sanitizers to be built under any of the following conditions: 1) CMAKE_C_COMPILER is GCC built to cross-compile to ARM 2) CMAKE_C_COMPILER is Clang built to cross-compile to ARM (ARM is default target) 3) CMAKE_C_COMPILER is Clang and CMAKE_C_FLAGS contains -target and --sysroot Differential Revision: http://reviews.llvm.org/D3794 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209835 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-28[ASan/Win] Use clang rather than clang-cl by default for lit tests. Make ↵Timur Iskhodzhanov
Windows-only tests explicitly use clang-cl. Reviewed at http://reviews.llvm.org/D3893 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209719 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-20XFAIL ptrace test on armGreg Fitzgerald
The patch adds better target_triple and target_arch defaults for lit tests, which allows us to XFAIL tests based on architecture. Was: target_triple = LLVM_DEFAULT_TARGET_TRIPLE target_arch = HOST_ARCH Now: target_triple = COMPILER_RT_TEST_TARGET_TRIPLE , otherwise LLVM_DEFAULT_TARGET_TRIPLE target_arch = first item in COMPILER_RT_TEST_TARGET_TRIPLE Differential Revision: http://reviews.llvm.org/D3855 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209256 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-14[ASan tests] Add the first Windows-only lit testTimur Iskhodzhanov
Reviewed at http://reviews.llvm.org/D3767 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208802 91177308-0d34-0410-b5e6-96231b3b80d8