[PATCH] D86299: [compiler-rt][builtins] Factor out some common bit manipulations

Anatoly Trosinenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 24 13:28:57 PDT 2020


atrosinenko added inline comments.


================
Comment at: compiler-rt/lib/builtins/int_mulo_impl.inc:22
+// themselves indefinitely when compiled with UBSan.
+#if defined(__clang__)
+#define NO_UBSAN __attribute__((no_sanitize("undefined")))
----------------
MaskRay wrote:
> AFAIK LLVM_USE_SANITIZER does not instrument compiler-rt. libclang_rt.builtins- is at the bottom of the library layering. How did you enable sanitizers?
> AFAIK LLVM_USE_SANITIZER does not instrument compiler-rt. libclang_rt.builtins- is at the bottom of the library layering. How did you enable sanitizers?

No, I have not managed to force CMake to enable UBSan on `builtins`. I just passed `-fsanitize=undefined -fsanitize-undefined-trap-on-error` cflags explicitly. The second option is exactly because I cannot link UBSan runtime libraries here but can enable `-ggdb3` and look where sanitizer triggered.

So, this hack works for this particular setup, so I can manually run such checks at least manually at least on clang, etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86299



More information about the cfe-commits mailing list