The way the GNU linker deals with static archives is that it only loads objects
from the archive that are needed by *previously seen objects*. That is, in this
case, if libm or libc depend on symbols from libgcc, they might be out of luck.
As it happens, it's common for avr-libc to depend on symbols (specifically, the
deduplicated function prologue/epilogue) from libgcc. The linker, as invoked by
clang currently, fails to link the program in this case because of the argument
ordering.
In general, libraries should be supplied to the linker in a dependents-then-
dependencies order.
However, to more perfectly match GCC's behavior here--and since we don't control
the libraries in question--simply use --start-group and --end-group. These
flags tell the linker to repeatedly search all the intervening libraries until
no new undefined symbol references are created.
You are appreciated to use 'git show -U999999' or 'git diff -U999999' for better context display.