zephyr/cmake
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
..
app cmake: function to update Zephyr_DIR when loading old Zephyr packages 2022-03-07 16:35:54 +01:00
bintools cmake/llvm: Improve tool detection 2022-08-19 08:30:01 +02:00
compiler cmake: Update CONFIG_ASAN support 2022-08-19 08:30:01 +02:00
emu arch: common: dedicated `SEMIHOST` symbol 2022-04-21 13:04:52 +02:00
flash npcx: Set hex_file automatically w/ npcx hex image 2022-06-28 11:09:35 +02:00
ide
linker cmake: Update CONFIG_ASAN support 2022-08-19 08:30:01 +02:00
linker_script cmake: Fix typo in common-rom.cmake 2022-08-17 15:47:52 +00:00
makefile_exports
modules cmake: extend linker snippets for pinned sections 2022-08-18 17:23:18 +02:00
reports scripts: size_report: Add support for TF-M and BL2 image size reports 2022-03-09 14:03:52 -05:00
toolchain soc: xtensa: esp32_net: update kconfig 2022-08-16 18:06:02 +02:00
usage cmake: boards and shields cmake files repurposed 2022-02-22 10:02:39 -08:00
util
cfb.cmake scripts: move gen_cfb_font_header.py to scripts/build 2022-07-12 10:03:45 +02:00
extra_flags.cmake
gcc-m-cpu.cmake arch: arm64: define A55 core 2022-06-29 10:27:19 +02:00
gcc-m-fpu.cmake cmake: allow Cortex-R52 to configure VFP 2022-07-26 08:48:07 +02:00
gen_version_h.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
hex.cmake
kobj.cmake scripts: move gen_kobject_list.py to scripts/build/gen_kobject_list.py 2022-07-12 10:03:45 +02:00
mcuboot.cmake
package_helper.cmake cmake: Update cmake_minimum_required to 3.20.0 2022-07-04 10:18:45 +02:00
pristine.cmake
target_toolchain_flags.cmake everywhere: fix typos 2022-03-14 20:22:24 -04:00