diff options
| author | Alexey Samsonov <vonosmas@gmail.com> | 2015-03-23 20:05:42 +0000 |
|---|---|---|
| committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-03-23 20:05:42 +0000 |
| commit | 3ae177cdb340c5bfb86d5a08b6a51a103564e490 (patch) | |
| tree | 28467e687ff2e8a9ef0afbc5572a56437babcd39 /clang/lib | |
| parent | 9ea37d9d04abe949591d5b6981cc64101498ef53 (diff) | |
| download | bcm5719-llvm-3ae177cdb340c5bfb86d5a08b6a51a103564e490.tar.gz bcm5719-llvm-3ae177cdb340c5bfb86d5a08b6a51a103564e490.zip | |
[UBSan] Introduce "ubsan_standalone" library (Clang part).
Get rid of "libclang_rt.san" library that used to contain
sanitizer_common pieces required by UBSan if it's used in a standalone
mode. Instead, build two variants of UBSan runtime: "ubsan" and
"ubsan_standalone" (same for "ubsan_cxx" and "ubsan_standalone_cxx").
Later "ubsan" and "ubsan_cxx" libraries will go away, as they will
embedded it into corresponding ASan runtimes.
llvm-svn: 233010
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 410a939d9b5..72a7749310b 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -2283,13 +2283,16 @@ collectSanitizerRuntimes(const ToolChain &TC, const ArgList &Args, StaticRuntimes.push_back("tsan"); // WARNING: UBSan should always go last. if (SanArgs.needsUbsanRt()) { - // If UBSan is not combined with another sanitizer, we need to pull in - // sanitizer_common explicitly. - if (StaticRuntimes.empty()) - HelperStaticRuntimes.push_back("san"); - StaticRuntimes.push_back("ubsan"); - if (SanArgs.linkCXXRuntimes()) - StaticRuntimes.push_back("ubsan_cxx"); + // Check if UBSan is combined with another sanitizers. + if (StaticRuntimes.empty()) { + StaticRuntimes.push_back("ubsan_standalone"); + if (SanArgs.linkCXXRuntimes()) + StaticRuntimes.push_back("ubsan_standalone_cxx"); + } else { + StaticRuntimes.push_back("ubsan"); + if (SanArgs.linkCXXRuntimes()) + StaticRuntimes.push_back("ubsan_cxx"); + } } } |

