8000 ports/esp32: Allow overriding linker.lf. by karlp · Pull Request #16658 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

ports/esp32: Allow overriding linker.lf. #16658

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
Feb 28, 2025

Conversation

karlp
Copy link
Contributor
@karlp karlp commented Jan 27, 2025

Particularly for out of tree builds, we may need to provide alternative/extra linker fragment files.

In the default case, do nothing, provide a plain linker.lf, as before.

Summary

Updated version of:
#16013

Now handled in the shared cmake file. The external/examples/out-of-tree builds can now choose at their leisure whether to include a local copy of the linker.lf files, provide a custom one, or refer to the existing in-tree one.

Testing

Build testing for esp32 and esp32-s3 and comparing the sections.ld output, and verifying which files are searched for, by setting / un setting / setting invalid paths for the MICROPY_USER_LDFRAGMENTS

karlp added a commit to karlp/micropython-example-boards that referenced this pull request Jan 27, 2025
This requires handling the following upstream commits:
decf8e6a8b all: Remove the "STATIC" macro and just use "static" instead.
27279e69b4 esp32: Add IDF-version-specific sdkconfig.
and, importantly
acbdbcd95e  esp32: Workaround IDF issue placing ISR ringbuf functions in IRAM

Replacing STATIC was easy.  Adding the IDF version specific was just
implemented as upstream.
However, the new linker.lf files are not in a path that is being
searched properly. I believe this can only be fixed in micropython
itself by providing a better file reference.

The suggested upstream fix is available here: micropython/micropython#16658
and is _required_ for this patch.

Signed-off-by: Karl Palsson <karl.palsson@marel.com>
Copy link
Member
@dpgeorge dpgeorge left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

Particularly for out of tree builds, one may need to provide alternative or
extra linker fragment files, or specify an absolute path to the default
`linker.lf` file.

In the default case, do nothing, provide a plain `linker.lf`, as before.

Signed-off-by: Karl Palsson <karl.palsson@marel.com>
@dpgeorge dpgeorge force-pushed the master-linker-fragments-2025q1 branch from c7d310e to cbd21b3 Compare February 28, 2025 05:22
@dpgeorge dpgeorge merged commit cbd21b3 into micropython:master Feb 28, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0