[PATCH] D89439: [cmake] Add LLVM_UBSAN_FLAGS, to allow overriding UBSan flags

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 15:18:12 PDT 2020


vsk added inline comments.


================
Comment at: llvm/CMakeLists.txt:490
 option(LLVM_OPTIMIZE_SANITIZED_BUILDS "Pass -O1 on debug sanitizer builds" ON)
+set(LLVM_UBSAN_FLAGS
+    "-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
----------------
kastiglione wrote:
> should this be `option()`? I think this will overwrite `-DLLVM_UBSAN_FLAGS=<value>`.
>From what I gather, `set(... CACHE ...)` is appropriate here. This does not overwrite a -D command line option (otherwise -DLLVM_USE_SANITIZER would not work). Also, technically `option` doesn't support non-BOOL types, although in practice I'm not sure whether the distinction matters.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89439



More information about the llvm-commits mailing list