Skip to content

Commit

Permalink
picolibc: Disable LTO while building picolibc bits
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 7962dcb)

Original-Closes: #81674
Original-Signed-off-by: Keith Packard <keithp@keithp.com>
GitOrigin-RevId: 7962dcb
Cr-Build-Id: 8728038781288827393
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8728038781288827393
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: I301f4984ac73b7f9490d031503be525ae794569d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6113915
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Reviewed-by: Dawid Niedźwiecki <dawidn@google.com>
Tested-by: Dawid Niedźwiecki <dawidn@google.com>
Commit-Queue: Jonathon Murphy <jpmurphy@google.com>
  • Loading branch information
Keith Packard authored and Chromeos LUCI committed Dec 22, 2024
1 parent 512e6ff commit 326cc1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/libc/picolibc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ manifest:
- debug
- name: picolibc
path: modules/lib/picolibc
revision: d492d5fa7c96918e37653f303028346bb0dd51a2
revision: 82d62ed1ac55b4e34a12d0390aced2dc9af13fc9
- name: segger
revision: cf56b1d9c80f81a26e2ac5727c9cf177116a4692
path: modules/debug/segger
Expand Down

0 comments on commit 326cc1d

Please sign in to comment.