Skip to content

nrf52840_dk / adafruit_feather_nrf52840_sense / nrf52840_supermini red: arm-gnu 15.2 LTO offset overflow #2653

Closed

Description

@zackees

Symptom

Three nRF52840 workflows have started failing on master with arm-gnu 15.2.rel1 LTO assembler errors:

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 overrides
  • SUPERMINI_NRF52840 (board_name="supermini_nrf52840") — currently no build flag overrides
  • ADA_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

Activity

  1. added a commit that references this issue on May 31, 2026
    a302c1b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions