Repository navigation
Description
Symptom
Three nRF52840 workflows have started failing on master with arm-gnu 15.2.rel1 LTO assembler errors:
nrf52840_dk— run 26702036353adafruit_feather_nrf52840_sense— run 26702036295nrf52840_supermini— run 26702036347
Identical signature on all three:
.lto-tmp/ccEo9QPb.s:13834: Error: offset out of range
.lto-tmp/ccEo9QPb.s:13863: Error: offset out of range
.lto-tmp/ccEo9QPb.s:13894: Error: offset out of range
...
build error: build failed: arm-none-eabi-gcc link failed:
lto-wrapper: fatal error: arm-none-eabi-gcc returned 1 exit status
❌ Compilation failed (fbuild)
Root cause
Same arm-gnu-toolchain 15.2.rel1 LTO bug PR #2642 documented for xiaoblesense_adafruit (#2641): the LTO assembler temp file (.lto-tmp/*.s) contains Thumb-2 branch offsets exceeding the encodable range when the linker is asked to emit the merged firmware. The Adafruit nRF52 BSP at 1.10601.0 brings in enough core code that the LTO-merged TU exceeds the Thumb branch reach across function boundaries.
PR #2642 fixed xiaoblesense_adafruit by setting build_unflags=["-flto"], build_flags=["-fno-lto"]. PR #2644 then applied the same workaround to xiaoblesense. The three nRF52840 boards above use the same Adafruit BSP + same toolchain, so the same bug strikes them — the LTO ramp has finally crossed the threshold for the non-Seeed nRF52840 variants too.
Fix
Apply the same -fno-lto workaround to the three failing nRF52840 board entries in ci/boards.py:
build_unflags=["-flto"],
build_flags=["-fno-lto"],Targets:
NRF52840(board_name="nrf52840_dk") — currently no build flag overridesSUPERMINI_NRF52840(board_name="supermini_nrf52840") — currently no build flag overridesADA_FEATHER_NRF52840_SENSE(board_name="adafruit_feather_nrf52840_sense") — currently 2-line minimal board entry
Scope discipline: NICE_NANO_NRF52840 and NRFMICRO_NRF52840 use the same BSP + toolchain, but their workflows are currently green — leave them alone (do not pre-emptively disable LTO on passing builds; risks size regressions). Re-apply only when/if they go red.
Test plan
- Three failing workflows go green on next master CI after merge.
- Existing-green nRF52840 builds (
nice_nano,nrfmicro) remain green.
Related
- build: nRF52840 Adafruit-BSP LTO link failure — "offset out of range" in arm-gnu 15.2.1 LTO #2641 / PR ci(nrf52): disable LTO on xiaoblesense_adafruit to dodge arm-gnu 15.2 LTO bug #2642 (xiaoblesense_adafruit LTO disable — the template fix shape)
- nrf52_xiaoblesense build red: variant.h not found (sister-board to #2634) #2643 / PR fix(nrf52): unbreak xiaoblesense (no-suffix) — variant.h not found (fixes #2643) #2644 (xiaoblesense LTO disable — same shape applied to sister board)
Activity
fix(nrf52840): disable LTO on three Adafruit-BSP boards (arm-gnu 15.2…
ci(optimization-report): cap stdout dump at 1 MiB to keep GHA runner …