[llvm-dev] UBSAN on bare-metal (newlib on ARM)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] UBSAN on bare-metal (newlib on ARM)

Peter Smith via llvm-dev
Hi,

We found it would user-friendly on bare-metal system where semihosting
allows printing messages if UBSAN could use this instead of supporting
-fsanitize-undefined-trap-on-error only, where the user has to user a
debugger to catch the traps.

I wrote a prototype in GCC (being a GCC developer) for arm-eabi using
newlib, where I basically created new runtime "bare-metal" support
similar to sanitizer_linux.cc but with obviously much less support. It
passes most of the GCC UBSAN tests, so I thought it would be
interesting to try to upstream it.

However, I don't know how to cross-build compiler-rt libraries for
bare-metal ARM, and more generally I'm not sure how I should update
LLVM/compiler-rt 's build system for such a case.

I've noticed that there is support for ARM-RTEMS, so maybe I could use
the relevant patches as a model? Are there any instructions on how to
build an LLVM toolchain for ARM-RTEMS?
Or some information on how to add support for a new OS in
compiler-rt/sanitizers?

The scope is restricted to UBSAN, and does not include ASAN, MSAN, TSAN, ...


Thanks in advance,

Christophe
_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev