Skip to content

Conversation

@Zob314
Copy link

@Zob314 Zob314 commented Oct 2, 2025

Add support for generate_linkmap feature for gcc.

Also add -specs=nano.specs to link flags when it's included in compile flags so expected and actual specs line up.

Zob314 added 2 commits October 2, 2025 22:31
Also adding `-specs=nano.specs` to link flags when it's included in compile flags so expected and actual specs line up.
"-lc",
"-lstdc++",
"-lnosys",
"-specs=nano.specs",
Copy link
Author

Choose a reason for hiding this comment

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

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.

flag_groups = [
flag_group(
flags = [
"-Wl,-Map=%{output_execpath}.map", # if is_linux else "-Wl,-map,%{output_execpath}.map",
Copy link
Author

@Zob314 Zob314 Oct 3, 2025

Choose a reason for hiding this comment

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

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.

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.

1 participant