From 7962dcb288dd6a1cfd02470754cb77c2f92c1ed4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 17 Dec 2024 14:47:01 -0800 Subject: [PATCH] picolibc: Disable LTO while building picolibc bits 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 -fno-lto when building both picolibc itself as well as the Zephyr interface bits. Closes: #81674 Signed-off-by: Keith Packard --- lib/libc/picolibc/CMakeLists.txt | 2 ++ west.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libc/picolibc/CMakeLists.txt b/lib/libc/picolibc/CMakeLists.txt index d1abfa675d2..fe9dd6d50f4 100644 --- a/lib/libc/picolibc/CMakeLists.txt +++ b/lib/libc/picolibc/CMakeLists.txt @@ -11,6 +11,8 @@ zephyr_library_sources( stdio.c ) +zephyr_library_compile_options(-fno-lto) + # define __LINUX_ERRNO_EXTENSIONS__ so we get errno defines like -ESHUTDOWN # used by the network stack zephyr_compile_definitions(__LINUX_ERRNO_EXTENSIONS__) diff --git a/west.yml b/west.yml index 5ae518e39fc..e78f40c67d3 100644 --- a/west.yml +++ b/west.yml @@ -333,7 +333,7 @@ manifest: - debug - name: picolibc path: modules/lib/picolibc - revision: d492d5fa7c96918e37653f303028346bb0dd51a2 + revision: 82d62ed1ac55b4e34a12d0390aced2dc9af13fc9 - name: segger revision: cf56b1d9c80f81a26e2ac5727c9cf177116a4692 path: modules/debug/segger