Commit Graph

120 Commits

Author SHA1 Message Date
Greg Fitzgerald c744492f7c Allow the user to override the compiler used for testing
Change-Id: I76d4708a26f17185efb746f4b836aa32f3f8a44f
llvm-svn: 205362
2014-04-01 21:54:56 +00:00
Alexey Samsonov 56b6ee9833 [ASan] Optional support for dynamic ASan runtime on Linux.
Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov!

llvm-svn: 205308
2014-04-01 13:16:30 +00:00
Duncan P. N. Exon Smith ae2f0bbcf1 InstrProf: Add simple compiler-rt test
Add the test infrastructure for testing lib/profile and a single test.
This initial commit only enables the tests on Darwin, but they'll be
enabled on Linux soon after.

<rdar://problem/16458307>

llvm-svn: 205256
2014-03-31 22:45:37 +00:00
Evgeniy Stepanov ff127bff89 [sanitizer] Test that we can compile C++ code on the target platform.
llvm-svn: 205184
2014-03-31 13:50:13 +00:00
Greg Fitzgerald ffa4b7993f Revert r204877 "Allow the user to override the compiler used for testing"
Unbreak the sanitizer-x86_64-linux bot.

Change-Id: Ie03f1b93fae45c54b142003731ff4f5d4f6b62f8
llvm-svn: 204886
2014-03-27 01:11:12 +00:00
Greg Fitzgerald 6ff4f89af3 Allow the user to override the compiler used for testing
Change-Id: Ida62c2d85f541260f505c3dbd5d71a4b2a6004f4
llvm-svn: 204877
2014-03-26 23:51:44 +00:00
Alexey Samsonov bcce1979e3 [CMake] Build compiler-rt libraries with -std=c++11
llvm-svn: 204145
2014-03-18 12:49:22 +00:00
Evgeniy Stepanov 0b5b3295e5 Move Android ucontext.h out of third_party.
Google is re-licensing this code under the standard dual license of
compiler-rt.

llvm-svn: 204128
2014-03-18 08:32:14 +00:00
Alexey Samsonov 7a3d806c31 [CMake] Add trailing newline to test source file to make sure -Wnewline-eof doesn't fire
llvm-svn: 203911
2014-03-14 09:22:29 +00:00
Alexey Samsonov cbc68521b3 [CMake] More fixes for Windows build
llvm-svn: 203798
2014-03-13 13:37:07 +00:00
Alexey Samsonov f97f07b1b8 [CMake] Attempt to fix standalone compiler-rt build on Windows
llvm-svn: 203789
2014-03-13 11:55:27 +00:00
Alexey Samsonov fe7e28c41f [CMake] Use /W3 instead of -Wall on Windows. Remove add_definitions abuse.
llvm-svn: 203786
2014-03-13 11:31:10 +00:00
Alexey Samsonov 32956d651a [CMake] Make append_if semantics similar to those used in LLVM
llvm-svn: 203773
2014-03-13 09:31:36 +00:00
Alexey Samsonov 4a7e96e642 [CMake] Build compiler-rt libraries with -Wall
llvm-svn: 203113
2014-03-06 12:25:02 +00:00
Alexey Samsonov 1464b5966d [CMake] Minor fix to llvm-config discovery
llvm-svn: 202954
2014-03-05 09:21:49 +00:00
Alexey Samsonov 6c282b4149 [CMake] Fix PR18987: discard /MD flag if we're adding /MT
llvm-svn: 202472
2014-02-28 08:04:30 +00:00
Evgeniy Stepanov 322e89c4e2 [asan] Install asan_device_setup to bin/ when targetting Android.
asan_device_setup is a utility that prepares a device to run code built with
ASan. Essentially, it installs ASan runtime library into the system. For this
reason, it has to be at a predictable relative path from the runtime library
itself. We also plan to distribute this utility, packaged with runtime library
and maybe llvm-symbolizer, to the users.

llvm-svn: 202362
2014-02-27 08:41:40 +00:00
Alexey Samsonov 8c4c09786a Add accidentally removed -D
llvm-svn: 202355
2014-02-27 07:03:32 +00:00
Alexey Samsonov e3e2a11ad9 Move COMPILER_RT_HAS_FUNC check from r202303 to config-ix.cmake
llvm-svn: 202353
2014-02-27 06:52:41 +00:00
Reid Kleckner 0140ce483f Append -D__func__=__FUNCTION__ to SANITIZER_COMMON_CFLAGS
This way it gets picked up for all sanitizer libs, both sanitizer_common
and asan.  I believe those are the only libs that build with asan.
There should be no need to set the __func__ definition inside
clang_compile.

llvm-svn: 202303
2014-02-26 21:54:39 +00:00
NAKAMURA Takumi 9cd9ad6b9d [CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE).
For now, use both keywords, INTERFACE and PRIVATE via the variable,
  - ${cmake_2_8_12_INTERFACE}
  - ${cmake_2_8_12_PRIVATE}

They could be cleaned up when we introduce 2.8.12.

llvm-svn: 202239
2014-02-26 06:45:11 +00:00
Alexey Samsonov a2fee5d907 [CMake] Better support for COMPILER_RT_ENABLE_WERROR. Make sure compiler-rt libraries are build by 'make all' command
llvm-svn: 202023
2014-02-24 11:32:49 +00:00
Alexey Samsonov 2f27f0b0ee [CMake] Introduce COMPILER_RT_ENABLE_WERROR option
llvm-svn: 202021
2014-02-24 11:22:39 +00:00
Alexey Samsonov 31043152d3 Add rudimentary support for running compiler-rt lit tests with GCC
llvm-svn: 201680
2014-02-19 15:13:14 +00:00
Alexey Samsonov 8067448dfe [CMake] Use host compiler to run lit tests in standalone mode
llvm-svn: 201674
2014-02-19 13:45:49 +00:00
Alexey Samsonov 150d62aa2a [CMake] Use host compiler to build unittests in standalone mode
llvm-svn: 201672
2014-02-19 13:01:03 +00:00
Alexey Samsonov cd8535a96d [CMake] Introduce COMPILER_RT_INCLUDE_TESTS option
llvm-svn: 201666
2014-02-19 11:18:47 +00:00
Alexey Samsonov aa980c760b [CMake] Add the way to run tests in standalone build.
1) Depend on llvm-config (configured in LLVM_CONFIG_PATH) to
get necessary LLVM source/binary directories.
2) Add basic support for running lit tests (check-xsan commands).
For now this "support" is far from what we want:
  * unit tests are not built currently.
  * lit tests use Clang/compiler-rt from LLVM build directory,
    not the host compiler or just-built compiler-rt libraries.

We should make a choice on the way we intend ti run compiler-rt lit testsuite:
a) use either Clang from LLVM build tree, or the host compiler.
b) use either just-built runtimes, or the runtimes shipped with the
host compiler.

Using just-built runtimes is tricky - we have to know where to put them, so that
Clang/GCC driver would pick them up (and not overwrite the existing runtimes).
Using a host compiler instead of Clang from LLVM build tree will give us a chance to
run lit tests under GCC (which already has support for several sanitizers).

That is, I tend to make the following choice: if we're in a standalone compiler-rt
build, use host compiler with its set of runtime libraries to run lit tests.
This will effectively decouple "make compiler-rt" and "make check-compiler-rt" in
a standalone build - the latter wouldn't invoke the former. Note that if we decide
to fix LLVM/Clang/compiler-rt build system so that it would configure/build
compiler-rt with just-built Clang (as we do in Makefile-based build), this will not
be a problem - we can add a dependency to ensure that clang/compiler-rt are rebuilt
before running compiler-rt tests.

llvm-svn: 201656
2014-02-19 10:04:29 +00:00
Alexey Samsonov de4ef2a066 [CMake] Rudimentary support for standalone CompilerRT build system.
This change allows to build compiler-rt libraries separately from
LLVM/Clang (path to LLVM build directory should be specified at
configure time). Running tests is not yet supported.

llvm-svn: 201647
2014-02-19 07:49:16 +00:00
Alexey Samsonov 1181a104e6 [CMake] Rename several variables
llvm-svn: 201575
2014-02-18 14:28:53 +00:00
Alexey Samsonov 1dbe6e071f [CMake] Don't build ASan for iossim if -mmacosx-version-min is specified
llvm-svn: 201566
2014-02-18 12:01:24 +00:00
Alexey Samsonov b73db72a17 [CMake] Simplify setting compile flag disabling RTTI
llvm-svn: 201547
2014-02-18 07:52:40 +00:00
Alexey Samsonov 9a1ffce25a [CMake] Simplify code for detecting/setting compiler flags
llvm-svn: 201543
2014-02-18 07:26:58 +00:00
Alexey Samsonov e6a6183e9b Move TSan lit-tests under test/tsan
llvm-svn: 201414
2014-02-14 14:35:48 +00:00
Alexey Samsonov 9f20d67034 Move ASan lit-tests under test/asan
llvm-svn: 201413
2014-02-14 14:06:10 +00:00
Alexey Samsonov 8434e60f7e Move MSan lit-tests under test/msan
llvm-svn: 201412
2014-02-14 13:02:58 +00:00
Alexey Samsonov 7eeef85bd4 Move LSan test suite under test/
llvm-svn: 201408
2014-02-14 12:26:05 +00:00
Alexey Samsonov f6cf6ab53b Move DFSan test suite under test/
llvm-svn: 201403
2014-02-14 12:05:41 +00:00
Alexey Samsonov ba869e79a0 Move UBSan test suite under test/
llvm-svn: 201401
2014-02-14 11:42:22 +00:00
Alexey Samsonov 81a2b466e9 Move shared configs for lit test suites to test/ and unittests/ directories
llvm-svn: 201399
2014-02-14 11:00:07 +00:00
Evgeniy Stepanov aa9d74cc5d [asan] Android test runner for ASan lit tests.
This change replaces 32- and 64- bit config.in-s with a single config template
that is used to generate both 32 and 64 bits configs as well as the new
arm-android config. Arm-android config is special because it can run tests on
a remote device over adb (android debug bridge). 

We replace %clang with a script that run the compiler, upload the result to
the device, and replaces it with another script. The second script runs the
binary on the device and delivers stdout/stderr/exitcode back.

llvm-svn: 201394
2014-02-14 09:22:10 +00:00
Alexey Samsonov 167c15a98f [Sanitizer] Build sanitizer_common with -Wframe-larger-than=512 flag
llvm-svn: 201213
2014-02-12 07:26:40 +00:00
Hans Wennborg a97442f5fb Require CMake 2.8.12.1 or later on Windows
That version knows to use the /FS flag, which is needed for building
lib/interception with VS2013.

llvm-svn: 201184
2014-02-11 21:46:19 +00:00
Evgeniy Stepanov 6db97e82a4 Add a copy of missing <ucontext.h> for Android and enable ASan SEGV handler.
This change adds a copy of <ucontext.h> for Android found in google-breakpad
that is missing from the official NDK.
ASan SEGV handler is still disabled by default and can be enabled with
ASAN_OPTIONS=handle_segv.

llvm-svn: 201084
2014-02-10 13:34:43 +00:00
Alexey Samsonov fafbcb6d4c [CMake] Fixup for r200753
llvm-svn: 200761
2014-02-04 13:24:13 +00:00
Justin Bogner ad560c4c11 CMake: Enable -Werror for the -fno-function-sections check
If the -fno-function-sections flag isn't recognized, the compiler
emits a warning. This isn't enough to cause the check to fail, so we
enable -Werror as well.

llvm-svn: 200753
2014-02-04 10:40:46 +00:00
Alexey Samsonov d23c79604e [CMake] Check that compiler supports -fno-function-sections flag
llvm-svn: 200746
2014-02-04 08:28:17 +00:00
Evgeniy Stepanov bd2b3177da [sanitizer] Resubmit r200683: disable -ffunction-sections.
llvm-svn: 200686
2014-02-03 11:16:41 +00:00
Evgeniy Stepanov fe437f0a8f Revert r200683.
-fno-function-sections is broken in Clang.

llvm-svn: 200684
2014-02-03 10:52:53 +00:00
Evgeniy Stepanov aa0d7dee77 [sanitizer] Disable -ffunction-sections.
It breaks when a binary is linked with --gc-sections: parts of sanitizer
interface get thrown away and inaccessible from dlopen-ed libs.

llvm-svn: 200683
2014-02-03 10:15:08 +00:00