Where gold?
Some checks failed
Hello World (Multiplatform) / build (macos-12) (push) Has been cancelled
Hello World (Multiplatform) / build (macos-14) (push) Has been cancelled
Hello World (Multiplatform) / build (ubuntu-22.04) (push) Has been cancelled
Hello World (Multiplatform) / build (windows-2022) (push) Has been cancelled
Run tests with twister / twister-build-prep (push) Has been cancelled
Run tests with twister / twister-build (push) Has been cancelled
Run tests with twister / Publish Unit Tests Results (push) Has been cancelled
Run tests with twister / Check Twister Status (push) Has been cancelled

This commit is contained in:
Patrick 2024-06-05 20:36:27 +02:00
parent 0fe6b3ba9e
commit 58542a693b
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
5 changed files with 5 additions and 1 deletions

View file

@ -822,7 +822,7 @@ target_include_directories(${OFFSETS_LIB} PRIVATE
)
# Make sure that LTO will never be enabled when compiling offsets.c
set_source_files_properties(${OFFSETS_C_PATH} PROPERTIES COMPILE_OPTIONS $<TARGET_PROPERTY:compiler,prohibit_lto>)
set_source_files_properties(${OFFSETS_C_PATH} PROPERTIES COMPILE_OPTIONS "$<TARGET_PROPERTY:compiler,prohibit_lto>;$<TARGET_PROPERTY:compiler,prohibit_cfi>")
target_link_libraries(${OFFSETS_LIB} zephyr_interface)
add_dependencies(zephyr_interface

View file

@ -161,6 +161,7 @@ endif()
if(CONFIG_CFI)
zephyr_compile_options(-flto)
target_compile_options(native_simulator INTERFACE "-flto")
target_link_options(native_simulator INTERFACE "-flto")
list(APPEND LLVM_SANITIZERS "cfi")
endif()

View file

@ -24,6 +24,7 @@ set_compiler_property(PROPERTY optimization_size -Os)
if(CMAKE_C_COMPILER_VERSION GREATER_EQUAL "4.5.0")
set_compiler_property(PROPERTY optimization_lto -flto)
set_compiler_property(PROPERTY prohibit_lto -fno-lto)
set_compiler_property(PROPERTY prohibit_cfi -fno-sanitize=cfi)
endif()
#######################################################

View file

@ -131,6 +131,7 @@ function(toolchain_ld_link_elf)
${TOPT}
${TOOLCHAIN_LD_LINK_ELF_LINKER_SCRIPT}
${TOOLCHAIN_LD_LINK_ELF_LIBRARIES_POST_SCRIPT}
-flto
${LINKERFLAGPREFIX},-Map=${TOOLCHAIN_LD_LINK_ELF_OUTPUT_MAP}
${LINKERFLAGPREFIX},--whole-archive

View file

@ -1,3 +1,4 @@
CONFIG_GPIO=y
CONFIG_ASAN=y
CONFIG_CFI=y
#CONFIG_LLVM_USE_LLD=y