Skip to content

Commit 82d62ed

Browse files
committed
zephyr: Disable LTO when building the library
The compiler relies on various C library functions being present in object form. Disable link time optimization to ensure anything necessary is only built that way. Signed-off-by: Keith Packard <keithp@keithp.com>
1 parent d492d5f commit 82d62ed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

zephyr/zephyr.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ if(CONFIG_PICOLIBC_USE_MODULE)
100100

101101
# Fetch zephyr compile flags from interface
102102
get_property(PICOLIBC_EXTRA_COMPILE_OPTIONS TARGET zephyr_interface PROPERTY INTERFACE_COMPILE_OPTIONS)
103+
# Disable LTO
104+
list(APPEND PICOLIBC_EXTRA_COMPILE_OPTIONS -fno-lto)
103105

104106
# Tell Zephyr about the module built picolibc library to link against.
105107
# We need to construct the absolute path to picolibc in same fashion as CMake

0 commit comments

Comments
 (0)