Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libc/picolibc: Split hooks into separate files #81105

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

keith-packard
Copy link
Collaborator

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
Collaborator

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
Collaborator 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
Collaborator 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
Collaborator 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