Open
Conversation
Also adding `-specs=nano.specs` to link flags when it's included in compile flags so expected and actual specs line up.
Zob314
commented
Oct 3, 2025
| "-lc", | ||
| "-lstdc++", | ||
| "-lnosys", | ||
| "-specs=nano.specs", |
Author
There was a problem hiding this comment.
I noticed from the map files that this was not being included in the link flags, despite it being included in the compiler flags. This was causing the final binary to use much more flash than necessary.
Zob314
commented
Oct 3, 2025
| flag_groups = [ | ||
| flag_group( | ||
| flags = [ | ||
| "-Wl,-Map=%{output_execpath}.map", # if is_linux else "-Wl,-map,%{output_execpath}.map", |
Author
There was a problem hiding this comment.
Commented section is from the upstream linkmap PR. Evidently Linux requires a capital M, and macOS requires a lower case m. But in the upstream commit it seems to be based on the target system, so maybe all versions of arm-none-eabi-gcc use the capital M?
I figured I'd leave the extra code here as a hint for people who run into issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for generate_linkmap feature for gcc.
Also add
-specs=nano.specsto link flags when it's included in compile flags so expected and actual specs line up.