Repository navigation
build: enable LTO and drop newlib crt0 - #72
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Compiler, startup, and linker configuration Makefile, linker/nrf_common.ld, changelog.md |
The build enables -flto, sets startup macros for main and .bss clearing, and adds zero-length .tbss and .sbss bounds. The changelog reports an image-size reduction of about 3.3 KB and no change to section addresses or SoftDevice call sites. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Possibly related PRs
- meshtastic/Adafruit_nRF52_Bootloader_OTAFIX#69: Its reset path and this PR’s startup configuration both relate to reaching
main()after reset and preserving.noinitdata.
Merge Risk: 
Minimal · up to 7ed18
-
No issue requiring a pre-merge fix was identified in the build and startup changes.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the linker bounds,
Then hops where startup clears its ground.
LTO trims the flash away,
While main is ready for the day.
The bootloader leaps along its way.
Comment @coderabbitai help to get the list of available commands.
|
@coderabbitai review |
✅ Action performed
|
Checklist
tools/build_all.py(or CI's board matrix) passesDescription of Change
Frees about 3.7 KB on every board, which takes the T114 from 512 B free to about 4.2 KB and pays for the other 2.6 changes. LTO is about 3.3 KB of that.
mainnever returns, so newlib's startup and exit machinery is dead weight:Reset_Handlernow copies.data, clears exactly.bss(not.noinit) and callsmain, another 368 B.The
.bootloaderConfig, UICR and.noinitsections keep their addresses and the set of SoftDevicesvccall sites is identical on all 19 boards. Tested on the X1, T1000-E, Wio Tracker L1 (S140 7.3.0) and RAK4631 (S140 6.1.1): bootloader self-update, UF2 app install,CURRENT.UF2dump and restore, serial DFU, factory erase, BLE OTA. Not tested: BLE OTA without USB on the RAK4631 (no battery on the bench board).__libc_fini_arraystays linked throughatexit; it never runs.Summary by CodeRabbit