summaryrefslogtreecommitdiff
path: root/lib/ubsan/CMakeLists.txt
AgeCommit message (Collapse)Author
2017-11-09ubsan: Allow programs to use setenv to configure ubsan_standalone.Peter Collingbourne
Previously ubsan_standalone used the GetEnv function to read the environment variables UBSAN_OPTIONS and UBSAN_SYMBOLIZER_PATH. The problem with GetEnv is that it does not respect changes to the environment variables made using the libc setenv function, which prevents clients from setting environment variables to configure ubsan before loading ubsan-instrumented libraries. The reason why we have GetEnv is that some runtimes need to read environment variables while they initialize using .preinit_array, and getenv does not work while .preinit_array functions are being called. However, it is unnecessary for ubsan_standalone to initialize that early. So this change switches ubsan_standalone to using getenv and removes the .preinit_array entry. The static version of the runtime still ends up being initialized using a C++ constructor that exists to support the shared runtime. Differential Revision: https://reviews.llvm.org/D39827 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-07[ubsan] Add a static runtime on DarwinVedant Kumar
As a follow-up to r315142, this makes it possible to use ubsan with a static runtime on Darwin. I've also added a new StandaloneStatic testing configuration so the new setup can be tested. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04[sanitizer] Move cxx-abi library earlier in link flags.Evgeniy Stepanov
Summary: This change moves cxx-abi library in asan/ubsan/dd link command line ahead of other libraries, such as pthread/rt/dl/c/gcc. Given that cxx-abi may be the full libstdc++/libc++, it makes sense for it to be ahead of libc and libgcc, at least. The real motivation is Android, where in the arm32 NDK toolchain libstdc++.a is actually a linker script that tries to sneak LLVM's libunwind ahead of libgcc's. Wrong library order breaks unwinding. Reviewers: srhines, danalbert Subscribers: aemerson, kubamracek, mgorny, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D38520 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-28[ubsan] Merge ubsan_standalone_cxx shared library.Evgeniy Stepanov
Summary: Link everything, including the C++ bits, in the single ubsan_standalone SHARED library. This matches ASan setup. Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38340 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314369 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-23[ubsan] Support signal specific options in ubsanVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Standalone ubsan needs signal and sigaction handlers and interceptors. Plugin mode should rely on parent tool. Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D37895 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314052 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21[ubsan] Split ubsan_init_standaloneVitaly Buka
Summary: On Linux we may need preinit_array in static lib and ubsan_standalone_initializer in shared lib. Reviewers: eugenis Subscribers: kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38013 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18Revert "[ubsan] Split ubsan_init_standalone"Vitaly Buka
Breaks build. This reverts commit r313583 and r313584. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313585 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[ubsan] Split ubsan_init_standaloneVitaly Buka
On Linux we may need preinit_array in static lib and ubsan_standalone_initializer in shared lib. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313583 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18Revert "[ubsan] Add RTUbsan_standalone into UBSAN standalone shared"Vitaly Buka
Error: .preinit_array section is not allowed in DSO This reverts commit r313519. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313520 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[ubsan] Add RTUbsan_standalone into UBSAN standalone sharedVitaly Buka
Same as for Apple. This also fixes flags related tests on Android as without this flags are not initialized. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313519 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15ubsan: Stop building the DLL version of the runtime library on Windows.Peter Collingbourne
As far as I know we never use it. Differential Revision: https://reviews.llvm.org/D37884 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-28Reland r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311924 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27Revert r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
The required change in clang is being reverted because of the Android build bot failure. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27[cmake] Remove i686 target that is duplicate to i386Michal Gorny
Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Support libc++abi in addition to libstdc++Petr Hosek
This change adds sanitizer support for LLVM's libunwind and libc++abi as an alternative to libstdc++. This allows using the in tree version of libunwind and libc++abi which is useful when building a toolchain for different target. Differential Revision: https://reviews.llvm.org/D34501 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309362 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Support compiler-rt builtinsPetr Hosek
This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26Add liblog to ubsan `UBSAN_DYNAMIC_LIBS`Leo Li
Summary: liblog is still required to create ubsan runtimes on Android when __ANDROID_API__ < 21. Reviewers: eugenis, vsk Subscribers: kubamracek, mgorny, pirama, srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D35915 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309180 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26Revert "[sanitizer] Support compiler-rt builtins"Petr Hosek
This reverts commit fd63314d6770e0da62572a3fea2c41c4cc0fc58a. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26Revert "[sanitizer] Support libc++abi in addition to libstdc++"Petr Hosek
This reverts commit d1997bff31cf6b484eb59c2ee1fc3155442e338c. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309082 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26[sanitizer] Support libc++abi in addition to libstdc++Petr Hosek
This change adds sanitizer support for LLVM's libunwind and libc++abi as an alternative to libstdc++. This allows using the in tree version of libunwind and libc++abi which is useful when building a toolchain for different target. Differential Revision: https://reviews.llvm.org/D34501 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309074 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25[sanitizer] Support compiler-rt builtinsPetr Hosek
This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309060 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17[Ubsan]Remove unused link libraries.Leo Li
Summary: Remove unused link libraries metioned in D33216. Reviewers: llvm-commits, vsk Reviewed By: vsk Subscribers: vsk, kubamracek, mgorny, filcab Differential Revision: https://reviews.llvm.org/D33292 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303286 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17Generate ubsan shared libraries.Leo Li
Summary: Those libraries are required by aosp (https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+/master/Android.mk). Currenly the shared libraries are generated by aosp Makefile system. We are looking forward to using cmake to generate them. Reviewers: llvm-commits, vsk Reviewed By: vsk Subscribers: filcab, vsk, srhines, kubamracek, mgorny, krytarowski Differential Revision: https://reviews.llvm.org/D33216 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303276 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05[ubsan] Implement __sanitizer_print_stack_trace for standalone UBSan runtime.Alexander Potapenko
Patch by Max Moroz, reviewed at https://reviews.llvm.org/D32542 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302218 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02[sanitizer] Use interception to access to strong definitions in the executable.Marcos Pividori
In Windows, when sanitizers are implemented as a shared library (DLL), users can redefine and export a new definition for weak functions, in the main executable, for example: extern "C" __declspec(dllexport) void __sanitizer_cov_trace_pc_guard(u32* guard) { // Different implementation provided by the client. } However, other dlls, will continue using the default implementation imported from the sanitizer dll. This is different in linux, where all the shared libraries will consider the strong definition. With the implementation in this diff, when the dll is initialized, it will check if the main executable exports the definition for some weak function (for example __sanitizer_cov_trace_pc_guard). If it finds that function, then it will override the function in the dll with that pointer. So, all the dlls with instrumentation that import __sanitizer_cov_trace_pc_guard__dll() from asan dll, will be using the function provided by the main executable. In other words, when the main executable exports a strong definition for a weak function, we ensure all the dlls use that implementation instead of the default weak implementation. The behavior is similar to linux. Now, every user that want to override a weak function, only has to define and export it. The same for Linux and Windows, and it will work fine. So, there is no difference on the user's side. All the sanitizers will include a file sanitizer_win_weak_interception.cc that register sanitizer's weak functions to be intercepted in the binary section WEAK When the sanitizer dll is initialized, it will execute weak_intercept_init() which will consider all the CB registered in the section WEAK. So, for all the weak functions registered, we will check if a strong definition is provided in the main executable. All the files sanitizer_win_weak_interception.cc are independent, so we do not need to include a specific list of sanitizers. Now, we include [asan|ubsan|sanitizer_coverage]_win_weak_interception.cc and sanitizer_win_weak_interception.cc in asan dll, so when it is initialized, it will consider all the weak functions from asan, ubsan and sanitizer coverage. After this diff, sanitizer coverage is fixed for MD on Windows. In particular libFuzzer can provide custom implementation for all sanitizer coverage's weak functions, and they will be considered by asan dll. Differential Revision: https://reviews.llvm.org/D29168 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293958 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02[sanitizer] Add dynamic_runtime_thunk for different sanitizers.Marcos Pividori
In Windows, when the sanitizer is implemented as a shared library (DLL), we need an auxiliary static library dynamic_runtime_thunk that will be linked to the main executable and dlls. In the sanitizer DLL, we are exposing weak functions with WIN_WEAK_EXPORT_DEF(), which exports the default implementation with __dll suffix. For example: for sanitizer coverage, the default implementation of __sanitizer_cov_trace_cmp is exported as: __sanitizer_cov_trace_cmp__dll. In the dynamic_runtime_thunk static library, we include weak aliases to the imported implementation from the dll, using the macro WIN_WEAK_IMPORT_DEF(). By default, all users's programs that include calls to weak functions like __sanitizer_cov_trace_cmp, will be redirected to the implementation in the dll, when linking to dynamic_runtime_thunk. After this diff, we are able to compile code with sanitizer coverage instrumentation on Windows. When the instrumented object files are linked with clang-rt_asan_dynamic_runtime_thunk-arch.lib all the weak symbols will be resolved to the implementation imported from asan dll. All the files sanitizer_dynamic_runtime_thunk.cc are independent, so we do not need to include a specific list of sanitizers. Now, we compile: [asan|ubsan|sanitizer_coverage]_win_dynamic_runtime_thunk.cc and sanitizer_win_dynamic_runtime_thunk.cc to generate asan_dynamic_runtime_thunk.lib, because we include asan, ubsan and sanitizer coverage in the address sanitizer library. Differential Revision: https://reviews.llvm.org/D29158 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293953 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02[sanitizer] Split dll_thunks into different sanitizers.Marcos Pividori
When the sanitizer is implemented as a static library and is included in the main executable, we need an auxiliary static library dll_thunk that will be linked to the dlls that have instrumentation, so they can refer to the runtime in the main executable. Basically, it uses interception to get a pointer the function in the main executable and override its function with that pointer. Before this diff, all of the implementation for dll_thunks was included in asan. In this diff I split it into different sanitizers, so we can use other sanitizers regardless of whether we include asan or not. All the sanitizers include a file sanitizer_win_dll_thunk.cc that register functions to be intercepted in the binary section: DLLTH When the dll including dll_thunk is initialized, it will execute __dll_thunk_init() implemented in: sanitizer_common/sanitizer_win_dll_thunk.cc, which will consider all the CB registered in the section DLLTH. So, all the functions registered will be intercepted, and redirected to the implementation in the main executable. All the files "sanitizer_win_dll_thunk.cc" are independent, so we don't need to include a specific list of sanitizers. Now, we compile: asan_win_dll_thunk.cc ubsan_win_dll_thunk.cc, sanitizer_coverage_win_dll_thunk.cc and sanitizer_win_dll_thunk.cc, to generate asan_dll_thunk, because we include asan, ubsan and sanitizer coverage in the address sanitizer library. Differential Revision: https://reviews.llvm.org/D29154 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12Revert "[sancov] moving sancov rt to sancov/ directory"Mike Aizatsky
This reverts commit https://reviews.llvm.org/rL291734 Reason: mac breakage http://lab.llvm.org:8080/green//job/clang-stage1-configure-RA_build/28798/consoleFull#1657087648e9a0fee5-ebcc-4238-a641-c5aa112c323e git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291736 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12[sancov] moving sancov rt to sancov/ directoryMike Aizatsky
Subscribers: kubabrecka, mgorny Differential Revision: https://reviews.llvm.org/D28541 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291734 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10Make cmake link flag naming consistentFrancis Ricci
Summary: The build system was inconsistent in its naming conventions for link flags. This patch changes all uses of LINKFLAGS to LINK_FLAGS, for consistency with cmake's LINK_FLAGS property. This patch should make it easier to search the source code for uses of link flags, as well as providing the benefit of improved style and consistency. Reviewers: compnerd, beanz Subscribers: kubabrecka, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28506 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291539 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09Enable weak hooks on darwinFrancis Ricci
Summary: By default, darwin requires a definition for weak interface functions at link time. Adding the '-U' link flag with each weak function allows these weak interface functions to be used without definitions, which mirrors behavior on linux and windows. Reviewers: compnerd, eugenis Subscribers: kubabrecka, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28203 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07Revert "Enable weak hooks on darwin"Francis Ricci
Reverts accidental upload. This reverts commit 421408c0f2cc811bcf9a945be6e95e46f76cb358. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291316 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07Enable weak hooks on darwinFrancis Ricci
Summary: By default, darwin requires a definition for weak interface functions at link time. Adding the '-U' link flag with each weak function allows these weak interface functions to be used without definitions, which mirrors behavior on linux and windows. Reviewers: compnerd, eugenis Subscribers: kubabrecka, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28203 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-26[CMake] Connect Compiler-RT targets to LLVM Runtimes directoryChris Bieneman
This patch builds on LLVM r279776. In this patch I've done some cleanup and abstracted three common steps runtime components have in their CMakeLists files, and added a fourth. The three steps I abstract are: (1) Add a top-level target (i.e asan, msan, ...) (2) Set the target properties for sorting files in IDE generators (3) Make the compiler-rt target depend on the top-level target The new step is to check if a command named "runtime_register_component" is defined, and to call it with the component name. The runtime_register_component command is defined in llvm/runtimes/CMakeLists.txt, and presently just adds the component to a list of sub-components, which later gets used to generate target mappings. With this patch a new workflow for runtimes builds is supported. The new workflow when building runtimes from the LLVM runtimes directory is: > cmake [...] > ninja runtimes-configure > ninja asan The "runtimes-configure" target builds all the dependencies for configuring the runtimes projects, and runs CMake on the runtimes projects. Running the runtimes CMake generates a list of targets to bind into the top-level CMake so subsequent build invocations will have access to some of Compiler-RT's targets through the top-level build. Note: This patch does exclude some top-level targets from compiler-rt libraries because they either don't install files (sanitizer_common), or don't have a cooresponding `check` target (stats). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22[compiler-rt] Don't build ubsan cxxabi sources when unusedFrancis Ricci
Summary: On apple targets, when SANITIZER_CAN_USE_CXXABI is false, the ubsan cxxabi sources aren't built, since they're unused. Do this on non-apple targets as well. This fixes errors when linking sanitizers if c++ abi is unavailable. Reviewers: pcc, kubabrecka, beanz Subscribers: rnk, llvm-commits, kubabrecka, compnerd, dberris Differential Revision: https://reviews.llvm.org/D23638 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279467 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22[cmake] Fix append_rtti_flag macro and bad var nameFilipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11[compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron
Summary: This patch is a refactoring of the way cmake 'targets' are grouped. It won't affect non-UI cmake-generators. Clang/LLVM are using a structured way to group targets which ease navigation through Visual Studio UI. The Compiler-RT projects differ from the way Clang/LLVM are grouping targets. This patch doesn't contain behavior changes. Reviewers: kubabrecka, rnk Subscribers: wang0109, llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21952 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275111 91177308-0d34-0410-b5e6-96231b3b80d8
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-03-04[ubsan/cmake] Make sure we end up adding -frtti to ↵Filipe Cabecinhas
ubsan_type_hash_itanium.cc, even if -fno-rtti is the default for the platform git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27[cfi] Disable vtable diagnostics when no cxxabi.Evgeniy Stepanov
This should fix the build on Mac 10.8 and earlier. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258988 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10Revert "[CMake] Provide options for toggling on and off various runtime ↵Chris Bieneman
libraries." This reverts r255170. This change caused a bunch of bot failures and needs to be revised. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-09[CMake] Provide options for toggling on and off various runtime libraries.Chris Bieneman
Summary: Rather than having to add new "experimental" options each time someone wants to work on bringing a sanitizer to a new platform, this patch makes options for all of them. The default values for the options are set by the platform checks that would have enabled them, but they can be overridden on or off. Reviewers: kubabrecka, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14846 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255170 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-27[CMake] Add PARENT_TARGET 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. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12409 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246178 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] Cleaning up ubsan to use OBJECT_LIBS and to not loop when calling ↵Chris Bieneman
add_compiler_rt_runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246097 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-08CFI: Get check-cfi passing on Windows.Peter Collingbourne
Specifically: - Start using %expect_crash. - Provide an implementation of __ubsan::getDynamicTypeInfoFromVtable for the Microsoft C++ ABI. This is all that is needed for CFI diagnostics; UBSan's -fsanitize=vptr also requires an implementation of __ubsan::checkDynamicType. - Build the sanitizer runtimes against the release version of the C runtime, even in debug builds. - Accommodate demangling differences in tests. Differential Revision: http://reviews.llvm.org/D11029 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241745 91177308-0d34-0410-b5e6-96231b3b80d8