summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* [scudo] Android build supportKostya Kortchinsky2017-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Mark Android as supported in the cmake configuration for Scudo. Scudo is not added yet in the Android build bots, but code builds and tests pass locally. It is for a later CL. I also checked that Scudo builds as part of the Android toolchain. A few modifications had to be made: - Android defaults to `abort_on_error=1`, which doesn't work well with the current tests. So change the default way to pass `SCUDO_OPTIONS` to the tests to account for this, setting it to 0 by default; - Disable the `valloc.cpp` & `random_shuffle.cpp` tests on Android; - There is a bit of gymnatic to be done with the `SCUDO_TEST_TARGET_ARCH` string, due to android using the `-android` suffix, and `i686` instead of `i386`; - Android doesn't need `-lrt`. Reviewers: alekseyshl, eugenis Reviewed By: alekseyshl Subscribers: srhines, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D37907 llvm-svn: 313538
* [ubsan-minimal] Enable on DarwinVedant Kumar2017-09-111-1/+1
| | | | | | | | Testing: check-ubsan-minimal Differential Revision: https://reviews.llvm.org/D37646 llvm-svn: 312959
* [cmake] Work around more -Wunused-driver-argument warningsVedant Kumar2017-09-071-1/+8
| | | | | | | add_compiler_rt_object_libraries should strip out the -msse3 option on non-macOS Apple platforms. llvm-svn: 312688
* [cmake] Remove accidentally committed warning messagesVedant Kumar2017-09-011-2/+0
| | | | llvm-svn: 312393
* [cmake] Work around -Wunused-driver-argument warningsVedant Kumar2017-09-012-1/+22
| | | | | | | Fix the Darwin logic so that -msse3 is only used on macOS, and -fomit-frame-pointer is not used on armv7/armv7k/armv7s. llvm-svn: 312390
* [cmake] Fix the list of arm32 architecturesMartin Storsjo2017-08-311-1/+0
| | | | | | | This was accidentally changed in SVN r311924, which was only supposed to change the behaviour for x86. llvm-svn: 312230
* Add preliminary NetBSD support in libfuzzerKamil Rytarowski2017-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This code already works and passes some number of tests. There is need to finish remaining sanitizers to get better coverage. Many tests fail due to overly long file names of executables (>31). This is a current shortcoming of the NetBSD 8(beta) kernel, as certain functions can fail (like retrieving file name of executable). Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka, george.karpenkov Reviewed By: kcc Subscribers: mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D37304 llvm-svn: 312183
* [builtins] Prevent duplicate definitions for overridden functionsFrancis Ricci2017-08-302-32/+32
| | | | | | | | | | | | | | | Summary: Some architecture-specific function overrides (for example, i386/ashrdi3.S) duplicate generic functions (in that case, ashrdi3.c). Prevent duplicate definitions by filtering out the generic files before compiling. Reviewers: compnerd, beanz Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D37166 llvm-svn: 312140
* Restore clang_rt library name on i686-android.Evgeniy Stepanov2017-08-291-3/+11
| | | | | | | | | | | | | | | | | Summary: Recent changes canonicalized clang_rt library names to refer to "i386" on all x86 targets. Android historically uses i686. This change adds a special case to keep i686 in all clang_rt libraries when targeting Android. Reviewers: hans, mgorny, beanz Subscribers: srhines, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D37278 llvm-svn: 312048
* Disable ubsan-minimal on Darwin.Evgeniy Stepanov2017-08-291-1/+1
| | | | | | | Should un-break this bot: http://green.lab.llvm.org/green//job/clang-stage1-configure-RA_build/38264/consoleFull llvm-svn: 312036
* Minimal runtime for UBSan.Evgeniy Stepanov2017-08-291-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: An implementation of ubsan runtime library suitable for use in production. Minimal attack surface. * No stack traces. * Definitely no C++ demangling. * No UBSAN_OPTIONS=log_file=/path (very suid-unfriendly). And no UBSAN_OPTIONS in general. * as simple as possible Minimal CPU and RAM overhead. * Source locations unnecessary in the presence of (split) debug info. * Values and types (as in A+B overflows T) can be reconstructed from register/stack dumps, once you know what type of error you are looking at. * above two items save 3% binary size. When UBSan is used with -ftrap-function=abort, sometimes it is hard to reason about failures. This library replaces abort with a slightly more informative message without much extra overhead. Since ubsan interface in not stable, this code must reside in compiler-rt. Reviewers: pcc, kcc Subscribers: srhines, mgorny, aprantl, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D36810 llvm-svn: 312029
* Reland r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-284-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 llvm-svn: 311924
* Proper dependency check for clang in compiler_rt.George Karpenkov2017-08-281-1/+1
| | | | | | | | | | - Not having a dependency does not work in standalone build, as Clang does not exist. - if (TARGET clang) check is useless, as it is order-dependent, and Clang may not be registered yet. Differential Revision: https://reviews.llvm.org/D37228 llvm-svn: 311911
* Revert r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-274-3/+9
| | | | | | | The required change in clang is being reverted because of the Android build bot failure. llvm-svn: 311859
* [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-274-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 llvm-svn: 311842
* Automatically pick up new sanitizers in cmake.Evgeniy Stepanov2017-08-261-1/+1
| | | | | | | | Change the default of COMPILER_RT_SANITIZERS_TO_BUILD to "all" in order to automatically pick up new sanitizers in existing build trees. llvm-svn: 311824
* Revert "Add Clang dependency to the check for Clang C++ headers."Adrian Prantl2017-08-251-4/+6
| | | | | | | This temporarily reverts commit r311733, because of bot breakage. http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/38139/consoleFull#-256426522e9a0fee5-ebcc-4238-a641-c5aa112c323e llvm-svn: 311757
* Add Clang dependency to the check for Clang C++ headers.George Karpenkov2017-08-241-6/+4
| | | | | | | | | | | | | | | | | The problem is that CMake is mostly imperative and the result of processing "if (TARGET blah)" checks depends on the order of import of CMake files. In this case, "projects" folder is registered before "tools", and calling "CheckClangHeaders" [renamed to have a better name] errors out without even giving Clang a chance to be built. This, in turn, leads to libFuzzer bot failures in some circumstances on some machines (depends on whether LIT or UNIT tests are scheduled first). Differential Revision: https://reviews.llvm.org/D37126 llvm-svn: 311733
* [libFuzzer] Move check for thread_local back into libFuzzer's CMake,George Karpenkov2017-08-221-10/+0
| | | | | | as it breaks builtin standalone build on some bots. llvm-svn: 311482
* Move libFuzzer to compiler_rt.George Karpenkov2017-08-213-5/+30
| | | | | | | | | Resulting library binaries will be named libclang_rt.fuzzer*, and will be placed in Clang toolchain, allowing redistribution. Differential Revision: https://reviews.llvm.org/D36908 llvm-svn: 311407
* [NFC CMake] Do not relink test targets every time in compiler-rtGeorge Karpenkov2017-08-211-6/+9
| | | | | | | | | | | | | CMake's add_custom_target is considered to be *always* out of date. This patch changes it to a combination of add_custom_target and add_custom_command which actually tracks dependencies' timestamps. On my machine this reliably saves 6-7 seconds on each test group. This can be a large difference when debugging small tests. Differential Revision: https://reviews.llvm.org/D36912 llvm-svn: 311384
* Quickfix to the refactoring commit: typo in the link flags variableGeorge Karpenkov2017-08-151-1/+1
| | | | | | name. llvm-svn: 310973
* [sanitizers CMake] NFC Refactor the logic for compiling and generating testsGeorge Karpenkov2017-08-151-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | into a function. Most CMake configuration under compiler-rt/lib/*/tests have almost-the-same-but-not-quite functions of the form add_X_[unit]tests for compiling and running the tests. Much of the logic is duplicated with minor variations across different sub-folders. This can harm productivity for multiple reasons: For newcomers, resulting CMake files are very large, hard to understand, and hide the intention of the code. Changes for enabling certain architectures end up being unnecessarily large, as they get duplicated across multiple folders. Adding new sub-projects requires more effort than it should, as a developer has to again copy-n-paste the configuration, and it's not even clear from which sub-project it should be copy-n-pasted. With this change the logic of compile-and-generate-a-set-of-tests is extracted into a function, which hopefully makes writing and reading CMake much easier. Differential Revision: https://reviews.llvm.org/D36116 llvm-svn: 310971
* [CMake compiler-rt] NFC: Minor CMake refactoring.George Karpenkov2017-08-151-2/+6
| | | | | | | | | Detect ObjC files in `clang_compile` and pass an appropriate flag to a compiler, also change `clang_compile` to a function. Differential Revision: https://reviews.llvm.org/D36727 llvm-svn: 310945
* [compiler-rt CMake] NFC: Minor CMake refactoring.George Karpenkov2017-08-151-9/+6
| | | | | | | | | | Change macro to a function, and use a generic variable instead of branching for handling multi-output build with CMAKE_CONFIGURATION_TYPES. Differential Revision: https://reviews.llvm.org/D36725 llvm-svn: 310944
* [compiler-rt CMake] CMake refactoring: create directories in helper func.George Karpenkov2017-08-151-5/+7
| | | | | | | | | Change macro to a function, move creating test directory into `add_compiler_rt_test`. Differential Revision: https://reviews.llvm.org/D36724 llvm-svn: 310943
* Revert: Enable profile on NetBSDKamil Rytarowski2017-08-151-1/+1
| | | | | | | | Requested by V.Kumar. Not all tests pass. llvm-svn: 310912
* Enable profile on NetBSDKamil Rytarowski2017-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: make check-profile: Failing Tests (2): Profile-i386 :: instrprof-dlopen.test Profile-x86_64 :: instrprof-dlopen.test Expected Passes : 64 Unsupported Tests : 42 Unexpected Failures: 2 Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, filcab, fjricci Reviewed By: vitalybuka Subscribers: vsk, llvm-commits, srhines, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36603 llvm-svn: 310800
* Enable ASAN on NetBSDKamil Rytarowski2017-08-101-3/+2
| | | | | | | | | | | | | | | | | | | Summary: This enables also static runtime option. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, filcab, kcc, fjricci Reviewed By: vitalybuka Subscribers: mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36490 llvm-svn: 310651
* Enable SafeStack on NetBSDKamil Rytarowski2017-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: make check-safestack: -- Testing: 8 tests, 8 threads -- Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. Testing Time: 0.44s Expected Passes : 7 Unsupported Tests : 1 Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, fjricci, filcab Reviewed By: vitalybuka Subscribers: mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36542 llvm-svn: 310646
* Enable ubsan on NetBSDKamil Rytarowski2017-08-081-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, filcab, fjricci Reviewed By: fjricci Subscribers: srhines, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36483 llvm-svn: 310412
* Enable COMPILER_RT_HAS_SANITIZER_COMMON on NetBSDKamil Rytarowski2017-08-081-2/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Temporarily keep disabled COMPILER_RT_HAS_ASAN on NetBSD. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, filcab, kcc, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, mgorny, #sanitizers, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36312 llvm-svn: 310370
* [sanitizer_common] Fuchsia OS support codeVitaly Buka2017-08-011-1/+1
| | | | | | | | | | | | | | | | Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: vitalybuka Subscribers: cryptoad, srhines, kubamracek, mgorny, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36031 llvm-svn: 309756
* [ubsan] Enable UBSan build for FuchsiaVitaly Buka2017-08-011-1/+1
| | | | | | | | | | | | | | | | Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: vitalybuka Subscribers: srhines, kubamracek, mgorny, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36033 llvm-svn: 309742
* Revert rL309634 until upstream buildbots have upgraded libc.Sterling Augustine2017-08-012-7/+1
| | | | llvm-svn: 309704
* [sanitizer] Fix the sanitizer build on AndroidPetr Hosek2017-07-311-1/+11
| | | | | | | | | | Android uses libgcc name even for shared library unlike other platforms which use libgcc_s. Furthemore, Android libstdc++ has a dependency on libdl. These need to be handled while performing CMake checks. Differential Revision: https://reviews.llvm.org/D36035 llvm-svn: 309638
* Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine2017-07-312-1/+7
| | | | | | | | | | | | | | Summary: Add powerpc64 to compiler-rt build infrastructure. Reviewers: timshen Reviewed By: timshen Subscribers: nemanjai, dberris, mgorny, aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D36108 llvm-svn: 309634
* [sanitizer tests CMake] Factor out CMake logic for compiling sanitizer testsGeorge Karpenkov2017-07-281-0/+35
| | | | | | | | | | | Currently there's a large amount of CMake logic duplication for compiling sanitizer tests. If we add more sanitizers, the duplication will get even worse. This change factors out common compilation commands into a macro available to all sanitizers. llvm-svn: 309405
* Support compiler-rt builtinsPetr Hosek2017-07-282-1/+42
| | | | | | | | | This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 llvm-svn: 309361
* [sanitizers] Sanitizer tests CMake clean up: try #2George Karpenkov2017-07-281-4/+1
| | | | | | | | | | | | | | | | | This patch addresses two issues: Most of the time, hacks with `if/else` in order to get support for multi-configuration builds are superfluous. The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it expands to `.` on all single-configuration builds, and to a configuration name otherwise. The `if/else` hacks for the library name generation should also not be done, as CMake has `TARGET_FILE` generator expression precisely for this purpose, as it expands to the exact filename of the resulting target. Differential Revision: https://reviews.llvm.org/D35952 llvm-svn: 309341
* Revert "[sanitizers] Sanitizer tests CMake clean up"George Karpenkov2017-07-271-1/+4
| | | | | | | | This reverts commit 0ab44db2aa1cd3710355ad79b04f954ce68c0b3a. Fails on some bots, reverting until I can fix it. llvm-svn: 309318
* [sanitizers] Sanitizer tests CMake clean upGeorge Karpenkov2017-07-271-4/+1
| | | | | | | | | | | | | | | | | This patch addresses two issues: Most of the time, hacks with `if/else` in order to get support for multi-configuration builds are superfluous. The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it expands to `.` on all single-configuration builds, and to a configuration name otherwise. The `if/else` hacks for the library name generation should also not be done, as CMake has `TARGET_FILE` generator expression precisely for this purpose, as it expands to the exact filename of the resulting target. Differential Revision: https://reviews.llvm.org/D35952 llvm-svn: 309306
* Revert "[sanitizer] Support compiler-rt builtins"Petr Hosek2017-07-262-42/+1
| | | | | | This reverts commit fd63314d6770e0da62572a3fea2c41c4cc0fc58a. llvm-svn: 309083
* [sanitizer] Support compiler-rt builtinsPetr Hosek2017-07-252-1/+42
| | | | | | | | | This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 llvm-svn: 309060
* On Darwin, start building the TSan iOS dylib by default.Kuba Mracek2017-07-121-0/+1
| | | | llvm-svn: 307839
* On Darwin, start building the TSan dylib for the iOS simulator.Kuba Mracek2017-07-121-3/+1
| | | | llvm-svn: 307816
* Fix the declaration of DARWIN_PREFER_PUBLIC_SDK cmake variable (move before ↵Kuba Mracek2017-07-121-1/+2
| | | | | | the return). llvm-svn: 307815
* [cmake] Cache results of find_darwin_sdk_dirKuba Mracek2017-07-071-0/+6
| | | | | | | | This improves find_darwin_sdk_dir to cache the results of executing xcodebuild to find the SDK. Should significantly reduce the CMake re-configure time. Differential Revision: https://reviews.llvm.org/D34736 llvm-svn: 307344
* [cmake] Add an option to prefer public SDK in find_darwin_sdk_dirKuba Mracek2017-07-061-8/+11
| | | | | | | | Adds a CMake option DARWIN_PREFER_PUBLIC_SDK, off by default. When on, this prefers to use the public SDK, even when an internal one is present. With this, it's easy to emulate a build that the public buildbots are doing. Differential Revision: https://reviews.llvm.org/D35071 llvm-svn: 307330
* [scudo] Enabling MIPS support for ScudoSagar Thakur2017-06-191-1/+1
| | | | | | | | | Adding MIPS 32-bit and 64-bit support for Scudo. Reviewed by cryptoad, sdardis. Differential: D31803 llvm-svn: 305682
OpenPOWER on IntegriCloud