You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(avr): archive framework objects with gcc-ar (fixes#304)
avr_linker::link() previously iterated the `archives` parameter and
passed each path as a raw positional argument to avr-gcc, regardless of
whether it was .a or .o. Callers (pipeline::sequential::run_sequential
_build_with_libs) pass raw .o files. As a result, framework Tone.cpp.o
was always linked into AVR binaries that never called tone(), pulling
in __vector_1 (90 B), __vector_3 (206 B) and noTone() (50 B) via
weak-symbol override of __vector_default - inflating attiny85 Blink by
342 bytes (+10.1%) vs the equivalent PlatformIO build.
Fix: partition the `archives` parameter into actual .a files (pass
through) and raw .o files (archive into libframework.a using
avr-gcc-ar). gcc-ar writes the LTO bytecode plugin index, preserving
compatibility with the default -flto -fuse-linker-plugin profile from
avr.json. Plumb gcc_ar_path through AvrLinker::new() from the
toolchain's existing get_gcc_ar_path() - already used by pick_archiver
in the orchestrator.
Regression tests assert the partition helper splits a mixed .o/.a
input correctly. The end-to-end size check landed against FastLED is
intentionally deferred to FastLED's CI (re-enable --backend fbuild for
binary-size checks once this fix ships, verify attiny85_binary_size
stays under 9500).
Closes#304.
0 commit comments