Repository navigation
Description
Symptom
All nRF52840 boards built against the Adafruit BSP + arm-gnu-toolchain 15.2.rel1 (15.2.1) under LTO fail at link with thousands of offset out of range errors in the LTO-temp assembly:
```
.../release/.lto-tmp/ccXXXXXX.s:13834: Error: offset out of range
.../release/.lto-tmp/ccXXXXXX.s:13863: Error: offset out of range
.../release/.lto-tmp/ccXXXXXX.s:13894: Error: offset out of range
lto-wrapper: fatal error: arm-none-eabi-gcc returned 1 exit status
arm-none-eabi/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
```
This is happening on:
- `build_xiaoblesense_adafruit` (post-fix(nrf52): unbreak xiaoblesense_adafruit by reusing nrf52840_dk_adafruit variant #2636: https://github.com/FastLED/FastLED/actions/runs/26700353292)
- `build_supermini_nrf52840` (master: https://github.com/FastLED/FastLED/actions/runs/26699597732)
- likely `nice_nano` / `nRFMicro` and `adafruit_feather_nrf52840_sense` too
Toolchain path: `/home/runner/work/_temp/fbuild-cache/toolchains/developer-gnu/e0640e442d96f78c/15.2.Rel1/arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi/`.
Root cause hypothesis
`offset out of range` from the assembler on LTO output usually means a 16-bit branch offset overflowed. Common triggers for arm-none-eabi 15.x + Cortex-M4 + LTO:
- Code section bigger than the unconditional-branch reach (±16 MB for B/BL, ±20 MB for B.W) due to LTO-induced inlining — unlikely on 1 MB flash, so more likely:
- Long-call mismatch: LTO merges code into a different section than the linker expects, and short-form branches are emitted for what end up as long-distance calls. Workaround: add
-mlong-calls(or selectively-mlong-calls -mno-long-callsper TU), or disable LTO entirely (-fno-lto). - arm-gnu 15.2.rel1 LTO regression — worth checking the toolchain release notes.
Proposed fix
- Quick CI unblock: add
-fno-lto(or equivalent disable) to the nRF52840 Adafruit-BSP boards inci/boards.pyuntil the toolchain interaction is properly understood. This affects only release-mode CI compile, not runtime behavior of user firmware (they choose their own linker flags). - Better fix: downgrade the toolchain pin to a known-good arm-gnu (e.g. 13.x) for nRF52 builds, OR upgrade past 15.2.rel1 once a fix is available.
- Best fix: identify the specific source pattern in FastLED / Adafruit BSP that LTO is mis-laying-out, and pre-emptively annotate.
Not blocked on
The variant.h issue from #2634 is fixed — that error is gone from the log; this LTO failure is downstream.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
ci(nrf52): disable LTO on xiaoblesense_adafruit to dodge arm-gnu 15.2…
ci(build_template): cap Symbol Analysis + Optimization Report at 5 min (
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 …
zackees commentedon Jun 3, 2026
Closing after the nRF52840 LTO failure was covered by the merged follow-up PRs:
xiaoblesense_adafruitand the typo alias.xiaoblesense.-fno-ltoworkaround tonrf52840_dk,adafruit_feather_nrf52840_sense, andnrf52840_supermini.Verified current workflow evidence on 2026-06-03: recent
build_nrf52840_dk.ymlandbuild_nrf52840_supermini.ymlruns have completed successfully after these changes. The remaining post-build runtime/runner-duration concern was tracked separately in #2657.