Skip to content

Conversation

@keith-packard
Copy link
Contributor

This splits the picolibc helper functions into separate files instead of smashing them all together. No functional changes are intended, this is just simple cleanup.

This splits the picolibc helper functions into separate files instead of
smashing them all together.

Signed-off-by: Keith Packard <[email protected]>
@rruuaanng
Copy link
Contributor

I'm wondering if it's necessary.

@rruuaanng rruuaanng added the area: picolibc Picolibc C Standard Library label Nov 8, 2024
@keith-packard
Copy link
Contributor Author

I'm wondering if it's necessary.

Not really? It makes the code a bit easier to manage as the files are shorter and have more obvious content.

zephyr_library_sources(libc-hooks.c)

# Do not allow LTO when compiling libc-hooks.c file
set_source_files_properties(libc-hooks.c PROPERTIES COMPILE_OPTIONS $<TARGET_PROPERTY:compiler,prohibit_lto>)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I inherited this piece from newlib/CMakeLists.txt and I have no idea what it is supposed to do. There's certainly no code in this library which needs to be protected from LTO; usually that's used to avoid letting the compiler elide calls to things like memset when storage is freed or other similar operations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. From the commit message it kind of seemed like it may have been an oversight to remove this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I hadn't remembered that part of the change as I did this a long time ago. Good to review and make sure nothing got missed.

@nashif nashif merged commit c759b8a into zephyrproject-rtos:main Nov 16, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: C Library C Standard Library area: picolibc Picolibc C Standard Library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants