summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake
Commit message (Collapse)AuthorAgeFilesLines
* 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
* [compiler-rt] Fix target architecture matchingFrancis Ricci2016-07-201-1/+1
| | | | | | | | | | | | | | | Summary: Use stricter comparisons for architecture. This prevents cmake from failing for sysroots which can only compile armhf and not arm, since arm MATCHES armhf is true, while arm STREQUAL armhf is false. Reviewers: beanz, compnerd Subscribers: aemerson, llvm-commits Differential Revision: https://reviews.llvm.org/D22473 llvm-svn: 276148
* [xray] Only build xray on Linux for nowReid Kleckner2016-07-201-0/+7
| | | | | | | | | | | Should fix the Windows buildbots, and maybe some other non-Linux Unix bots too. XRay currently depends on sanitizer_common, so associate it with the "build sanitizers" option and remove the option for separately controlling the XRay build. llvm-svn: 276124
* [compiler-rt] [XRay] Basic initialization and flag definition for XRay runtimeDean Michael Berris2016-07-201-0/+5
| | | | | | | | | | | | | | | 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 llvm-svn: 276117
* [Compiler-rt][MIPS] Fix simple test failure when using gccMohit K. Bhakkad2016-07-181-2/+2
| | | | | | | | | | Reviewers: dsanders Subscribers: slthakur, jaydeep, llvm-commits, Sanitizers Differential Revision: https://reviews.llvm.org/D22453 llvm-svn: 275780
* [compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron2016-07-112-24/+35
| | | | | | | | | | | | | | | | | | | | Summary: This patch is a refactoring of the way cmake 'targets' are grouped. It won't affect non-UI cmake-generators. Clang/LLVM are using a structured way to group targets which ease navigation through Visual Studio UI. The Compiler-RT projects differ from the way Clang/LLVM are grouping targets. This patch doesn't contain behavior changes. Reviewers: kubabrecka, rnk Subscribers: wang0109, llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21952 llvm-svn: 275111
* [CMake] In r273957, I deleted a line that shouldn't have been removed.Chris Bieneman2016-06-281-0/+1
| | | | llvm-svn: 274030
* [CMake] Check for androidabi in CMakeLists.txt not base-config-ix.cmakeChris Bieneman2016-06-271-5/+0
| | | | | | COMPILER_RT_DEFAULT_TARGET_ABI is not set in base-config-ix.cmake, so we need to move this check into CMakeLists.txt. llvm-svn: 273957
* Revert "Parse the triple in base-config-ix to propagate ANDROID variable ↵Chris Bieneman2016-06-271-13/+0
| | | | | | | | | | | correctly" This reverts commit r273914. This commit broke bots building compiler-rt using LLVM_BUILD_EXTERNAL_COMPILER_RT. See: http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/22221/console llvm-svn: 273956
* Parse the triple in base-config-ix to propagate ANDROID variable correctlySumanth Gundapaneni2016-06-271-0/+13
| | | | | | | | | | | The triple must be parsed in base-config-ix.cmake. Otherwise, the cmake variable ANDROID won't be set and this will confuse cmake to build unsupported targets targeted for android. Diferential revision: http://reviews.llvm.org/D21474 llvm-svn: 273914
* [CMake] Converting darwin_test_archs simple source to CChris Bieneman2016-06-221-3/+3
| | | | | | Using C instead of CXX here removes a configuration-time dependency on libcxx for the sanitizers. This should be NFC. llvm-svn: 273505
* [compiler-rt] Split cflags and link flags to avoid warningsEtienne Bergeron2016-06-212-1/+3
| | | | | | | | | | | | | | Summary: The MSVC compiler is complaining about invalid flags. The CFLAGS are passed to the linker (i.e. /Gy-, ...). Reviewers: rnk Subscribers: llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21554 llvm-svn: 273265
* trimming whitespacesEtienne Bergeron2016-06-211-5/+5
| | | | llvm-svn: 273263
* Revert "Revert "[MSan] Enable on PowerPC64.""Marcin Koscielnicki2016-06-211-1/+1
| | | | | | | | This reverts commit r269532. The failures triggered by the first attempt should be fixed by r273250. llvm-svn: 273251
* Turn off -Wunused-parameter when building compiler-rt with clang on Windows, ↵Reid Kleckner2016-06-171-0/+1
| | | | | | | | it is very noisy It is turned on as part of "clang-cl /W4", which enables -Wextra. llvm-svn: 273028
* Fix most MSVC warnings in compiler-rt profiling libraryReid Kleckner2016-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 273026
* Fix some warnings in the MSVC buildReid Kleckner2016-06-172-3/+7
| | | | | | | | | - 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. llvm-svn: 273021
* [CMake] Cleanup CMake version checkingChris Bieneman2016-06-091-15/+1
| | | | | | CMAKE_VERSION is always greater than 3.0 now. No reason not to remove the extra compatibility code. llvm-svn: 272315
* [sanitizer] Initial implementation of a Hardened AllocatorKostya Serebryany2016-06-071-0/+14
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 271968
* [CMake] Support constructing output paths from LLVM variablesChris Bieneman2016-06-031-1/+7
| | | | | | | | This tweak to constructing output paths allows compiler-rt to use LLVM output variables if they are set regardless of whether or not the build is in-tree. llvm-svn: 271749
* [CMake] detect_target_arch needs to be moved to UtilsChris Bieneman2016-06-032-34/+34
| | | | | | 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. llvm-svn: 271693
* This patch is activating the build of Asan on Windows 64-bits.Etienne Bergeron2016-05-271-4/+2
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 271049
* [sanitizer] Fix a typo in config-ix.cmake causing all Darwin embedded ↵Kuba Brecka2016-05-261-1/+1
| | | | | | platforms to be built with the 'iossim' SDK. llvm-svn: 270840
* [compiler-rt] Fix multi-configuration output pathsEtienne Bergeron2016-05-161-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When using a multi-configuration build (i.e. MSVC) the output path where libraries are dropped is incorrect. Example: ``` C:\src\llvm\examples>d:\src\llvm\build\Release\bin\clang-cl.exe -fsanitize=address test.cc LINK : fatal error LNK1181: cannot open input file 'd:\src\llvm\build\Release\bin\..\lib\clang\3.9.0\lib\windows\clang_rt.asan-i386.lib' ``` The dropped executable path contains the configuration 'Release': ``` 'd:\src\llvm\build\Release\bin\..\lib\clang\3.9.0\lib\windows\Release\clang_rt.asan-i386.lib' ``` The variable 'RUNTIME_OUTPUT_DIRECTORY' is used to specify the output directory. But CMAKE is appending the current configuration (i.e. Debug, Release). see: https://cmake.org/cmake/help/v3.0/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.html ``` "Multi-configuration generators (VS, Xcode) append a per-configuration subdirectory to the specified directory." ``` To avoid this problem, the configuration specific variable must be set: 'RUNTIME_OUTPUT_DIRECTORY_DEBUG', 'RUNTIME_OUTPUT_DIRECTORY_RELEASE', and so on. Reviewers: ddunbar, chapuni, rnk Subscribers: kubabrecka, llvm-commits Differential Revision: http://reviews.llvm.org/D20261 llvm-svn: 269658
* Revert "[MSan] Enable on PowerPC64."Marcin Koscielnicki2016-05-141-1/+1
| | | | | | | | This reverts commit r269522. This broke dtls_test.c on ppc64le buildbots. llvm-svn: 269532
* [MSan] Enable on PowerPC64.Marcin Koscielnicki2016-05-141-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20001 llvm-svn: 269522
* [CMake] Cache check results and avoid duplicate checksChris Bieneman2016-05-112-8/+9
| | | | | | This caches the result of builtin_check_c_compiler_flag, and removes a duplicate check for C99 flag support. llvm-svn: 269230
* [CMake] Support platform building builtins without a full toolchainChris Bieneman2016-05-093-131/+332
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 268977
* [CMake] NFC. Add support for testing the compiler without testing the linkerChris Bieneman2016-05-033-13/+81
| | | | | | | | | | | | | | | | | | | Summary: One of the big limitations we have in the compiler-rt build system today is that we cannot bootstrap building the builtins because you need a fully functional toolchain to pass CMake's tests. This change adds support for compile only tests. It is NFC because nothing is using the compile-only tests yet. I believe this is the last separable part of D16653. Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19692 llvm-svn: 268427
* [CMake] Adding another missing include. NFC.Chris Bieneman2016-04-281-0/+2
| | | | | | This also works fine today, but will break with my upcoming refactoring. llvm-svn: 267941
* [CMake] Updating Apple CMake cache fileChris Bieneman2016-04-281-3/+6
| | | | | | Changing the Apple CMake cache file to better match the way Apple Clang builds are built. llvm-svn: 267913
* [CMake] Adding some missing CMake includes. NFC.Chris Bieneman2016-04-281-0/+3
| | | | | | This happens to be working now because the includes exist in another CMake file that is included before this one. That will change with upcoming refactoring. llvm-svn: 267912
* [Compiler-rt][CFI] Enabling CFI for MIPS64Mohit K. Bhakkad2016-04-271-1/+1
| | | | | | | | | | Reviewers: eugenis Subscribers: jaydeep, sagar, Sanitizers Differential Revision: http://reviews.llvm.org/D19531 llvm-svn: 267674
* [CMake] [PR27403] Fix COMPILER_RT_ENABLE_IOS when using Xcode from the App ↵Chris Bieneman2016-04-262-2/+6
| | | | | | | | | | 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. llvm-svn: 267575
* [esan] EfficiencySanitizer base runtime libraryDerek Bruening2016-04-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 267060
* [sanitizer] [SystemZ] Enable UBSan.Marcin Koscielnicki2016-04-151-2/+8
| | | | | | | | | 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 llvm-svn: 266483
* Use `CMAKE_HOST_UNIX` to check the host.Sean Silva2016-04-061-1/+1
| | | | | | `UNIX` is for the target. llvm-svn: 265595
* [CMake] Provide the ability to skip stripping when generating dSYMsChris Bieneman2016-03-311-1/+5
| | | | | | For debugging it is useful to be able to generate dSYM files but not strip the executables. This change adds the ability to skip stripping by setting COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP=On. llvm-svn: 265057
* [cmake] Get the MSVC version by running cl rather than relying on MSVC_VERSIONReid Kleckner2016-03-301-7/+23
| | | | | | | MSVC_VERSION comes from the _MSC_VER macro, which won't correspond to the STL version if the host compiler is clang-cl. llvm-svn: 264901
* Move -fms-compatibility-version=19 into target cflagsReid Kleckner2016-03-221-2/+7
| | | | | | | This reduces cflags duplication and allows us to build sanitizer_common/tests with clang and the VS 2015 STL. llvm-svn: 264017
* [tsan] Build TSan dylibs for iOS-style simulatorsDevin Coughlin2016-03-201-0/+1
| | | | | | | | | | | 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 llvm-svn: 263910
* [CMake] Remove bash-ism in SanitizerLintCheckAlexey Samsonov2016-03-171-1/+1
| | | | llvm-svn: 263751
* [cmake] Address Samsonov's post-commit review of r262723Filipe Cabecinhas2016-03-052-3/+9
| | | | | | | | | | Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17896 llvm-svn: 262770
* [Compiler-rt][safestack] Enable for MIPSMohit K. Bhakkad2016-03-041-1/+1
| | | | | | | | | | Reviewers: samsonov Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17846 llvm-svn: 262690
* [CMake] Fix a typo in add_compiler_rt_library.Alexey Samsonov2016-02-261-1/+1
| | | | llvm-svn: 262063
* [CMake] Support component-based installation for runtime librariesChris Bieneman2016-02-231-2/+38
| | | | | | This enables targets like "install-ubsan" and "install-asan" to install all associated runtime libraries. llvm-svn: 261700
OpenPOWER on IntegriCloud