Skip to content

ci(nrf52): disable LTO on xiaoblesense_adafruit to dodge arm-gnu 15.2 LTO bug - #2642

Merged
zackees merged 1 commit into
masterfrom
fix/2641-disable-lto-xiaoblesense
May 31, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2641-disable-lto-xiaoblesense

Conversation

@zackees

@zackees zackees commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

CI-unblock for xiaoblesense_adafruit. After #2636 (variant.h) and #2638 (PCA10056 guard) shipped, the post-merge build still failed — but on a different, pre-existing toolchain bug: arm-gnu 15.2.rel1 + Adafruit nRF52 BSP + LTO emits thousands of "offset out of range" assembler errors in LTO-temp output (see run 26700353292).

This bug affects supermini_nrf52840 and presumably the other nRF52840 Adafruit-BSP boards too. Filed as #2641 for the proper toolchain investigation.

Workaround: add build_unflags=["-flto"] + build_flags=["-fno-lto"] to XIAOBLESENSE_ADAFRUIT_NRF52 and the typo-alias entry in ci/boards.py. CI goes green now; #2641 tracks the toolchain root cause and broader rollout of the workaround.

Refs #2634, #2636, #2638. Partial #2641.

Test plan

  • build_xiaoblesense_adafruit job on master is green post-merge
  • adafruit_xiaoblesense workflow on master is green post-merge
  • Other nRF52840 boards continue at their current state (this PR doesn't touch them)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated build configuration for nRF52 boards (XIAOBLESENSE_ADAFRUIT_NRF52 and XIAOBLESENSE_ADAFRUI_ALIAS) with modified compiler settings.

… LTO bug

Post-#2636 / #2638 post-merge build still fails — but now on a
pre-existing toolchain bug, not on the variant.h issue this PR addressed.

arm-gnu-toolchain 15.2.rel1 + Adafruit nRF52 BSP + LTO emits thousands
of "offset out of range" assembler errors in the LTO-temp output:

  .lto-tmp/ccXXXXXX.s:13834: Error: offset out of range
  lto-wrapper: fatal error: arm-none-eabi-gcc returned 1 exit status
  collect2: error: ld returned 1 exit status

Affects xiaoblesense_adafruit, supermini_nrf52840, and likely the other
nRF52840 Adafruit-BSP boards. Tracked separately in #2641.

CI-unblock: add `build_unflags=[-flto]` + `build_flags=[-fno-lto]` to the
xiaoblesense_adafruit board entries so this board's CI goes green now.
Other affected boards can adopt the same workaround once verified.

Refs #2634 (variant.h), #2636 (variant fix), #2638 (PCA10056 guard),
#2641 (LTO toolchain bug).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a6336e09-4001-49a2-8706-3a94ebd74fe0

📥 Commits

Reviewing files that changed from the base of the PR and between 1d9a638 and 80513cb.

📒 Files selected for processing (1)
  • ci/boards.py

📝 Walkthrough

Walkthrough

Both XIAOBLESENSE Adafruit nRF52 board definitions in ci/boards.py are updated to disable Link-Time Optimization by adding explicit build_unflags and build_flags entries, addressing an arm-gnu 15.2.rel1 toolchain offset-overflow issue.

Changes

LTO Disabling for nRF52 Boards

Layer / File(s) Summary
Disable LTO for XIAOBLESENSE nRF52 boards
ci/boards.py
XIAOBLESENSE_ADAFRUIT_NRF52 and its alias XIAOBLESENSE_ADAFRUI_ALIAS are both configured to disable LTO by adding build_unflags=["-flto"] and build_flags=["-fno-lto"] with comments referencing #2641.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2636: Concurrently modifies the same XIAOBLESENSE_ADAFRUIT_NRF52 and XIAOBLESENSE_ADAFRUI_ALIAS board definitions in ci/boards.py, updating real_board_name and compiler defines while this PR adds LTO-disabling flags.

Poem

🐰 LTO's overflow workaround hops forth,
Two boards align, both north and south,
With build_unflags unfurled with care,
And -fno-lto everywhere,
The CI rabbit grins, all clear! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2641-disable-lto-xiaoblesense

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit aeda46a into master May 31, 2026
6 of 7 checks passed
@zackees
zackees deleted the fix/2641-disable-lto-xiaoblesense branch May 31, 2026 02:42
zackees added a commit that referenced this pull request May 31, 2026
#2655)

xiaoblesense_adafruit post-merge run 26700835813 succeeded at every
compile step (all 65 example builds green — the variant.h / PCA10056 /
LTO fixes from #2636 / #2638 / #2642 all worked) but the runner was
killed 37 minutes after the last log line during the Optimization Report
step (`uv run ci/optimization_report.py --first`).

Both Symbol Analysis and Optimization Report are post-build analysis
steps already marked `continue-on-error: true`, so they should never
turn a green build red. A 5-minute `timeout-minutes` cap keeps them from
hanging the entire job when a downstream script (e.g. fbuild vs PIO
artifact-path divergence — readelf/nm/objdump returned exit 1 on the
firmware.elf earlier in the same run) gets stuck in a wait loop. The
build itself still passes; the report is just skipped for that run.

Filed the underlying optimization_report.py / symbol_analysis_runner.py
fbuild-path bug separately for proper investigation.

Refs #2641.

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit that referenced this pull request May 31, 2026
… bug) (#2654)

The arm-gnu-toolchain 15.2.rel1 + Adafruit nRF52 BSP combination
produces "offset out of range" assembler errors in the LTO temp file
during link, the same bug that hit xiaoblesense_adafruit (#2641 /
PR #2642). The non-Seeed nRF52840 boards have now crossed the same
threshold:

  .lto-tmp/ccEo9QPb.s:13834: 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

Apply the same `-fno-lto` workaround to:

- NRF52840 (board_name="nrf52840_dk")
- ADA_FEATHER_NRF52840_SENSE (board_name="adafruit_feather_nrf52840_sense")
- SUPERMINI_NRF52840 (board_name="supermini_nrf52840")

NICE_NANO_NRF52840 and NRFMICRO_NRF52840 use the same toolchain but
are currently passing — leave them alone (don't pre-emptively disable
LTO on passing builds; size regressions). Re-apply only when/if they
fail.

Fixes #2653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant