fix(teensy): disable LTO on teensylc release profile (Thumb-1 offset overflow)#302
Conversation
…overflow) Teensy LC is Cortex-M0+ — Thumb-1 only. Thumb-1 PC-relative loads have an immediate-offset limit (~1 KB / 0x400) that LTO output routinely overflows when whole-program optimization rearranges literal pools. On FastLED's `teensyLC` workflow, every release build now fails: .lto-tmp/ccWj7t00.s:193: Error: invalid offset, value too big (0x000004CC) .lto-tmp/ccWj7t00.s:206: Error: invalid offset, value too big (0x00000498) lto-wrapper: fatal error: make returned 2 exit status Drop `-flto=auto` from teensylc's release profile (compile_flags + link_flags). The cost is a slightly larger image but actual link success — and on Teensy LC the image budget isn't the limiting factor (64 KB flash on MKL26Z64; FastLED examples sit comfortably inside without LTO). Other Teensy profiles (teensy30/31/32/3x/4x — all Cortex-M3+/M4+/M7, Thumb-2) keep LTO. This change is targeted to MKL26Z64 only. Reference config (`configs/reference/teensylc.json`) does not list `-flto` either, so the `test_linker_flags_match_platformio_reference` guard continues to pass. All 38 `teensy::` tests pass. Repro: any FastLED `teensyLC` workflow run on master before this change (e.g. https://github.com/FastLED/FastLED/actions/runs/26686967724).
|
Warning Review limit reached
More reviews will be available in 40 minutes and 15 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
teensyLCrelease build on master fails at the assembler withError: invalid offset, value too big (0x000004CC)on.lto-tmp/*.s, thenlto-wrapper: fatal error: make returned 2 exit status.ldr Rd, [PC, #imm]) max out around 1 KB (10-bit word-aligned immediate → 0x3FC). LTO rearranges literal pools across TUs and overshoots that on FastLED-sized projects.-flto=auto/-fno-fat-lto-objects/-fuse-linker-pluginfrom teensylc's release profile incrates/fbuild-build/src/teensy/configs/teensylc.json. Keep-Osfor size.Test plan
cargo check -p fbuild-buildclean.cargo test -p fbuild-build --lib teensy::— 38/38 (includingtest_teensylc_linker_flags_match_platformioandtest_linker_flags_match_platformio_referencewhich don't reference-fltoin the linker_flags allow-list).teensyLCworkflow should now link successfully.Fixes #301
Generated with Claude Code (https://claude.com/claude-code)