Skip to content

Conversation

@mark9064
Copy link
Member

@mark9064 mark9064 commented Nov 14, 2025

Rebase of #1512

The linker warnings still exist

@mark9064 mark9064 added the maintenance Background work label Nov 14, 2025
@github-actions
Copy link

github-actions bot commented Nov 14, 2025

Build size and comparison to main:

Section Size Difference
text 385104B -128B
data 944B 0B
bss 22640B 0B

Run in InfiniEmu

@mark9064
Copy link
Member Author

The size difference definitely isn't zero though, I guess the CI job isn't built to handle toolchain changes

@mark9064
Copy link
Member Author

14.2 (I haven't downloaded 14.3 yet but should be very similar)

Memory region         Used Size  Region Size  %age Used
           FLASH:      379616 B     474632 B     79.98%
     SPARE_SPACE:           0 B        12 KB      0.00%
             RAM:       23868 B        64 KB     36.42%

10.3

Memory region         Used Size  Region Size  %age Used
           FLASH:      382428 B     474632 B     80.57%
     SPARE_SPACE:          0 GB        12 KB      0.00%
             RAM:       23576 B        64 KB     35.97%

@mark9064 mark9064 mentioned this pull request Nov 14, 2025
@mark9064 mark9064 added this to the 1.17.0 milestone Nov 14, 2025
@mark9064 mark9064 mentioned this pull request Dec 16, 2025
@mark9064 mark9064 changed the title Update to GCC 14 Update to GCC 15 Jan 10, 2026
@mark9064
Copy link
Member Author

Linker warnings now resolved by implementing stubs
For this branch:

10.3

Memory region         Used Size  Region Size  %age Used
           FLASH:      385104 B     474632 B     81.14%
     SPARE_SPACE:          0 GB        12 KB      0.00%
             RAM:       23584 B        64 KB     35.99%
Build time: 13 seconds

14.2

Memory region         Used Size  Region Size  %age Used
           FLASH:      382248 B     474632 B     80.54%
     SPARE_SPACE:           0 B        12 KB      0.00%
             RAM:       23876 B        64 KB     36.43%
Build time: 18 seconds

15.2

Memory region         Used Size  Region Size  %age Used
           FLASH:      379940 B     474632 B     80.05%
     SPARE_SPACE:           0 B        12 KB      0.00%
             RAM:       23876 B        64 KB     36.43%
             
Build time: 17 seconds

So the firmware is continuing to get smaller :)
Unfortunately there's a slight bump in memory usage somewhere in the last 5 versions, but I think we have to accept it.

// Implement functions required by libc as stubs
// These functions aren't linked into the final binary

__attribute__((error("stub"))) void _close(int fp) {
Copy link
Member Author

Choose a reason for hiding this comment

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

The attributes might be a no-op as these are technically definitions rather than declarations. But they can't hurt I guess... the docs aren't super clear


set_target_properties(${EXECUTABLE_MCUBOOT_RECOVERYLOADER_NAME} PROPERTIES
SUFFIX ".out"
LINK_FLAGS "-mthumb -mabi=aapcs -std=gnu++98 -std=c99 -L ${NRF5_SDK_PATH}/modules/nrfx/mdk -T${NRF5_LINKER_SCRIPT_MCUBOOT} --specs=nosys.specs -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections -Wl,--print-memory-usage --specs=nano.specs -Wl,-Map=${EXECUTABLE_MCUBOOT_RECOVERYLOADER_FILE_NAME}.map"
Copy link
Contributor

Choose a reason for hiding this comment

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

just so I understand correctly. To get down size we exluded the stlib with the nosys.specs linker flag.

Why can we remove it now? I'd like to learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Background work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants