zephyr/cmake/compiler
Keith Packard 2d64237f44 cmake: Enable undefined behavior sanitizer on all targets
GCC and Clang support the undefined behavior sanitizer in any
configuration, the only restriction is that if you want to get nice
messages printed, then you need the ubsan library routines which are only
present for posix architecture or when using picolibc.

This patch adds three new compiler properties:

 * sanitizer_undefined. Enables the undefined behavior sanitizer.
 * sanitizer_undefined_library. Calls ubsan library routines on fault.
 * sanitizer_undefined_trap. Invokes __builtin_trap() on fault.

Overhead for using the trapping sanitizer is fairly low and should be
considered for use in CI once all of the undefined behavior faults in
Zephyr are fixed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-05-02 01:16:18 +02:00
..
arcmwdt cmake: compiler: Added property flag for optimization fast 2025-03-07 20:01:18 +01:00
armclang
clang cmake clang/compiler_flags.cmake: Re-enable -Wunused-variable for clang 2025-04-25 14:03:25 +02:00
gcc cmake: Enable undefined behavior sanitizer on all targets 2025-05-02 01:16:18 +02:00
host-gcc
iar iar: toolchain: arm: Fix FPU settings for CM55 and CM85 2025-04-14 13:06:41 +02:00
icx cmake: toolchain: remove obsolete and unused macros 2024-09-04 21:26:59 +02:00
xcc compiler: for xtensa add libgcc support 2024-11-16 14:07:30 -05:00
xt-clang cmake: compiler/xt-clang: add -Wno-unknown-warning-option 2025-03-14 01:01:22 +01:00
compiler_features.cmake
compiler_flags_template.cmake cmake: compiler: Added property flag for optimization fast 2025-03-07 20:01:18 +01:00