tree: 663d856fc62b646b8dc3c758a74b7731600b03ce [search]
  1. BUILD.bazel
  2. BUILD.gn
  3. handlers.h
  4. OWNERS
  5. README.md
  6. report.h
  7. types.h
src/lib/ubsan-custom/README.md

Minimal UndefinedBehaviorSanitizer for custom embedded uses

This is a small header-only library that makes it simple to define the runtime required by (UndefinedBehaviorSanitizer)ubsan. The runtime implementations in LLVM's compiler-rt, even the “minimal” one, cannot fit into custom build situations such as kernel or embedded code, for a variety of reasons.

TODO(https://fxbug.dev/334165273): This may be upstreamed into LLVM in the future, removing the need for this separate header library.

Embedder API

The <lib/ubsan-custom/ubsan-report.h> header file describes the few functions that the embedder must define. These have to take care of printing messages via a printf-style API; and whatever it should look to prepare for a problem report or panic before printing details and to panic afterwards.