Commit Graph

138 Commits

Author SHA1 Message Date
Hans Wennborg a03feadeb2 Fix the CMake build when setting MACOSX_DEPLOYMENT_TARGET
If we don't reset CMAKE_OSX_DEPLOYMENT_TARGET, it will end up in
CFLAGS together with the -mmacosx-version-min that we set,
and the compiler errors about the conflict.

llvm-svn: 215468
2014-08-12 20:03:33 +00:00
Timur Iskhodzhanov de1718d355 [ASan/Win] Fix PR18987: warning about overriding '/MD' with '/MT'
llvm-svn: 215435
2014-08-12 09:44:56 +00:00
Alexey Samsonov 68b9e74592 [CMake] Determine which compiler-rt libraries are supported on
a given platform in a top-level CMakeLists.txt to use it both
in lib/ and in test/ subdirectories. Move architecture/platform
checks to config-ix.

llvm-svn: 215247
2014-08-08 22:01:20 +00:00
Alexey Samsonov 4462ec6c02 Exclude ASM from CompilerRT languages as an attempt to fix CMake failure in standalone mode
llvm-svn: 214130
2014-07-28 22:04:19 +00:00
Saleem Abdulrasool 7618240aa9 builtins: re-enable building assembly sources
Re-apply SVN r213684 which was reverted in SVN r213724 since it broke the
build bots.  Add a tweak to enable inclusion of the assembly sources in
standalone build as well.

Original commit message:

This patch address the PR20360. The CMake assembler build system
ignores the .S assembly files in builtins library build. This patch
fixes the issue.

llvm-svn: 214013
2014-07-26 04:04:02 +00:00
Daniel Sanders 4dc8a78b04 [asan] adding support of 32-bit address sanitizer for MIPS
Summary: The patch supports both the clang cross-compiler and native compiler

Patch by Kumar Sukhani <Kumar.Sukhani@imgtec.com>

Test Plan:
Kumar had the following asan test results when compiled on a MIPS board:

  Expected Passes    : 96
  Expected Failures  : 2
  Unsupported Tests  : 84
  Unexpected Passes  : 4
  Unexpected Failures: 19

The list of unexpected failures can be found in the review.

Reviewers: kcc, petarj, dsanders

Reviewed By: kcc

Subscribers: farazs, kcc, llvm-commits

Differential Revision: http://reviews.llvm.org/D4208

llvm-svn: 211587
2014-06-24 12:08:18 +00:00
Greg Fitzgerald 796fba4cd9 Fix Android build after r210053
llvm-svn: 210069
2014-06-03 04:29:46 +00:00
Greg Fitzgerald 0f7f731966 Cleanup Android build and provide better diagnostics
No longer need to set ANDROID if COMPILER_RT_TEST_TARGET_TRIPLE is
arm-linux-androideabi.

No need to set ANDROID_COMMON_FLAGS.  These flags are already in
CMAKE_CXX_FLAGS which are used in try_compile().

llvm-svn: 210053
2014-06-02 23:11:24 +00:00
Greg Fitzgerald 11b49c3818 light up sanitizers for ARM, take 2
Differential Revision: http://reviews.llvm.org/D3794

llvm-svn: 209856
2014-05-29 22:38:13 +00:00
Greg Fitzgerald c1146ec5ba Revert "light up sanitizers for ARM"
This commit broke the Windows build, where CMAKE_C_COMPILER can
compile and link with -march=armv7-a but the just-built-clang
cannot.

llvm-svn: 209851
2014-05-29 21:33:36 +00:00
Greg Fitzgerald 32685ec5fd light up sanitizers for ARM
You can expect the sanitizers to be built under any of the following conditions:

1) CMAKE_C_COMPILER is GCC built to cross-compile to ARM
2) CMAKE_C_COMPILER is Clang built to cross-compile to ARM (ARM is default target)
3) CMAKE_C_COMPILER is Clang and CMAKE_C_FLAGS contains -target and --sysroot

Differential Revision: http://reviews.llvm.org/D3794

llvm-svn: 209835
2014-05-29 19:01:32 +00:00
Timur Iskhodzhanov 82ee0433da [ASan/Win] Use clang rather than clang-cl by default for lit tests. Make Windows-only tests explicitly use clang-cl.
Reviewed at http://reviews.llvm.org/D3893

llvm-svn: 209719
2014-05-28 08:38:13 +00:00
Greg Fitzgerald 1733b5e263 XFAIL ptrace test on arm
The patch adds better target_triple and target_arch defaults for lit tests,
which allows us to XFAIL tests based on architecture.

Was:
  target_triple = LLVM_DEFAULT_TARGET_TRIPLE
  target_arch = HOST_ARCH

Now:
  target_triple = COMPILER_RT_TEST_TARGET_TRIPLE
                , otherwise LLVM_DEFAULT_TARGET_TRIPLE
  target_arch = first item in COMPILER_RT_TEST_TARGET_TRIPLE

Differential Revision: http://reviews.llvm.org/D3855

llvm-svn: 209256
2014-05-20 23:31:26 +00:00
Timur Iskhodzhanov 2bdca20069 [ASan tests] Add the first Windows-only lit test
Reviewed at http://reviews.llvm.org/D3767

llvm-svn: 208802
2014-05-14 19:10:43 +00:00
Greg Fitzgerald 07c88a16e8 Enable CAN_EXECUTE_TESTS if an EMULATOR is provided
llvm-svn: 208745
2014-05-14 00:36:15 +00:00
Timur Iskhodzhanov b9bd76b85d Enable sanitizer tests (check-sanitizer, check-asan) on Windows
llvm-svn: 208701
2014-05-13 14:25:49 +00:00
Alexey Samsonov 53363b53db [CMake] Fix standalone build after r208526
llvm-svn: 208629
2014-05-12 20:48:29 +00:00
Timur Iskhodzhanov b0279d7f7d [ASan tests] Use clang-cl to build tests on Windows
Reviewed at http://reviews.llvm.org/D3680

llvm-svn: 208526
2014-05-12 08:55:20 +00:00
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