Conversation
|
Build size and comparison to main:
|
|
The size difference definitely isn't zero though, I guess the CI job isn't built to handle toolchain changes |
|
14.2 (I haven't downloaded 14.3 yet but should be very similar) 10.3 |
15c6932 to
eafb127
Compare
|
Linker warnings now resolved by implementing stubs So the firmware is continuing to get smaller :) |
| // Implement functions required by libc as stubs | ||
| // These functions aren't linked into the final binary | ||
|
|
||
| __attribute__((error("stub"))) void _close(int fp) { |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
libnosys provides stub implementations for system calls like read, write etc.
Since GCC11 these stubs emit warnings at the end of compilation which are noisy and annoying
From my research it seems like the best solution is to reimplement those calls as stubs ourselves, as we're sure that they're not being used. So since we're implementing those calls ourselves, we don't need libnosys anymore
Rebase of #1512
The linker warnings still exist