summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* libFuzzer, OpenBSD supportVitaly Buka2018-04-091-1/+1
| | | | | | | | | | | | | | | | | | Summary: - Enabling libfuzzer on OpenBSD - OpenBSD can t support asan, msan ... the tests can t be run. Patch by David CARLIER Reviewers: eugenis, phosek, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, mgorny, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44877 llvm-svn: 329631
* shadowcallstack: Make runtime tests compatible with aarch64.Peter Collingbourne2018-04-091-0/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D45303 llvm-svn: 329614
* [XRay][compiler-rt] Build XRay runtime for OpenBSDDean Michael Berris2018-04-041-1/+1
| | | | | | | | | | | | | | | | | | Summary: This is D45125; the patch enables the build of XRay on OpenBSD. We also introduce some OpenBSD specific changes to the runtime implementation, involving how we get the TSC rate through the syscall interface specific to OpenBSD. Reviewers: dberris Authored by: devnexen Subscribers: dberris, mgorny, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D45125 llvm-svn: 329189
* [HWASan] Port HWASan to Linux x86-64 (compiler-rt)Alex Shlyapnikov2018-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Porting HWASan to Linux x86-64, first of the three patches, compiler-rt part. The approach is similar to ARM case, trap signal is used to communicate memory tag check failure. int3 instruction is used to generate a signal, access parameters are stored in nop [eax + offset] instruction immediately following the int3 one Had to add HWASan init on malloc because, due to much less interceptors defined (most other sanitizers intercept much more and get initalized via one of those interceptors or don't care about malloc), HWASan was not initialized yet when libstdc++ was trying to allocate memory for its own fixed-size heap, which led to CHECK-fail in AllocateFromLocalPool. Also added the CHECK() failure handler with more detailed message and stack reporting. Reviewers: eugenis Subscribers: kubamracek, dberris, mgorny, kristof.beyls, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44705 llvm-svn: 328385
* [Fuzzer] Avoid the unnecessary rebuild of the custom libc++Petr Hosek2018-03-071-20/+61
| | | | | | | | | | | | This changes the add_custom_libcxx macro to resemble the llvm_ExternalProject_Add. The primary motivation is to avoid unnecessary libFuzzer rebuilds that are being done on every Ninja/Make invocation. The libc++ should be only rebuilt whenever the libc++ source itself changes. Differential Revision: https://reviews.llvm.org/D43213 llvm-svn: 326921
* OpenBSD UBsan support, cmake partKamil Rytarowski2018-03-032-6/+15
| | | | | | | | | | | | | | | | | | Summary: On OpenBSD no multi arch support Enabling only UBsan and disabling Asan. Patch by: David CARLIER Reviewers: krytarowski, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, mgorny, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44017 llvm-svn: 326646
* Adding Msan support to FreeBSDKamil Rytarowski2018-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Enabling the memory sanitizer support for FreeBSD, most of unit tests are compatible. - Adding fstat and stressor_r interceptors. - Updating the struct link_map access since most likely the struct Obj_Entry had been updated since. - Disabling few unit tests until further work is needed (or we can assume it can work in real world code). Patch by: David CARLIER Reviewers: vitalybuka, krytarowski Reviewed By: vitalybuka Subscribers: eugenis, dim, srhines, emaste, kubamracek, mgorny, fedor.sergeev, hintonda, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43080 llvm-svn: 326644
* [PATCH] [compiler-rt, RISCV] Support builtins for RISC-VShiva Chen2018-03-014-1/+18
| | | | | | | | | | | Summary: Support builtins for RISC-V, RV32 and RV64. Reviewers: asb, apazos, mgrang Differential Revision: https://reviews.llvm.org/D42958 llvm-svn: 326420
* Add initial XRay support for NetBSDKamil Rytarowski2018-02-161-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Reuse the existing FreeBSD code as it is. Sponsored by <The NetBSD Foundation> Reviewers: dberris, rnk, vitalybuka Reviewed By: dberris Subscribers: mclow.lists, emaste, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43370 llvm-svn: 325345
* Add Xray instrumentation support to FreeBSDKamil Rytarowski2018-02-151-1/+1
| | | | | | | | | | | | | | | | | | | Summary: - Enabling the build. - Using assembly for the cpuid parts. - Using thr_self FreeBSD call to get the thread id Patch by: David CARLIER Reviewers: dberris, rnk, krytarowski Reviewed By: dberris, krytarowski Subscribers: emaste, stevecheckoway, nglevin, srhines, kubamracek, dberris, mgorny, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43278 llvm-svn: 325240
* [fuzzer] Update and enable libFuzzer on FuchsiaPetr Hosek2018-01-301-1/+1
| | | | | | | | | | | | | This change updates the Fuchsia-specific code to use the C++ friendly duration expressions and flips on the building of libclang_rt.fuzzer-x86_64.a and similar for Fuchsia. Given that compiler-rt doesn't build on Fuchsia, test have been run by explicitly building the library and linking it against lib/fuzzer/tests/FuzzerUnittest.cpp. Differential Revision: https://reviews.llvm.org/D42670 llvm-svn: 323828
* [scudo] Add support for Fuchsia OS.Kostya Kortchinsky2018-01-291-1/+1
| | | | | | | | | | | | | | Summary: Built & tested in Fuchsia's build system. Reviewers: alekseyshl, cryptoad, aarongreen Reviewed By: cryptoad Subscribers: srhines, mgorny Differential Revision: https://reviews.llvm.org/D42610 llvm-svn: 323685
* Revert: [compiler-rt] r323626 - [cmake] [compiler-rt] Remove duplicate ↵Don Hinton2018-01-291-1/+1
| | | | | | | | | CMAKE_CXX_FLAGS. Looks like it broke a bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/7195 Reverting until I have a chance to investigate. llvm-svn: 323629
* [cmake] [compiler-rt] Remove duplicate CMAKE_CXX_FLAGS.Don Hinton2018-01-291-1/+1
| | | | | | | | | | `set_target_compile_flags()` ultimately sets COMPILE_FLAGS which is added to CMAKE_CXX_FLAGS in the compile rule, so passing CMAKE_CXX_FLAGS causes them to be duplicated. Differential Revision: https://reviews.llvm.org/D42398 llvm-svn: 323626
* [cmake] [compiler-rt] Call llvm_setup_rpath() when adding shared libraries.Don Hinton2018-01-271-0/+3
| | | | | | | | | Clang and llvm already use llvm_setup_rpath(), so this change will help standarize rpath usage across all projects. Differential Revision: https://reviews.llvm.org/D42462 llvm-svn: 323606
* [sanitizer] Pass the CMake compiler to custom libc++ buildPetr Hosek2018-01-211-0/+3
| | | | | | This addresses the error introduced in r323054 on some bots. llvm-svn: 323061
* Reland "[Fuzzer] Parametrize add_custom_libcxx"Petr Hosek2018-01-211-10/+21
| | | | | | | | | | | | | add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323054
* Revert "[Fuzzer] Parametrize add_custom_libcxx"Petr Hosek2018-01-201-30/+8
| | | | | | This reverts commit r323032: failing on the sanitizer-x86_64-linux-autoconf bot. llvm-svn: 323033
* [Fuzzer] Parametrize add_custom_libcxxPetr Hosek2018-01-201-8/+30
| | | | | | | | | | | | | add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323032
* Reland "Install resource files into a share/ directory"Petr Hosek2018-01-141-2/+2
| | | | | | | | | | | Currently these files are being installed into a root installation directory, but this triggers an error when the installation directory is set to an empty string which is often the case when DESTDIR is used to control the installation destination. Differential Revision: https://reviews.llvm.org/D41673 llvm-svn: 322451
* lib Fuzzer FreeBSD supportKamil Rytarowski2018-01-121-1/+1
| | | | | | | | | | | | | | Summary: Patch by David CARLIER Reviewers: vitalybuka, kcc, dim, emaste, davide, morehouse, george.karpenkov Reviewed By: morehouse Subscribers: george.karpenkov, kubamracek, srhines, mgorny, emaste, krytarowski Differential Revision: https://reviews.llvm.org/D41642 llvm-svn: 322380
* Revert "Install resource files into a share/ directory"Petr Hosek2018-01-111-2/+2
| | | | | | This reverts commit r322256: broke the dfsan build. llvm-svn: 322261
* Reland "Install resource files into a share/ directory"Petr Hosek2018-01-111-2/+2
| | | | | | | | | | | Currently these files are being installed into a root installation directory, but this triggers an error when the installation directory is set to an empty string which is often the case when DESTDIR is used to control the installation destination. Differential Revision: https://reviews.llvm.org/D41673 llvm-svn: 322256
* Revert "Install resource files into a share/ directory"Petr Hosek2018-01-111-2/+2
| | | | | | This reverts commit r322234: this is breaking dfsan tests. llvm-svn: 322243
* Reland "Install resource files into a share/ directory"Petr Hosek2018-01-101-2/+2
| | | | | | | | | | | Currently these files are being installed into a root installation directory, but this triggers an error when the installation directory is set to an empty string which is often the case when DESTDIR is used to control the installation destination. Differential Revision: https://reviews.llvm.org/D41673 llvm-svn: 322234
* Revert "[CMake] Install resource files into a share/ directory"Petr Hosek2018-01-101-1/+1
| | | | | | This reverts commit r322153 because it broke the sanitizer bots. llvm-svn: 322156
* [CMake] Install resource files into a share/ directoryPetr Hosek2018-01-101-1/+1
| | | | | | | | | | | Currently these files are being installed into a root installation directory, but this triggers an error when the installation directory is set to an empty string which is often the case when DESTDIR is used to control the installation destination. Differential Revision: https://reviews.llvm.org/D41673 llvm-svn: 322153
* [Sanitizers, CMake] Basic sanitizer Solaris support (PR 33274)Alex Shlyapnikov2017-12-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch, on top of https://reviews.llvm.org/D40898, contains the build system changes necessary to enable the Solaris/x86 sanitizer port. The only issue of note is the libclang_rt.sancov_{begin, end} libraries: clang relies on the linker automatically defining __start_SECNAME and __stop_SECNAME labels for sections whose names are valid C identifiers. This is a GNU ld extension not present in the ELF gABI, also implemented by gold and lld, but not by Solaris ld. To work around this, I automatically link the sancov_{begin,end} libraries into every executable for now. There seems to be now way to build individual startup objects like crtbegin.o/crtend.o, so I've followed the lead of libclang_rt.asan-preinit which also contains just a single object. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, mgorny, fedor.sergeev, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40899 llvm-svn: 321373
* [CMake] Allow passing extra CMake arguments to custom libc++Petr Hosek2017-12-211-1/+2
| | | | | | | | This can be used to customize the libc++ build. Differential Revision: https://reviews.llvm.org/D41103 llvm-svn: 321299
* [profile] Port the runtime to Solaris (retry)Vedant Kumar2017-12-141-1/+1
| | | | | | | | | | | | | This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Hopefully the Windows support is fixed now. Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 llvm-svn: 320731
* Revert "(HEAD -> master, origin/master, origin/HEAD) [profile] Port the ↵Vedant Kumar2017-12-141-1/+1
| | | | | | | | | | | runtime to Solaris" This reverts commit r320726. It looks like flock isn't available on Windows: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21317/steps/build%20compiler-rt/logs/stdio llvm-svn: 320728
* [profile] Port the runtime to SolarisVedant Kumar2017-12-141-1/+1
| | | | | | | | | | | This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 llvm-svn: 320726
* [CMake] Support runtimes and monorepo layouts when looking for libcxxPetr Hosek2017-12-121-1/+1
| | | | | | | | | This also slightly refactors the code that's checking the directory presence which allows eliminating one unnecessary variable. Differential Revision: https://reviews.llvm.org/D40637 llvm-svn: 320446
* Hardware-assisted AddressSanitizer (compiler-rt)Evgeniy Stepanov2017-12-091-1/+13
| | | | | | | | | | | | | | Summary: Runtime library for HWASan, initial commit. Does not randomize tags yet, does not handle stack or globals. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, kubamracek, dberris, mgorny, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40935 llvm-svn: 320231
* [compiler-rt] Add install-*-stripped targetsShoaib Meenai2017-12-012-0/+17
| | | | | | | | | | | These targets strip during installation, and are required to support install-distribution-stripped in LLVM (to support a stripped distribution). LLVM has an add_llvm_install_targets function for this purpose, but we can't rely on LLVM being present. Differential Revision: https://reviews.llvm.org/D40687 llvm-svn: 319569
* Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine2017-11-302-1/+7
| | | | | | | | Now that we have disabled the run-forever tests, and cleaned up the intel 80-bit float based tests, we should be able to enable testing compiler-rt for powerpc64. llvm-svn: 319474
* [sanitizer] Refactor how assembly files are handledKuba Mracek2017-11-291-0/+11
| | | | | | | | This renames ASM_TSAN_SYMBOL and ASM_TSAN_SYMBOL_INTERCEPTOR to just ASM_SYMBOL and ASM_SYMBOL_INTERCEPTOR, because they can be useful in more places than just TSan. Also introduce a CMake function to add ASM sources to a target. Differential Revision: https://reviews.llvm.org/D40143 llvm-svn: 319339
* Revert change for LibFuzzer target archsYi Kong2017-11-291-1/+1
| | | | | | Broke buildbot. llvm-svn: 319296
* [LibFuzzer] Add Android to LibFuzzer's supported OSesYi Kong2017-11-291-2/+2
| | | | | | | | ... and a trivial fix that x86_64h arch should also be supported. Differential Revision: https://reviews.llvm.org/D40592 llvm-svn: 319288
* [XRay][compiler-rt][Darwin] Minimal XRay build support in DarwinDean Michael Berris2017-11-281-4/+9
| | | | | | | | | | | | | | | | | | | | | | | This change is the first in a series of changes to get the XRay runtime building on macOS. This first allows us to build the minimal parts of XRay to get us started on supporting macOS development. These include: - CMake changes to allow targeting x86_64 initially. - Allowing for building the initialisation routines without `.preinit_array` support. - Use __sanitizer::SleepForMillis() to work around the lack of clock_nanosleep on macOS. - Deprecate the xray_fdr_log_grace_period_us flag, and introduce the xray_fdr_log_grace_period_ms flag instead, to use milliseconds across platforms. Reviewers: kubamracek Subscribers: llvm-commits, krytarowski, nglevin, mgorny Differential Review: https://reviews.llvm.org/D39114 llvm-svn: 319165
* Build more sanitizers for NetBSDKamil Rytarowski2017-11-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: Enable for NetBSD: - MSan, - TSan, - LSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, dvyukov, vitalybuka Reviewed By: eugenis Subscribers: srhines, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40464 llvm-svn: 319060
* Allow compiler-rt test targets to work with multi-config CMake generatorsGreg Bedwell2017-11-131-0/+11
| | | | | | | | | | Multi-config CMake generators need lit to be able to resolve paths of artifacts from previous build steps at lit time, rather than expect them to be fully resolved at CMake time as they may contain the build mode. Differential Revision: https://reviews.llvm.org/D38471 llvm-svn: 318037
* Revert "[XRay][darwin] Initial XRay in Darwin Support"Dean Michael Berris2017-11-101-9/+4
| | | | | | This reverts r317875. llvm-svn: 317877
* [XRay][darwin] Initial XRay in Darwin SupportDean Michael Berris2017-11-101-4/+9
| | | | | | | | | | | | | | | | | | | | | | Summary: This change implements the changes required in both clang and compiler-rt to allow building XRay-instrumented binaries in Darwin. For now we limit this to x86_64. We also start building the XRay runtime library in compiler-rt for osx. A caveat to this is that we don't have the tests set up and running yet, which we'll do in a set of follow-on changes. This patch uses the monorepo layout for the coordinated change across multiple projects. Reviewers: kubamracek Subscribers: mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D39114 llvm-svn: 317875
* [LSan] Enable LSan tests on PPC64 Linux.Alex Shlyapnikov2017-10-261-1/+1
| | | | | | | | | | | | | | | Summary: LSan is functional on PPC64 Linux now, let's enable all tests. One test required ppc specific changes: use_registers.cc. Reviewers: eugenis Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D39316 llvm-svn: 316698
* [cmake] Fix skipping DEPS (typo) in sanitizer_test_compile()Michal Gorny2017-10-121-1/+1
| | | | | | | | | | Fix typo in variable assignment inside sanitizer_test_compile() that resulted in TEST_DEPS parameter not being included in the clang_compile() call. Spotted by George Karpenkov in D38444. Differential Revision: https://reviews.llvm.org/D38838 llvm-svn: 315604
* Make the cfi target available on more platforms.Peter Collingbourne2017-10-091-2/+1
| | | | | | | | On non-Linux targets it just installs the blacklist. Differential Revision: https://reviews.llvm.org/D38661 llvm-svn: 315215
* [sanitizer] Test ubsan and cfi on android.Evgeniy Stepanov2017-10-061-1/+1
| | | | | | | | | | | | | | | Summary: Enable check-cfi and check-ubsan on Android. Check-ubsan includes standalone and ubsan+asan, but not tsan or msan. Cross-dso cfi tests are disabled for now. Reviewers: vitalybuka, pcc Subscribers: srhines, kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38608 llvm-svn: 315105
* Fix cmake file broken by D38277.Alex Shlyapnikov2017-09-291-1/+1
| | | | llvm-svn: 314528
* [CMake] Fix configuration on PowerPC with sanitizersJonas Hahnfeld2017-09-291-0/+6
| | | | | | | | | TEST_BIG_ENDIAN() performs compile tests that will fail with -nodefaultlibs when building under LLVM_USE_SANITIZER. Differential Revision: https://reviews.llvm.org/D38277 llvm-svn: 314512
OpenPOWER on IntegriCloud