zephyr/cmake/compiler
Andy Ross 74cc534758 cmake: Update CONFIG_ASAN support
This had bitrotten a bit, and didn't build as shipped.  Current
libasan implementations want -fsanitize=address passed as a linker
argument too.  We have grown a "lld" linker variant that needs the
same cmake treatment as the "ld" binutils one, but never got it.  But
the various flags had been cut/pasted around to different places, with
slightly different forms.  That's really sort of a mess, as sanitizer
support was only ever support with host toolchains for native_posix
(and AFAICT no one anywhere has made this work on cross compilers in
an embedded environment).  And the separate "gcc" vs. "llvm" layers
were silly, as there has only ever been one API for this feature (from
LLVM, then picked up compatibly by gcc).

Pull this stuff out and just do it in one place in the posix arch for
simplicity.

Also recent sanitizers are trying to add instrumentation padding
around data that we use linker trickery to pack tightly
(c.f. SYS_INIT, STRUCT_SECTION_ITERABLE) and we need a way
("__noasan") to turn that off.  Actually for gcc, it was enough to
just make the records const (already true for most of them, except a
native_posix init struct), but clang apparently isn't smart enough.

Finally, add an ASAN_RECOVER kconfig that enables the use of
"halt_on_error=0" in $ASAN_OPTIONS, which continues execution past the
first error.

Signed-off-by: Andy Ross <andyross@google.com>
2022-08-19 08:30:01 +02:00
..
arcmwdt cmake: Update CONFIG_ASAN support 2022-08-19 08:30:01 +02:00
armclang cmake: gcc: target_arm: Support advanced floating-point options 2022-05-05 12:03:27 +09:00
clang cmake: filter not supported C++ compilation flags 2022-07-07 10:26:22 +00:00
gcc cmake: Update CONFIG_ASAN support 2022-08-19 08:30:01 +02:00
host-gcc cmake: Populate var CMAKE_GCOV 2021-09-02 19:44:00 -04:00
icx
xcc cmake: filter not supported C++ compilation flags 2022-07-07 10:26:22 +00:00
xcc-clang cmake: Add xcc-clang toolchain 2022-02-25 11:17:06 -05:00
compiler_features.cmake cmake: CMake compile features support 2021-10-01 14:40:33 -04:00
compiler_flags_template.cmake cmake: Update CONFIG_ASAN support 2022-08-19 08:30:01 +02:00