summaryrefslogtreecommitdiff
path: root/cmake/config-ix.cmake
AgeCommit message (Collapse)Author
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-21Revert "Revert "[MSan] Enable on PowerPC64.""Marcin Koscielnicki
This reverts commit r269532. The failures triggered by the first attempt should be fixed by r273250. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273251 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 most MSVC warnings in compiler-rt profiling libraryReid Kleckner
Here's the warnings and how they were fixed: - InstrProfilingUtil.c(110): warning C4013: '_open_osfhandle' undefined; assuming extern returning int Include io.h to get the prototype. - warning C4005: 'FILE_MAP_EXECUTE': macro redefinition Stop trying to support pre-XP versions of Windows, don't attempt to define this macro. - InstrProfilingWriter.c(271): warning C4221: nonstandard extension used: 'Data': cannot be initialized using address of automatic variable 'Header' - InstrProfilingWriter.c(275): warning C4221: nonstandard extension used: 'Data': cannot be initialized using address of automatic variable 'Zeroes' Turn this warning off. This is definitely legal in C++, all compilers accept it, and I only have room for half of one language standard in my brain. - InstrProfilingValue.c(320): warning C4113: 'uint32_t (__cdecl *)()' differs in parameter lists from 'uint32_t (__cdecl *)(void)' Fix this with an explicit (void) in the prototype. - InstrProfilingMerge.c.obj : warning LNK4006: _VPMergeHook already defined in InstrProfilingMergeFile.c.obj; second definition ignored Last remaining warning. This is from linking a selectany definition with a strong definition. We need to sort out weak symbols in compiler-rt in general, though. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273026 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-07[sanitizer] Initial implementation of a Hardened AllocatorKostya Serebryany
Summary: This is an initial implementation of a Hardened Allocator based on Sanitizer Common's CombinedAllocator. It aims at mitigating heap based vulnerabilities by adding several features to the base allocator, while staying relatively fast. The following were implemented: - additional consistency checks on the allocation function parameters and on the heap chunks; - use of checksum protected chunk header, to detect corruption; - randomness to the allocator base; - delayed freelist (quarantine), to mitigate use after free and overall determinism. Additional mitigations are in the works. Reviewers: eugenis, aizatsky, pcc, krasin, vitalybuka, glider, dvyukov, kcc Subscribers: kubabrecka, filcab, llvm-commits Differential Revision: http://reviews.llvm.org/D20084 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03[CMake] detect_target_arch needs to be moved to UtilsChris Bieneman
This macro is called from the base config, so it can't live in config-ix, it needs to be in the utils. I suspect the only reason this hasn't caused problems is that nobody is building the Android builtins from the builtins subdirectory. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271693 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27This patch is activating the build of Asan on Windows 64-bits.Etienne Bergeron
It's fixing compilation errors. The runtime is not yet working. Missing features: OverrideFunction for x64 an equiv function for inline asm (atomic_compare_exchange_strong) shadow memory offset needs to be adjusted RoundUpToInstrBoundary for x64 They will be implemented by subsequent patches. Patch by Wei Wang. Differential revision: http://reviews.llvm.org/D20455 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26[sanitizer] Fix a typo in config-ix.cmake causing all Darwin embedded ↵Kuba Brecka
platforms to be built with the 'iossim' SDK. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@270840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14Revert "[MSan] Enable on PowerPC64."Marcin Koscielnicki
This reverts commit r269522. This broke dtls_test.c on ppc64le buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14[MSan] Enable on PowerPC64.Marcin Koscielnicki
Differential Revision: http://reviews.llvm.org/D20001 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269522 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11[CMake] Cache check results and avoid duplicate checksChris Bieneman
This caches the result of builtin_check_c_compiler_flag, and removes a duplicate check for C99 flag support. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269230 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-04-27[Compiler-rt][CFI] Enabling CFI for MIPS64Mohit K. Bhakkad
Reviewers: eugenis Subscribers: jaydeep, sagar, Sanitizers Differential Revision: http://reviews.llvm.org/D19531 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267674 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26[CMake] [PR27403] Fix COMPILER_RT_ENABLE_IOS when using Xcode from the App ↵Chris Bieneman
Store. This change modifies find_darwin_sdk_dir to set a variable if a Darwin "Internal" SDK is present which allows CMake to disable components that require internal-only APIs. This mechanism is then used to disable TSan when an internal SDK is not present. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21[esan] EfficiencySanitizer base runtime libraryDerek Bruening
Summary: Adds the initial version of a runtime library for the new EfficiencySanitizer ("esan") family of tools. The library includes: + Slowpath code via callouts from the compiler instrumentation for each memory access. + Registration of atexit() to call finalization code. + Runtime option flags controlled by the environment variable ESAN_OPTIONS. The common sanitizer flags are supported such as verbosity and log_path. + An initial simple test. Still TODO: common code for libc interceptors and shadow memory mapping, and tool-specific code for shadow state updating. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, vkalintiris, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19168 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-15[sanitizer] [SystemZ] Enable UBSan.Marcin Koscielnicki
sanitizer_common is now in good enough shape on s390x to support UBSan - all tests passing. Let's enable it. Differential Revision: http://reviews.llvm.org/D19157 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-30[cmake] Get the MSVC version by running cl rather than relying on MSVC_VERSIONReid Kleckner
MSVC_VERSION comes from the _MSC_VER macro, which won't correspond to the STL version if the host compiler is clang-cl. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22Move -fms-compatibility-version=19 into target cflagsReid Kleckner
This reduces cflags duplication and allows us to build sanitizer_common/tests with clang and the VS 2015 STL. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-20[tsan] Build TSan dylibs for iOS-style simulatorsDevin Coughlin
Update the compiler-rt cmake to build TSan dylibs for iOS-style simulators when the corresponding COMPILER_RT_ENABLE_FOO_OS setting is enabled. Differential Revision: http://reviews.llvm.org/D18277 Part of rdar://problem/24048382 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05[cmake] Address Samsonov's post-commit review of r262723Filipe Cabecinhas
Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17896 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04[Compiler-rt][safestack] Enable for MIPSMohit K. Bhakkad
Reviewers: samsonov Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17846 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17[CMake] [NFC] Move macro definitions out of config-ix.cmakeChris Bieneman
This change should have no functional impact, it just moves some macro definitions out of config-ix.cmake into CompilerRTUtils.cmake. This step will allow these macros to be re-used by the separated builtin build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02[TSan] Use darwin_filter_host_arch to restrict set of test arch on Mac OS.Alexey Samsonov
This also reverts r259577 which was a quick-fix to fix buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259593 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02[tsan] Disable x86_64h build that was enabled as part of r259542.Daniel Sanders
It fails almost every test on clang-stage1-cmake-RA_check. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02[asan] Add iOS support.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27[compiler-rt] list_union() is actually an intersect operation. Rename it.Daniel Sanders
Summary: Given: set(T1 a b c) set(T2 b c d) message("T1=${T1}") message("T2=${T2}") list_union(T3 T1 T2) message("T3=${T3}") cmake emitted: T1=a;b;c T2=b;c;d T3=b;c Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16580 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22When building without DIA SDK, don't set suppressions.cpp failNico Weber
This test requires llvm-symbolizer to be able to convert a stack address into a function name. It is only able to do this if the DIA SDK was found at cmake time. Add a lit feature for this, and let the test depend on it. See also discussion in D15363. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258545 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13[WebAssembly] Enable the builtins library for WebAssembly.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12[CMake] Adding experimental support for tvOS and watchOSChris Bieneman
Summary: * Refactored the iOS config-ix.cmake code to be a more compact loop over supported embedded platforms. * Added watchOS and tvOS as experimental platforms, they don't currently build so they are disabled by default Reviewers: zaks.anna, kubabrecka, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16119 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06[compiler-rt] On Darwin, link all frameworks with -fapplication-extensionAnna Zaks
The ASan dylib as well as other compiler-rt dylibs work with app extensions, so we should add -fapplication-extension to the link line when building them. This will avoid linker warnings when using the dylibs in app extensions. (APIs unavailable to app extensions are listed here: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW6) Differential Revision: http://reviews.llvm.org/D15550 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05[PGO] Enable building compiler-rt profile support library on WindowsNathan Slingerland
Summary: This change configures Windows builds to build the complier-rt profile support library (clang_rt.profile-i386.lib). Windows API incompatibilities in the compiler-rt profile lib are also fixed. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15830 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256848 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15Cross-DSO control flow integrity (compiler-rt part).Evgeniy Stepanov
This is an initial version of the runtime cross-DSO CFI support library. It contains a number of FIXMEs, ex. it does not support the diagnostic mode nor dlopen/dlclose, but it works and can be tested. Diagnostic mode, in particular, would require some refactoring (we'd like to gather all CFI hooks in the UBSan library into one function so that we could easier pass the diagnostic information down to __cfi_check). It will be implemented later. Once the diagnostic mode is in, I plan to create a second test configuration to run all existing tests in both modes. For now, this patch includes only a few new cross-DSO tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255695 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-11[compiler-rt] [safestack] Enable for aarch64Adhemerval Zanella
This patch enables the safestack for aarch64. The frontend already have it enabled on all supported architectures and no adjustment is required in llvm. The compiler-rt adjustments are basically add on the cmake configuration to enable the tests and fix the pagesize debug check by getting its value at runtime (since aarch64 has multiple pagesize depending of kernel configuration). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255345 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10Replace cmake check for printf with a check for fopen.Evgeniy Stepanov
Printf is a builtin, and the check fails with -Werror because of a clang warning about an incompatible redeclaration. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255189 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10Revert "[CMake] Provide options for toggling on and off various runtime ↵Chris Bieneman
libraries." This reverts r255170. This change caused a bunch of bot failures and needs to be revised. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-09[CMake] Provide options for toggling on and off various runtime libraries.Chris Bieneman
Summary: Rather than having to add new "experimental" options each time someone wants to work on bringing a sanitizer to a new platform, this patch makes options for all of them. The default values for the options are set by the platform checks that would have enabled them, but they can be overridden on or off. Reviewers: kubabrecka, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14846 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-09Fix the target specific "-msse3" flag check in CMake. NFCSumanth Gundapaneni
msse3 is a target dependent flag and must be guarded as check_cxx_compiler_flag() checks only for compiler error messages and ignores warnings. Earlier COMPILER_RT_HAS_MSSE3_FLAG is set to "TRUE" for all targets as clang emits warnings and the compilation spits unnecessary warnings for non-X86 targets. This issue is fixed by coupling the flag with "-Werror" Differential Revision: http://reviews.llvm.org/D15362 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-08[PPC64, TSAN] LLVM basic enablement of thread sanitizer for PPC64 (BE and LE)Bill Schmidt
This patch is by Simone Atzeni with portions by Adhemerval Zanella. This contains the LLVM patches to enable the thread sanitizer for PPC64, both big- and little-endian. Two different virtual memory sizes are supported: Old kernels use a 44-bit address space, while newer kernels require a 46-bit address space. There are two companion patches that will be added shortly. There is a Clang patch to actually turn on the use of the thread sanitizer for PPC64. There is also a patch that I wrote to provide interceptor support for setjmp/longjmp on PPC64. Patch discussion at reviews.llvm.org/D12841. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255057 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-08[CMake] Adding simulator supported runtimes should be done in the block that ↵Chris Bieneman
tests simulator capabilities. Not sure why I put this in the iOS block originally, it shouldn't be there. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255046 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-07[TSan] Enforce TSan runtime doesn't include system headers with --sysroot flag.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254966 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03[tsan] Enable ThreadSanitizer on OS X builds by default, take 2Kuba Brecka
Second attempt to enable building ThreadSanitizer (and running tests) on OS X by default. Differential Revision: http://reviews.llvm.org/D15109 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01Revert r254417 ("[tsan] Enable Thread Sanitizer on OS X builds by default").Kuba Brecka
A ton of tests fail on OS X 10.10, because dyld auto-interposition is only available in 10.11. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254420 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01[tsan] Enable Thread Sanitizer on OS X builds by defaultKuba Brecka
Differential Revision: http://reviews.llvm.org/D15109 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254417 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-11-30[CMake] Add -fvisibility-inlines-hidden if the compiler supports it.Chris Bieneman
This results in a significant reduction in the size of the sanitizer libraries. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254308 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20[CMake] Add iOS simulator to the supported OS list for the profile library.Chris Bieneman
We already support this in autoconf and it ships in Apple Clang. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253709 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20Attempt to fix build breakage caused by r253646.George Burgess IV
Apparently check_c_compiler_flag isn't a thing everywhere. Not being incredibly well-versed in cmake, I'm hoping that check_cxx_compiler_flag serves a similar purpose. :) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253648 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20Silence "unrecognised -std=c99" warning on MSVC.George Burgess IV
Thanks to angelsl for the patch! Differential Revision: http://reviews.llvm.org/D13692 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-11[tsan] Add TSan unit test support for OS XKuba Brecka
This patch enables building and running TSan unit tests on OS X. Differential Revision: http://reviews.llvm.org/D14546 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252731 91177308-0d34-0410-b5e6-96231b3b80d8