Skip to content

Commit 4a0539a

Browse files
embRoobinkartben
authored andcommitted
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: Matthias Plöger <[email protected]>
1 parent c68d0b9 commit 4a0539a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/libc/minimal/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set(GEN_DIR ${ZEPHYR_BINARY_DIR}/include/generated)
1212
set(STRERROR_TABLE_H ${GEN_DIR}/libc/minimal/strerror_table.h)
1313

1414
zephyr_library_compile_options($<TARGET_PROPERTY:compiler,no_builtin>)
15+
zephyr_library_compile_options($<TARGET_PROPERTY:compiler,prohibit_lto>)
1516

1617
zephyr_library_sources(
1718
source/stdlib/atoi.c

0 commit comments

Comments
 (0)