summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)Author
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
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