Commit Graph

447 Commits

Author SHA1 Message Date
George Karpenkov 4c26922662 Quickfix to the refactoring commit: typo in the link flags variable
name.

llvm-svn: 310973
2017-08-15 23:22:52 +00:00
George Karpenkov 769124dc5e [sanitizers CMake] NFC Refactor the logic for compiling and generating tests
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
2017-08-15 22:56:10 +00:00
George Karpenkov 83ea28116e [CMake compiler-rt] NFC: Minor CMake refactoring.
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
2017-08-15 18:38:14 +00:00
George Karpenkov cb6be4dd90 [compiler-rt CMake] NFC: Minor CMake refactoring.
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
2017-08-15 18:35:02 +00:00
George Karpenkov d46f17db06 [compiler-rt CMake] CMake refactoring: create directories in helper func.
Change macro to a function, move creating test directory into
`add_compiler_rt_test`.

Differential Revision: https://reviews.llvm.org/D36724

llvm-svn: 310943
2017-08-15 18:32:28 +00:00
Kamil Rytarowski d341194d68 Revert: Enable profile on NetBSD
Requested by V.Kumar.

Not all tests pass.

llvm-svn: 310912
2017-08-15 09:56:47 +00:00
Kamil Rytarowski c4edc0705c Enable profile on NetBSD
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
2017-08-13 20:18:15 +00:00
Kamil Rytarowski 7a6b680622 Enable ASAN on NetBSD
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
2017-08-10 19:08:39 +00:00
Kamil Rytarowski fbd51b954d Enable SafeStack on NetBSD
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
2017-08-10 18:40:09 +00:00
Kamil Rytarowski c9bcc8dc9d Enable ubsan on NetBSD
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
2017-08-08 20:49:20 +00:00
Kamil Rytarowski 741d21f958 Enable COMPILER_RT_HAS_SANITIZER_COMMON on NetBSD
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
2017-08-08 15:25:26 +00:00
Vitaly Buka 5d960ec420 [sanitizer_common] Fuchsia OS support code
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
2017-08-01 22:22:25 +00:00
Vitaly Buka 6886061dab [ubsan] Enable UBSan build for Fuchsia
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
2017-08-01 20:48:36 +00:00
Sterling Augustine f6b2e770ea Revert rL309634 until upstream buildbots have upgraded libc.
llvm-svn: 309704
2017-08-01 17:16:05 +00:00
Petr Hosek a14a2cc5ce [sanitizer] Fix the sanitizer build on Android
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
2017-07-31 22:46:43 +00:00
Sterling Augustine 81fd449238 Add powerpc64 to compiler-rt build infrastructure.
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
2017-07-31 22:23:17 +00:00
George Karpenkov 831875b4bf [sanitizer tests CMake] Factor out CMake logic for compiling sanitizer tests
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
2017-07-28 17:32:37 +00:00
Petr Hosek 2bbb6ad217 Support compiler-rt builtins
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
2017-07-28 03:39:38 +00:00
George Karpenkov 50dd3fe903 [sanitizers] Sanitizer tests CMake clean up: try #2
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
2017-07-28 00:50:56 +00:00
George Karpenkov 1bf535daae Revert "[sanitizers] Sanitizer tests CMake clean up"
This reverts commit 0ab44db2aa1cd3710355ad79b04f954ce68c0b3a.

Fails on some bots, reverting until I can fix it.

llvm-svn: 309318
2017-07-27 20:44:33 +00:00
George Karpenkov 165a1edc85 [sanitizers] Sanitizer tests CMake clean up
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
2017-07-27 18:40:38 +00:00
Petr Hosek 3243a13f0a Revert "[sanitizer] Support compiler-rt builtins"
This reverts commit fd63314d6770e0da62572a3fea2c41c4cc0fc58a.

llvm-svn: 309083
2017-07-26 06:46:11 +00:00
Petr Hosek b1305ce038 [sanitizer] Support compiler-rt builtins
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
2017-07-25 23:38:25 +00:00
Kuba Mracek 4c4ea1d1ba On Darwin, start building the TSan iOS dylib by default.
llvm-svn: 307839
2017-07-12 20:25:14 +00:00
Kuba Mracek 46f2b8485a On Darwin, start building the TSan dylib for the iOS simulator.
llvm-svn: 307816
2017-07-12 17:30:54 +00:00
Kuba Mracek 476c3e9ba0 Fix the declaration of DARWIN_PREFER_PUBLIC_SDK cmake variable (move before the return).
llvm-svn: 307815
2017-07-12 17:11:53 +00:00
Kuba Mracek 7a493393b3 [cmake] Cache results of find_darwin_sdk_dir
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
2017-07-07 01:06:20 +00:00
Kuba Mracek 935243486c [cmake] Add an option to prefer public SDK in find_darwin_sdk_dir
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
2017-07-06 23:09:16 +00:00
Sagar Thakur 6478d14a0d [scudo] Enabling MIPS support for Scudo
Adding MIPS 32-bit and 64-bit support for Scudo.

Reviewed by cryptoad, sdardis.
Differential: D31803

llvm-svn: 305682
2017-06-19 11:28:59 +00:00
Jonathan Roelofs 3c8f953f61 Allow builds to set COMPILER_RT_OS_DIR differently from CMAKE_SYSTEM_NAME
llvm-svn: 303817
2017-05-24 22:41:49 +00:00
Jonathan Roelofs dc62b80c82 Allow armv{7,7s,7k,7m,7em} builds
llvm-svn: 303765
2017-05-24 15:53:24 +00:00
Francis Ricci fdcab2cbf2 Enable lsan test suite on Darwin x86_64 builds
Reviewers: kubamracek, alekseyshl

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D32191

llvm-svn: 302904
2017-05-12 15:10:05 +00:00
Sterling Augustine bb34f278a2 Roll back r301831 to fix broken powerpc64le tests.
http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/5941

llvm-svn: 301935
2017-05-02 16:43:39 +00:00
Sterling Augustine ba6c9cb5e8 Add powerpc64 and powerpc64le to build infrastructure.
From Phab D32031.

llvm-svn: 301831
2017-05-01 20:35:02 +00:00
Kuba Mracek 132c829ecc [asan] Add support for running lit tests in the iOS Simulator
This patch adds a basic support for running the ASan lit test suite against an iOS Simulator. This is done by generating more lit.site.cfg configurations into subdirectories such as IOSSimI386Config and IOSSimX86_64Config. These test suites are not added into "check-all" or into "check-asan", they have to be run manually.

Differential Revision: https://reviews.llvm.org/D31477

llvm-svn: 301443
2017-04-26 18:59:22 +00:00
Sagar Thakur a37c0d99c9 Revert [scudo] Enabling MIPS support for Scudo
This patch broke the buildbot clang-cmake-mips. Investigating the issue.

llvm-svn: 301173
2017-04-24 11:02:36 +00:00
Sagar Thakur 4bac44c805 [scudo] Enabling MIPS support for Scudo
Adding MIPS 32-bit and 64-bit support for Scudo.

Reviewed by cryptoad
Differential: D31803

llvm-svn: 301158
2017-04-24 04:29:44 +00:00
Ahmed Bougacha c6422fed85 Revert "Enable lsan test suite on Darwin x86_64 builds"
This reverts commit r300897.

Most LSan/ASan tests are failing on darwin bots.

llvm-svn: 300929
2017-04-21 00:00:59 +00:00
Francis Ricci dcaf4e2139 Enable lsan test suite on Darwin x86_64 builds
Reviewers: kubamracek, alekseyshl

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D32191

llvm-svn: 300897
2017-04-20 21:27:25 +00:00
Maxim Ostapenko de3b9a2ecc Reapply "Enable LSan for arm Linux"
This patch reapplies r299923 with typo fixed in BLX macros.

llvm-svn: 299948
2017-04-11 14:58:26 +00:00
Nico Weber 7124b5f6f9 Revert r299923, it doesn't build in bootstrap builds.
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.arm.dir/sanitizer_linux.cc.o 
lib/sanitizer_common/sanitizer_linux.cc:1340:24: error: invalid instruction
                       BLX(ip)
                       ^
lib/sanitizer_common/sanitizer_linux.cc:1313:19: note: expanded from macro 'BLX'
#  define BLX(R) "mov lr, pc; bx" #R "\n"
                  ^
<inline asm>:6:13: note: instantiated into assembly here
mov lr, pc; bxip
            ^~~~

llvm-svn: 299943
2017-04-11 14:28:49 +00:00
Maxim Ostapenko 950d2809d5 [lsan] Enable LSan for arm Linux
This patch enables LSan for arm Linux.

Differential Revision: https://reviews.llvm.org/D29586

llvm-svn: 299923
2017-04-11 08:13:38 +00:00
Francis Ricci 4cce35f0ce Enable builds of darwin lsan by default
Summary: Testing and asan leak detection are disabled by default.

Reviewers: kubamracek, kcc

Subscribers: srhines, llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D31307

llvm-svn: 299669
2017-04-06 17:41:26 +00:00
Francis Ricci ab85292261 Enable i386 builds for darwin lsan
Summary:
Now that __thread is no longer used for lsan on darwin, i386 builds
can be enabled.

Reviewers: kcc, kubamracek

Subscribers: danalbert, srhines, mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29995

llvm-svn: 298946
2017-03-28 21:56:44 +00:00
Kuba Mracek ded235a141 [sanitizers] Upgrade ios min version to 8
Differential Revision: https://reviews.llvm.org/D29787

llvm-svn: 298860
2017-03-27 17:16:47 +00:00
Bob Haarman 1012fe8a54 [compiler-rt] build compiler-rt runtimes without LTO
Summary: Currently, we build the compiler-rt runtimes with link-time optimization if LTO is configured for the LLVM project. This will break external programs that don't invoke the linker in such a way that it supports LLVM's LTO. To avoid this, this change causes the compiler-rt runtimes to be compiled with -fno-lto. This also makes the check-profile tests work on systems when doing a lld LTO build on a system where the system linker does not support LLVM LTO.

Reviewers: rnk, davidxl

Reviewed By: davidxl

Subscribers: dberris, mgorny, llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D31218

llvm-svn: 298525
2017-03-22 17:25:49 +00:00
Bob Haarman ccd6ae25f4 [compiler-rt] respect CMAKE_EXE_LINKER_FLAGS in compiler and library tests
Summary: check_cxx_compiler_flag and check_library_exists could fail because they ignored CMAKE_EXE_LINKER_FLAGS and therefore would always fail to produce executables. Cmake policy CMP0056 fixes this, but was explicitly set to OLD in our CMakeLists because it caused problems with test_target_arch. This change sets the policy to NEW to fix the problem with the compiler and library tests, and temporarily clears CMAKE_EXE_LINKER_FLAGS inside test_target_arch to emulate the old behavior there. This allows, for example, LTO builds that require lld to succeed.

Reviewers: davidxl, beanz

Reviewed By: beanz

Subscribers: fjricci, dberris, mgorny, mehdi_amini, tejohnson, rnk, llvm-commits

Differential Revision: https://reviews.llvm.org/D31098

llvm-svn: 298413
2017-03-21 18:25:35 +00:00
Pirama Arumuga Nainar a84404c7a4 Enable PROFILE, TSAN and UBSAN for Android
Summary:
These sanitizers are enabled and used in Android but got built with
Android's build system.  This change enables them in the CMake build
system.

Reviewers: eugenis

Subscribers: llvm-commits, danalbert, srhines, mgorny

Differential Revision: https://reviews.llvm.org/D30127

llvm-svn: 295523
2017-02-18 01:12:55 +00:00
Francis Ricci 908e2d9009 Revert "Upgrade ios min version to 8"
Accidental commit

This reverts commit f21d4a6836ea159e95e5042ba8383f20d4899cda.

llvm-svn: 295414
2017-02-17 04:33:40 +00:00
Francis Ricci 32f0ec51d1 Upgrade ios min version to 8
Summary:
Version 8 is the first version to support the __thread
keyword, which is required for building lsan for
64-bit ios.

Reviewers: kubamracek, kcc, glider

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29787

llvm-svn: 295412
2017-02-17 04:32:17 +00:00