Skip to content

feat: add libc rom linker files #11

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

Merged
merged 1 commit into from
May 6, 2025
Merged

feat: add libc rom linker files #11

merged 1 commit into from
May 6, 2025

Conversation

erhankur
Copy link
Collaborator

@erhankur erhankur commented May 5, 2025

This PR adds missing ROM libc linker files for all supported chips.

@erhankur erhankur requested a review from antmak May 5, 2025 05:51
Copy link

github-actions bot commented May 5, 2025

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello erhankur, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 56c7d97

@erhankur erhankur mentioned this pull request May 5, 2025
@antmak
Copy link
Collaborator

antmak commented May 6, 2025

LGTM otherwise!

@antmak
Copy link
Collaborator

antmak commented May 6, 2025

Maybe it would be a good idea to add an explicit statement in the description (somewhere else? maybe readme) that these functions are “pure” and do not require initialization of internal libc structures for their work? (unlike time, alloc, io)

@erhankur erhankur force-pushed the add_libc_rom_ld branch from 346510a to 56c7d97 Compare May 6, 2025 08:29
@erhankur
Copy link
Collaborator Author

erhankur commented May 6, 2025

@antmak thank you for your review. We will have more rom linker files to add. I am leaving the updating of the README for details to you. Probably you have more to say than I do.

@erhankur erhankur merged commit 1451a70 into master May 6, 2025
24 checks passed
Copy link
Collaborator

@gerekon gerekon left a comment

Choose a reason for hiding this comment

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

Sorry guys for post-merge comments

@@ -0,0 +1,63 @@
/**
* These are the newlib functions present in ESP32-S2 ROM.
* See also esp32s2.rom.newlib-data.ld for the list of .data/.bss symbols used by these functions.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@erhankur @antmak Looks like for esp32s2 we also need esp32s2.rom.newlib-data.ld
with symbols used by these functions. If functions used by stub does not need these symbols so we need to update these header comment.

@@ -0,0 +1,74 @@
/* These are the newlib functions present in ESP32 ROM.
They should not be used when compiling with PSRAM cache workaround enabled.
See also esp32.rom.newlib-data.ld for the list of .data/.bss symbols
Copy link
Collaborator

Choose a reason for hiding this comment

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

@erhankur @antmak Looks like for esp32s2 we also need esp32.rom.newlib-data.ld
with symbols used by these functions. If functions used by stub does not need these symbols so we need to update these header comment.

/* These are the newlib functions present in ESP32 ROM.
They should not be used when compiling with PSRAM cache workaround enabled.
See also esp32.rom.newlib-data.ld for the list of .data/.bss symbols
used by these functions, and esp32.rom.newlib-nano.ld for "nano" versions
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove esp32.rom.newlib-nano.ld reference

which declares strong symbols. This is done so that ROM functions are always
used instead of the ones provided by libc.a.

Time functions were moved to the esp32.rom.newlib-time.ld file.
Copy link
Collaborator

Choose a reason for hiding this comment

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

we have no esp32.rom.newlib-time.ld in the lib

@dobairoland dobairoland deleted the add_libc_rom_ld branch May 6, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants