Commit Graph

23 Commits

Author SHA1 Message Date
Evgeniy Stepanov 9e922e7d24 [sanitizer] Android build cleanup.
* Detect Android toolchain target arch and set correct runtime library name.
* Merged a lot of Android and non-Android code paths.
* Android is only supported in standalone build of compiler-rt now.
* Linking lsan-common in ASan-Android (makes lsan annotations work).
* Relying on -fsanitize=address linker flag when building tests (again,
  unification with non-Android path).
* Runtime library moved from lib/asan to lib/linux.

llvm-svn: 218605
2014-09-29 13:18:55 +00:00
Alexey Samsonov b73db72a17 [CMake] Simplify setting compile flag disabling RTTI
llvm-svn: 201547
2014-02-18 07:52:40 +00:00
Timur Iskhodzhanov 00aa75b774 Move /FS to SANITIZER_COMMON_CFLAGS
llvm-svn: 200485
2014-01-30 19:48:13 +00:00
Timur Iskhodzhanov 5b56093acc Quick-fix a typo
llvm-svn: 200483
2014-01-30 19:19:47 +00:00
Timur Iskhodzhanov 45849098eb Add an /FS flag to the lib/interception CMake to make it buildable with VS2013 too
llvm-svn: 200482
2014-01-30 19:19:29 +00:00
Alexander Potapenko 49034e3c33 [ASan] Add CMake configs for libclang_rt.asan_iossim_dynamic.dylib
CMake changes to build the ASan runtime for the iOS simulator. This is a universal library targeting the same architectures as the OSX ASan runtime does, thus the iossim version can't live in the same universal libclang_rt.asan_osx_dynamic.dylib

The difference between the OSX and iossim builds is in the -mios-simulator-version-min and -ios_simulator_version_min flags that tell Clang to compile and link iossim code.

The iossim runtime can only be built on a machine with both Xcode and the iOS Simulator SDK installed. If xcodebuild -version -sdk iphonesimulator Path returns a nonempty path, it is used when compiling and linking the iossim runtime.

llvm-svn: 194199
2013-11-07 10:08:19 +00:00
Evgeniy Stepanov 8268785f44 [sanitizer] Fix wrong size of OFF_T on 32-bit platforms.
This broke pread/pwrite interceptors when building without
-D_FILE_OFFSET_BITS=64, and always on Android.

llvm-svn: 174593
2013-02-07 07:37:12 +00:00
Alexander Potapenko 34157fc33f [ASan] Delete the code related to static runtime on OS X.
Nuke lib/interception/mach_override.

llvm-svn: 174383
2013-02-05 15:57:12 +00:00
Alexey Samsonov 32832e6176 [Sanitizer] include sanitizer_common headers when building interception library
llvm-svn: 173930
2013-01-30 14:27:41 +00:00
Alexey Samsonov 4e50333684 CMake: Add add_compiler_rt_osx_object_library to create universal libraries on Mac
llvm-svn: 172979
2013-01-20 14:36:12 +00:00
Alexey Samsonov b068483d4d CMake: Generalize build rules for different arches for sanitizer_common, asan, ubsan
llvm-svn: 172829
2013-01-18 16:51:07 +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
Alexander Potapenko c7a7522f83 Pass -std=c99 when compiling mach_override.c
llvm-svn: 163717
2012-09-12 15:44:56 +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
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
Evgeniy Stepanov f72f08affc CMake build rules for ASan/Android runtime.
llvm-svn: 162675
2012-08-27 14:28:27 +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 4750230ac6 [Sanitizer] cleanup CMake files for interception and sanitizer_common helper libraries
llvm-svn: 161485
2012-08-08 09:46:51 +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
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
Chandler Carruth c78ad00c07 Another big step toward a viable CMake build system for CompilerRT,
ASan, and friends.

This explicitly switches the CompilerRT CMake build to require CMake
version 2.8.8 or newer which provides first-class support for "object"
libraries which consist of a pile of '.o' files -- exactly what is
desired for composing runtime libraries. I've gone ahead and switched to
using this.

I've also added the interception library which I missed initially. And
I've added proper dependencies between the various libraries. With this,
I'm able to build archives for asan that appear to contain all of the
necessary .o files.

The final tweak here is to start setting up the compile flags and macro
defines expected by ASan and its helper libraries. These may not be
entirely correct currently, they're based loosely on my reading of the
old Makefiles. However, they can be tweaked more easily now that they're
wired up properly.

llvm-svn: 159129
2012-06-25 08:40:10 +00:00