summaryrefslogtreecommitdiff
path: root/lib/asan/CMakeLists.txt
AgeCommit message (Collapse)Author
2016-03-05[cmake] Address Samsonov's post-commit review of r262723Filipe Cabecinhas
Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17896 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23[CMake] Assign components and dependencies during add_compiler_rt_resource_fileChris Bieneman
This makes it so that component-based installations will include resource files (i.e. blacklists). My next patch will add support for component-based installations. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261699 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27[CMake] Unify build rules for sanitizer_common for Apple and non-Apple ↵Alexey Samsonov
platforms. Additionally, link safestack runtime on OS X with nolibc version of sanitizer_common runtime, as we do on Linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246227 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27[CMake] Add ARCHS option to add_sanitizer_rt_symbols.Chris Bieneman
Summary: This is another step in a multi-step refactoring to move add_sanitizer_rt_symbols in the direction of other add_* functions in compiler-rt. Changes to CMakeLists files are all minimal except ubsan which tests the new ARCHS loop. Further cleanup patches will follow. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12410 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246199 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26[CMake] Converting add_sanitizer_rt_symbols to use cmake_parse_arguments.Chris Bieneman
Summary: This is the first step in a multi-step refactoring to move add_sanitizer_rt_symbols in the direction of other add_* functions in compiler-rt. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12386 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246102 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26[CMake] Add OBJECT_LIBS option to add_compiler_rt_runtime, and refactored ↵Chris Bieneman
asan call site to use it. Summary: This is one more step to allow us to eliminate platform-specific code from the library CMakeLists files. Subsequent patches will refactor all call sites to use this and other new features. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12339 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246047 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-25[CMake] fixing a typo that is breaking bots.Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245971 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-25[CMake] merge add_compiler_rt_runtime and add_compiler_rt_darwin_runtime ↵Chris Bieneman
into a single function Summary: This refactoring moves much of the Apple-specific behavior into a function in AddCompilerRT. The next cleanup patch will remove more of the if(APPLE) checks in the outlying CMakeLists. This patch adds a bunch of new functionality to add_compiler_rt_runtime so that the target names don't need to be reconstructed outside the call. It also updates some of the call sites to exercise the new functionality, but does not update all uses fully. Subsequent patches will further update call sites and move to using the new features. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: beanz, rengolin, llvm-commits Differential Revision: http://reviews.llvm.org/D12292 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245970 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-18[CMake] Refactoring add_compiler_rt functions for darwin runtimes.Chris Bieneman
Summary: This patch consolidates add_compiler_rt_osx_static_runtime and add_compiler_rt_darwin_dynamic_runtime into a single new function add_compiler_rt_darwin_runtime. Reviewers: filcab, samsonov, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12106 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245317 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24[asan] Only link liblog on Android when it exists.Evgeniy Stepanov
With r242975, liblog is only used on certain older platforms. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243139 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas
Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240120 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-10[CMake] Cleanup add_compiler_rt_object_library to be platform-agnosticChris Bieneman
Summary: This change takes darwin-specific goop that was scattered around CMakeLists files and spread between add_compiler_rt_object_library and add_compiler_rt_darwin_object_library and moves it all under add_compiler_rt_object_library. The goal of this is to try to push platform handling as low in the utility functions as possible. Reviewers: rnk, samsonov Reviewed By: rnk, samsonov Subscribers: rnk, rsmith, llvm-commits Differential Revision: http://reviews.llvm.org/D10250 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239498 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov
This is done by creating a named shared memory region, unlinking it and setting up a private (i.e. copy-on-write) mapping of that instead of a regular anonymous mapping. I've experimented with regular (sparse) files, but they can not be scaled to the size of MSan shadow mapping, at least on Linux/X86_64 and ext3 fs. Controlled by a common flag, decorate_proc_maps, disabled by default. This patch has a few shortcomings: * not all mappings are annotated, especially in TSan. * our handling of memset() of shadow via mmap() puts small anonymous mappings inside larger named mappings, which looks ugly and can, in theory, hit the mapping number limit. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@238621 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27[asan] Fix build dependency issues with ASan version list file.Evgeniy Stepanov
CMake pre-3.1 has a bug where a shared library depending on a custom_target does not really depend on it. This commit implements a hilariously ugly workaround for this problem, see code comments for more details. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@238367 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-05[asan] Fix compiler-rt build.Evgeniy Stepanov
i386 runtime library was accidentally using the x86_64 version script without a dependency. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@236556 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-05[asan] Use a version script to limit the symbols exported by the ASan shared ↵Evgeniy Stepanov
runtime library. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@236551 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-05Build ASan runtime library with -z global on Android.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@236537 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-01[UBSan] Embed UBSan into ASan runtime (compiler-rt part).Alexey Samsonov
Summary: Change the way we use ASan and UBSan together. Instead of keeping two separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on a platform, all UBSan sources are just compiled into dummy empty object files. UBSan initialization code (e.g. flag parsing) is directly called from ASan initialization, so we are able to enforce correct initialization order. This mirrors the approach we already use for ASan+LSan. This change doesn't modify the way we use standalone UBSan. Test Plan: regression test suite Reviewers: kubabrecka, zaks.anna, rsmith, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8646 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233861 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-25[LSan] Don't explicitly exclude LSan from Windows build - it should just ↵Alexey Samsonov
produce dummy object files. NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233231 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26[CMake] Make sure we built one variant of i386/i686 runtime libraries.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@230683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-23[compiler-rt] Ensure AsanInitFromRtl is called from a static initializer on ↵Kuba Brecka
OS X by using ASAN_DYNAMIC=1 The idea is to ensure that the ASan runtime gets initialized early (i.e. before other initializers/constructors) even when DYLD_INSERT_LIBRARIES is not used. In that case, the interceptors are not installed (on OS X, DYLD_INSERT_LIBRARIES is required for interceptors to work), and therefore ASan gets currently initialized quite late -- from the main executable's module initializer. The following issues are a consequence of this: https://code.google.com/p/address-sanitizer/issues/detail?id=363 https://code.google.com/p/address-sanitizer/issues/detail?id=357 Both of them are fixed with this patch. Reviewed at http://reviews.llvm.org/D7117 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226929 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-17[ASan] Always build shared ASan runtime on Linux.Alexey Samsonov
This commit changes the strategy for building shared ASan runtime and the way we test it: - COMPILER_RT_BUILD_SHARED_ASAN CMake option is removed. We now always build shared ASan runtime (it is the default on Android, Windows and Mac, and not the default on Linux and FreeBSD). - Platforms, which use static runtime by default now have "check-asan-dynamic" testsuite. This testsuite contains instrumented unit tests, and ASan lit tests, and runs them with shared ASan runtime. This testsuite is *not* a part of "check-asan" and *not* a part of "check-all", as adding 1000 more test cases, which duplicate existing ones is costly. However, you're welcome to add this command to your buildbot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224470 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-17[ASan] Move flag parsing logic to asan_flags.cc. NFC.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224450 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-17Rename asan_allocator2.cc to asan_allocator.ccAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224396 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05Implement AddressSanitizer suppressions.Kuba Brecka
Adds 3 new suppression types, "interceptor_name", "interceptor_via_fun", "interceptor_via_lib". Reviewed at http://reviews.llvm.org/D6280. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223508 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03ASan CMakeLists.txt: fix bad indent; NFCHans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223258 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-28[asan] Remove the local copy of Android ucontext.h.Evgeniy Stepanov
This header is present in the r10c release of the NDK. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222915 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04Use @rpath as LC_ID_DYLIB for ASan dylib on OS XKuba Brecka
Change the LC_ID_DYLIB of ASan's dynamic libraries on OS X to be set to "@rpath/libclang_rt.asan_osx_dynamic.dylib" and similarly for iossim. Clang driver then sets the "-rpath" to be the real path to where clang currently has the dylib (because clang uses the relative path to its current executable). This means if you move the compiler or install the binary release, -fsanitize=address will link to the proper library. Reviewed at http://reviews.llvm.org/D6018 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221278 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, ↵Kuba Brecka
let's rename it to append_list_if Doing s/append_if/append_list_if/, no functional change. http://reviews.llvm.org/D5739 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219860 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01[sanitizer] Add i686 arch to compiler-rt.Evgeniy Stepanov
This is needed so we can produce -i686- named libraries for x86 Android (which is i686-linux-android). An alternative solution would be keeping the "i386" name internally and tweaking the OUTPUT_NAME of compiler-rt libraries. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218761 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-29[sanitizer] Android build cleanup.Evgeniy Stepanov
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-12[ASan/Win] Rename asan_win_uar_thunk.lib to asan_win_dynamic_runtime_thunk.libTimur Iskhodzhanov
It turned out that we have to bridge more stuff between the executable and the ASan RTL DLL than just __asan_option_detect_stack_use_after_return. See PR20918 for more details. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217673 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-28[ASan/Win] Add the -Zl flag to avoid /DEFAULTLIB:libcmt directive in the ↵Timur Iskhodzhanov
asan_win_uar_thunk object file This directive results in 'symbol already defined' when linking DLLs that use -MD git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216663 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27[asan] Restore asan-rt name on linux back to pre-r216380.Evgeniy Stepanov
There is no reason to have different library names for shared and static cases on linux. It also breaks Android where we install the shared asan-rt library into the system and should keep the old name. This change reverts most of r216380 limiting it to win32 targets only. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216533 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26[ASan/Win] Rename asan_dll_thunk.cc to asan_win_dll_thunk.ccTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216448 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26[ASan/Win] Add an extra thunk.lib to handle stack-use-after-return optionTimur Iskhodzhanov
With this patch, "check-asan" passes all the tests with both MT and MD ASan RTL if you set COMPILER_RT_BUILD_SHARED_ASAN to ON (PR20214) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216447 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25[ASan/Win] Add /DEBUG to the MD RTL link flagsTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216387 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25[ASan] Replace CMake if/APPEND/endif with append_ifTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216386 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25[ASan/Win] Intercept memory allocation functions in the MD CRTTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216382 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25[ASan] Rename the ASan dynamic RTTimur Iskhodzhanov
Reviewed at http://reviews.llvm.org/D5026 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216380 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-22[ASan] Use check_library_exists to determine if libc/libstdc++ are availableTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216264 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15[ASan] Add ASan debugging API to get malloc/free stack traces and shadow ↵Kuba Brecka
memory mapping info Reviewed at http://reviews.llvm.org/D4466 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213080 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15[ASan] Only define macros in asan_init_version.h, move the __asan_init ↵Timur Iskhodzhanov
declaration back to asan_interface_internal.h This fixes the issues we've uncovered after landing r212815. Reviewed at http://reviews.llvm.org/D4500 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213053 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-11[ASan/Win] Don't apply dllexport to __asan_init in the DLL thunkTimur Iskhodzhanov
This fixes '___asan_init_v4 already defined' errors when linking some of Chromium DLLs. Looks like one of the DLL is using a .lib produced while linking another DLL and it exploded after r212699. I'm trying to come up with a small testcase... git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212815 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-07[ASan] Clean up leftovers from assembly instrumentation helpersAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212471 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-07[asan] Remove runtime assembly helpers.Evgeniy Stepanov
Remove helper functions that were used in assembly instrumentation. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212456 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04[asan] Add install rule for Android runtimeGreg Fitzgerald
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210216 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-20[ASan Win] Simplify and improve the way we forward ASan interface calls from ↵Timur Iskhodzhanov
DLLs Reviewed at http://reviews.llvm.org/D3848 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-12[ASan] Split static ASan runtime in two parts: asan and asan_cxx.Alexey Samsonov
asan_cxx containts replacements for new/delete operators, and should only be linked in C++ mode. We plan to start building this part with exception support to make new more standard-compliant. See https://code.google.com/p/address-sanitizer/issues/detail?id=295 for more details. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208609 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01[ASan] Optional support for dynamic ASan runtime on Linux.Alexey Samsonov
Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205308 91177308-0d34-0410-b5e6-96231b3b80d8