Port r172856: 'Include ubsan runtime even when building a shared library. We don't require executable to be linked with UBSan.' to Mac
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173014 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index b4a3980..5b7a6da 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -318,10 +318,7 @@
// Add Ubsan runtime library, if required.
if (Sanitize.needsUbsanRt()) {
- if (Args.hasArg(options::OPT_dynamiclib) ||
- Args.hasArg(options::OPT_bundle)) {
- // Assume the binary will provide the Ubsan runtime.
- } else if (isTargetIPhoneOS()) {
+ if (isTargetIPhoneOS()) {
getDriver().Diag(diag::err_drv_clang_unsupported_per_platform)
<< "-fsanitize=undefined";
} else {