Repository navigation
Description
teensy41 has been failing on master since 2026-07-30. Like #3774 it is not PR-specific and blocks the matrix on every PR.
Unlike #3774 (a tool-provisioning gap) this one is a real link-level regression: the Teensy SPI library is not being linked into the firmware, so every symbol fl::SpiHw2MXRT1062 / fl::SpiHw4MXRT1062 needs is unresolved.
Evidence it is master
| run | branch / commit | result |
|---|---|---|
| 30431060834 | master, #3766 (2026-07-29) | success |
| 30434174486 | master, #3768 (2026-07-29) | success |
| 30509160856 | master, WS2814 #3770 (2026-07-30) | failure |
| 30599312243 | PR #3771 | failure, byte-identical |
The failure text on master and on PR #3771 is identical down to the section offsets (.text+0x2672, .text+0x26b0, ...), which is what you would expect if the PR contributes nothing to it — #3771 is a Python-only build-system change.
The failure
Linking firmware.elf
build error: build failed: arm-none-eabi-gcc link failed:
ld: .lto-tmp/ccRkNord.ltrans1.ltrans.o: in function `fl::SpiHw4MXRT1062::begin(fl::SpiHw4::Config const&)':
<artificial>:(.text+0x2672): undefined reference to `SPIClass::setSCK(unsigned char)'
<artificial>:(.text+0x2682): undefined reference to `SPIClass::setMOSI(unsigned char)'
<artificial>:(.text+0x2692): undefined reference to `SPIClass::setMISO(unsigned char)'
<artificial>:(.text+0x2698): undefined reference to `SPIClass::begin()'
<artificial>:(.text+0x26b0): undefined reference to `SPI'
<artificial>:(.text+0x26b4): undefined reference to `SPI1'
<artificial>:(.text+0x26b8): undefined reference to `SPI2'
ld: in function `fl::SpiHw2MXRT1062::cleanup()':
<artificial>:(.text+0x46b6): undefined reference to `SPIClass::end()'
ld: in function `fl::SpiHw2MXRT1062::begin(fl::SpiHw2::Config const&)':
<artificial>:(.text+0x6fb4): undefined reference to `SPIClass::setSCK(unsigned char)'
...
collect2: error: ld returned 1 exit status
Every unresolved symbol comes from the Teensy core's SPI library (SPIClass and the SPI/SPI1/SPI2 global instances). Compilation succeeds — this fails only at link, and only under LTO (.lto-tmp/...ltrans.o).
Notes for whoever picks this up
- Both
SpiHw2MXRT1062andSpiHw4MXRT1062are affected, inbegin()andcleanup(), so it looks like the wholeSPIlibrary dependency dropped out of the teensy41 link line rather than one call site drifting. - Worth checking whether the library is being pruned because nothing references it from a translation unit the dependency scanner sees — LTO plus an Arduino-style library auto-detection pass is a common way to lose a library that is only referenced from a
.cpp.hpppulled in indirectly. - The three
check_teensy3x_sizeworkflows are also red on master on the same commit, which may share a cause.
Master is currently red on five checks (this, #3774, and check_teensy32/35/36_size), so "all checks green" is not presently a reachable merge bar.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jul 31, 2026
Root-caused and reproduced locally. The original attribution in this issue was wrong, and so was my first hypothesis — correcting both.
It is not #3770, and not dead-code resurrection
My initial guess was that #3770 added a reference chain that resurrected previously dead-stripped SPI code. That is false.
git show 5dd05daff6touches nothing Teensy, nothing SPI, and nothing reachingSpiHw2/4MXRT1062; the last change undersrc/platforms/arm/teensy/teensy4_common/was #3577, long before the regression window.What actually happened is the inverse. Comparing the green run (5345d6a) to the red one (5dd05da):
A uniform ~27 KB shrink across every firmware, with byte-identical compiler flags, identical toolchain hash and identical fbuild version. That is a library leaving the link line, not an optimizer change.
The green run's first example logged
Compiled 1/1 files— the whole object set, including the Teensy SPI library object, was restored warm from cache. The red run loggedCompiled 84/84 files: #3770 modifiedsrc/, busting the cache and forcing the first cold dependency resolution in a long time. That resolution does not includelibraries/SPI. So #3770 is a cache-buster that exposed a latent defect, not the defect.The real bug is a pre-existing undeclared dependency: FastLED's Teensy 4.x LPSPI drivers hard-require the Arduino
SPIlibrary, and nothing puts it on the link line.Local reproduction
bash compile teensy41 --examples Blinksucceeds — which is why this looked board-wide but is not. Clockless-only sketches dead-strip the SPI drivers.bash compile teensy41 --examples Apa102fails with the identical error. CI runsargs: teensy41 all, so it hits Apa102, Apa102HD, Audio, AudioInput, AudioReactive, AutoResearch, ...Four fixes attempted — only one works, and it is not one FastLED controls
lib_ldf_mode = "deep"on the teensy41 boardlib_deps = ["SPI"]on the teensy41 board"dependencies": [{"name": "SPI", "platforms": "teensy"}]inlibrary.json#include <SPI.h>added toexamples/Apa102/Apa102.inoAll four were reverted; the working tree is clean.
Conclusion
fbuild's library dependency finder resolves only includes visible from the sketch. It does not scan library sources or library headers, and it honors neither
lib_depsnorlib_ldf_modefrom the generatedplatformio.ini, nordependenciesinlibrary.json.Corroborating evidence from the CI log itself:
Ports/PJRCSpectrumAnalyzer— whose.inoincludesSPI.hdirectly — compiled 147/147 files includinglibraries/SPI/SPI.cppand linked fine in the same failing run.Apa102, whose only path toSPI.hruns through FastLED's own headers (FastLED.h→fastspi.h:42→platforms/spi_device_proxy.h→arm/mxrt1062/spi_device_proxy.h:33→<SPI.h>), does not.Note that this header chain already exists and is reachable from the sketch's
#include <FastLED.h>. PlatformIO's ownchainLDF would follow it. fbuild does not, which is why no amount of FastLED-side declaration helps.So there is no supported FastLED-side fix.
bash compile teensy41 --examples Apa102is a 30-second reproduction for whoever picks this up. PerCLAUDE.md("do not add a temporary workaround for an fbuild gap"), I am not patching around it by sprinkling#include <SPI.h>into eight examples — that would fix CI while leaving the actual defect in place and would not help anyone building FastLED with fbuild outside this repo.Filing upstream at FastLED/fbuild.
fix(teensy4): vendor the LPSPI bring-up so the SPI drivers stop needi…
zackees commentedon Aug 2, 2026
Follow-up filed as #3838 for the broader current eensy41 all baseline: master also omits the Teensy Audio set_audioClock implementation and the Adafruit_NeoPixel implementation at link. #3775 remains the SPI-specific root-cause thread.
fix(teensy4): vendor set_audioClock instead of the Audio library (#3866)
zackees commentedon Aug 20, 2026
Resolved by #3802 (merge
2841fe8439), which implemented the #3777 design:SPIClassor the globalSPI/SPI1/SPI2objects.bash compile teensy41 --examples Apa102, linked with zero undefined references; the clockless Blink image stayed byte-identical.check_teensy41_sizeruns on master all completed successfully, including https://github.com/FastLED/FastLED/actions/runs/32419177503.The SPI-specific link regression reported here is no longer present. Broader all-examples dependency gaps remain tracked separately in #3838.