I have setup the avr build tool-chain so that I can work from vim and xterm comfortably. I have noticed that however the builds are pretty big, even if setup() and loop() are NOP. What size should I be expecting for a standard build of the Arduino core library?
avr-size reports the following:
$ avr-size
text data bss dec hex filename
14276 314 208 14798 39ce a.out
I decided to rewrite my build configuration as it had become a bit messy as I hacked it together blindly. Now it comes in more closely to yours, so I guess whatever it was can be attributed to some silly error.
$ avr-size libarduino-core.a
text data bss dec hex filename
276 0 4 280 118 WInterrupts.c.obj (ex libarduino-core.a)
264 1 0 265 109 wiring_analog.c.obj (ex libarduino-core.a)
488 0 9 497 1f1 wiring.c.obj (ex libarduino-core.a)
438 0 0 438 1b6 wiring_digital.c.obj (ex libarduino-core.a)
320 0 0 320 140 wiring_pulse.c.obj (ex libarduino-core.a)
262 0 0 262 106 wiring_shift.c.obj (ex libarduino-core.a)
0 0 0 0 0 CDC.cpp.obj (ex libarduino-core.a)
1282 32 167 1481 5c9 HardwareSerial.cpp.obj (ex libarduino-core.a)
0 0 0 0 0 HID.cpp.obj (ex libarduino-core.a)
318 12 6 336 150 IPAddress.cpp.obj (ex libarduino-core.a)
26 0 0 26 1a main.cpp.obj (ex libarduino-core.a)
44 0 0 44 2c new.cpp.obj (ex libarduino-core.a)
1638 10 0 1648 670 Print.cpp.obj (ex libarduino-core.a)
1292 0 0 1292 50c Stream.cpp.obj (ex libarduino-core.a)
1343 1 21 1365 555 Tone.cpp.obj (ex libarduino-core.a)
0 0 0 0 0 USBCore.cpp.obj (ex libarduino-core.a)
336 0 0 336 150 WMath.cpp.obj (ex libarduino-core.a)
4084 1 1 4086 ff6 WString.cpp.obj (ex libarduino-core.a)
$ avr-size libarduino-core.a | tail - -n+2 | awk '{x+=$1}END{print x}'
12411
Yes, I think the issue was that the linker flags weren't actually being set during the link process - something to double check for anyone writing their own make.