Commit Graph

42 Commits

Author SHA1 Message Date
Alexey Samsonov a168f30073 ASan: simplify build rules for unit tests
llvm-svn: 173133
2013-01-22 07:31:28 +00:00
Alexey Samsonov 2f20275730 ASan: disable flexible mapping and offset on Android. It doesn't work for dynamic ASan runtime there
llvm-svn: 173132
2013-01-22 07:21:24 +00:00
Kostya Serebryany 56fc958506 [asan] split asan_test.cc even more
llvm-svn: 173131
2013-01-22 07:01:47 +00:00
Kostya Serebryany 81e916893d [asan] split asan_test.cc more
llvm-svn: 173130
2013-01-22 06:50:42 +00:00
Kostya Serebryany 4184b64094 [asan] split asan_test.cc to speedup parallel build (most important if building with a debug clang, which takes a couple of minutes on this large file with templates). More splits to follow
llvm-svn: 173129
2013-01-22 06:39:20 +00:00
Alexander Potapenko c21aa5cb39 [ASan] Move Mac-specific tests to asan_mac_test.cc
llvm-svn: 173048
2013-01-21 14:49:55 +00:00
Alexey Samsonov b670018c9f CMake: generalize checking for target availability and add initial support for PowerPC native arch. With this patch, building LLVM on PowerPC native arch produces a working ASan runtime.
llvm-svn: 173044
2013-01-21 14:31:45 +00:00
Alexey Samsonov 362286f34c Fixup for r173021: build tests with zero-based shadow on Android only, fix condition in checking for shadow gap in asan_mapping.h
llvm-svn: 173026
2013-01-21 11:36:38 +00:00
Alexey Samsonov 6ad1d7809d ASan: build unit tests with -fsanitize-address-zero-base-shadow on Linux and Android
llvm-svn: 173021
2013-01-21 10:51:18 +00:00
Alexey Samsonov 163ab9d0a5 CMake: create AddCompilerRT module and implement convenience add_compiler_rt_object_library function
llvm-svn: 172826
2013-01-18 16:05:21 +00:00
Alexey Samsonov 193b45f4fe CMake variables renaming: X86_64->x86_64 I386->i386
llvm-svn: 172812
2013-01-18 12:45:44 +00:00
Alexey Samsonov c20f5d2246 Define COMPILER_RT_CAN_EXECUTE_TESTS variable on platforms where we can produce working binaries and use it in build rules for sanitizers tests
llvm-svn: 171160
2012-12-27 13:19:23 +00:00
Alexey Samsonov e30a84f08f [Sanitizer] CMake build rules for unittests: depend on headers when compiling a file with custom clang.
llvm-svn: 170897
2012-12-21 14:04:52 +00:00
Alexey Samsonov 53a965e125 [Sanitizer] Don't implicitly add object files to the list of dependencies when building compiler_rt unittests. Fix sanitizer_common and asan build rules accordingly. This also fixes check-sanitizer command on Ninja.
llvm-svn: 170870
2012-12-21 08:56:14 +00:00
Alexey Samsonov 74cbc4ccd7 [ASan] don't use -fsanitize=address linker flag for unit tests on Android
llvm-svn: 170670
2012-12-20 06:16:50 +00:00
Alexey Samsonov 826b324cb0 [ASan] explicitly link with dynamic ASan runtime when building unittests on Android
llvm-svn: 170552
2012-12-19 15:52:30 +00:00
Alexey Samsonov 85bd73d259 [ASan] Support building both 32- and 64-bit unit tests if we can target both architectures
llvm-svn: 170549
2012-12-19 15:17:23 +00:00
Alexey Samsonov b29d37bea5 [ASan] make sure Android unittests depend on ASan runtime
llvm-svn: 170543
2012-12-19 13:46:58 +00:00
Alexey Samsonov ca7fcf2354 Significantly change the way we build ASan unittests in CMake
build tree. Now just-built Clang is used to:
  1) compile instrumented sources (as before);
  2) compile non-instrumented sources;
  3) compile our own instrumented version of googletest;
  4) link it all together using -fsanitize=address flag
     (instead of trying to copy linker behavior in
      CMake build rules).

This makes ASan unittests pretty much self-consistent
and independent of other LLVM libraries.

llvm-svn: 170541
2012-12-19 12:33:39 +00:00
Kostya Serebryany 6a786e66cf [asan] simplify break_optimization in tests (Jakub Jelinek)
llvm-svn: 168990
2012-11-30 09:52:44 +00:00
Richard Smith 77930919ad Update compiler-rt tests to match flag renaming/deprecation in Clang.
llvm-svn: 167434
2012-11-06 02:31:42 +00:00
Alexey Samsonov 521309294f [ASan] instrumented asan unit tests should depend on blacklist file
llvm-svn: 166282
2012-10-19 15:18:14 +00:00
Alexey Samsonov 5f1a7589ad [ASan] unit tests: Move main() to a separate file. Fix lint
llvm-svn: 166104
2012-10-17 14:04:57 +00:00
Alexey Samsonov 26d7a06da3 [ASan] fix compiler warnings for unit test on Android
llvm-svn: 163704
2012-09-12 12:07:36 +00:00
Alexey Samsonov 694633e19b [Sanitizer] first effort to start building ASan runtime with -Werror in CMake build
llvm-svn: 163686
2012-09-12 07:38:47 +00:00
Evgeniy Stepanov 1a8f8fa6c0 CMake build rules for ASan Android runtime and tests.
llvm-svn: 163613
2012-09-11 11:55:45 +00:00
Alexey Samsonov d83ccd067d [ASan] hoist more compile flags to SANITIZER_COMMON_CFLAGS var and add the rest of flags/defs from old Makefile to CMake
llvm-svn: 163204
2012-09-05 09:00:03 +00:00
Alexey Samsonov ab2c76711d [ASan] Add CMake support for building ASan benchmarks
llvm-svn: 163201
2012-09-05 08:07:18 +00:00
Chandler Carruth c1c9d5818f Some flag cleanup for the sanitizer runtimes.
This hoists most of the CFLAGS into a common variable. It also adds
detection for -Wno-c99-extensions and uses it to silence a pile of
warnings.

Finally, it switches to the proper flag -rdynamic.

With this, the cmake build is warning free on my bootstrap Linux build.

llvm-svn: 162809
2012-08-29 00:13:11 +00:00
Alexey Samsonov 50e8a6a7df [ASan] CMake build: share more compile flags between instrumented and non-instrumented tests
llvm-svn: 162750
2012-08-28 12:38:17 +00:00
Alexey Samsonov fb844c7eff [ASan] CMake support for building ASan runtime as a universal binary on Mac
llvm-svn: 161665
2012-08-10 14:45:52 +00:00
Alexey Samsonov 59c33c0c9a [ASan] Add support for running unit tests by lit (as a part of 'make check-asan' command)
llvm-svn: 161406
2012-08-07 08:59:15 +00:00
Alexey Samsonov 5062359502 cmake for compiler-rt: add a function to set output dirs for compiler runtimes equal to directory used by Clang driver. Use it for ASan runtime. Also, make sure that ASan unit tests depend on the ASan runtime.
llvm-svn: 160721
2012-07-25 11:15:00 +00:00
Alexey Samsonov 96b9393f2d [ASan] Support for cmake build of ASan unittests in 32-bit LLVM build. Currently, to run ASan unit tests both for 32- and 64 bits one has to maintain two distinct LLVM builds. In a bright future, we'd like to use a single build for this
llvm-svn: 160666
2012-07-24 08:26:19 +00:00
Alexey Samsonov c37ac17629 [ASan] cmake unit tests: explicitly add necessary linker flags when linking unit tests with asan runtime
llvm-svn: 159420
2012-06-29 11:29:39 +00:00
Alexey Samsonov 548b7b5b0e [ASan] cmake-based unit tests: merge instrumented and non-instrumented files into one test binary
llvm-svn: 159419
2012-06-29 10:23:31 +00:00
Alexey Samsonov 3fe0d4d9aa [ASan] silence various warnings in cmake build of asan unit tests
llvm-svn: 159347
2012-06-28 13:12:07 +00:00
Alexey Samsonov b4edab5a6b [ASan] cmake support for running asan unit tests on Mac
llvm-svn: 159345
2012-06-28 12:19:52 +00:00
Alexey Samsonov ecf5436e9c [ASan] update cmake rules so that ASan unit tests can include googletest (and, hence, llvm) headers when they are built by fresh Clang
llvm-svn: 159343
2012-06-28 09:32:19 +00:00
Chandler Carruth 9aaf156f30 Add support for building the ASan instrumentation unit tests with the
just-built Clang binary, and linking them against the just-built ASan
runtime.

This is *very* brittle. I expect it will require tweaking, and I've
pro-actively disabled it on non-Unix builds and on cross-builds.

It is also currently missing dependency edges on GoogleTest header files
and a few other corner cases, but those can be fixed. This is the major
milestone of a mini-bootstrap-like build of the unittest.

llvm-svn: 159255
2012-06-27 09:01:24 +00:00
Kostya Serebryany c639b3943a [asan] update the cmake file for asan
llvm-svn: 159143
2012-06-25 15:38:37 +00:00
Chandler Carruth 9359efa986 Cleanup the handling of CFLAGS even more in the cmake build for ASan.
Add the initial support for building ASan tests.

The first change here is to try to get the CFLAGS to more closely match
those used by the old Makefile. There are probably still goofs here,
ASan folks, your review would be appreciated.

The second big change is to add support for building both
instrumentation based an non-instrumentation based unittests for ASan.
They are built a bit differently from how the old makefiles managed
things. Specifically, there are two binaries, one for the
non-instrumented case, and one for the instrumented case.

Also, the instrumented unit tests rely on the host compiler supporting
AddressSanitizer's intrumentation pass. This is kind-of gross, but
I don't know of a better way yet. I've mailed llvmdev to discuss this
issue.

One big caveat is that the detection logic currently doesn't work. I've
commented it out temporarily as I'd like to get feedback from the ASan
developers, etc.

llvm-svn: 159134
2012-06-25 12:57:43 +00:00