Commit 4a0539af authored by Matthias Plöger's avatar Matthias Plöger Committed by Benjamin Cabé
Browse files

libc: minimal: Add "prohibit_lto" flag to avoid problems with LTO

The compiler requires that much of the C library be built without using LTO
so that various symbols are available for use by generated code, including
things like memset and memcpy.

Add the "prohibit_lto" CMake target compiler property to avoid LTO when
activated.

Signed-off-by: default avatarMatthias Plöger <matthias.ploeger@phoenixcontact.com>
parent c68d0b96
Loading
Loading
Loading
Loading
+1 −0
Changes for lib/libc/minimal/CMakeLists.txt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ set(GEN_DIR ${ZEPHYR_BINARY_DIR}/include/generated)
set(STRERROR_TABLE_H ${GEN_DIR}/libc/minimal/strerror_table.h)

zephyr_library_compile_options($<TARGET_PROPERTY:compiler,no_builtin>)
zephyr_library_compile_options($<TARGET_PROPERTY:compiler,prohibit_lto>)

zephyr_library_sources(
  source/stdlib/atoi.c