[PATCH] D144672: [Sanitizers] Error when attempting to use `static-lsan` with `tsan` or `asan` on darwin

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 14:14:10 PST 2023


yln added a comment.

Looks like this is a follow-up to D141550 <https://reviews.llvm.org/D141550>.

LGTM, but please wait for a sign-off from Usama.
@usama54321 please confirm that static runtimes really aren't supported for ASan&TSan (not just UBSan).



================
Comment at: b/llvm/llvm-project/clang/include/clang/Basic/DiagnosticDriverKinds.td  :228
+def err_drv_unsupported_static_asan_darwin : Error<
+  "static AddressSanitizer runtime is not supported on darwin">;
 def err_drv_duplicate_config : Error<
----------------
Should we generalize this to "static sanitizer runtimes are not supported on Apple platforms" to avoid needing an error diagnostic for every tool?


================
Comment at: b/llvm/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp      :1431-1432
+    if (Sanitize.needsUbsanRt()) {
     getDriver().Diag(diag::err_drv_unsupported_static_ubsan_darwin);
     return;
+    } else if (Sanitize.needsAsanRt()) {
----------------
Needs updated indentation.


================
Comment at: b/llvm/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp      :1439
+      return;
+    }
   }
----------------
This would become less code if we are okay with not repeating the tool name in the error message.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144672/new/

https://reviews.llvm.org/D144672



More information about the llvm-commits mailing list