The output is not telling you that is it compiling those functions. It is telling you that it has found that those functions do not need to be compiled, because the object files are up to date.
Just because something is compiled, or determined to not need compiling, does not mean that the linker will include all the object files in the resulting hex file. Only parts of object files are used, and only those parts that are needed.
The output is not telling you that is it compiling those functions.
When I remove the temporary files and compile the blink sketch again I get (amongst others) the lines:
avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -I/home/fred/Development/arduino-1.0.3/hardware/arduino/cores/arduino -I/home/fred/Development/arduino-1.0.3/hardware/arduino/variants/mega /home/fred/Development/arduino-1.0.3/hardware/arduino/cores/arduino/IPAddress.cpp -o /tmp/build4310607114410777950.tmp/IPAddress.cpp.o
In file included from /home/fred/Development/arduino-1.0.3/hardware/arduino/cores/arduino/IPAddress.cpp:3:0:
/home/fred/Development/arduino-1.0.3/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘IPAddress::operator uint32_t()’:
/home/fred/Development/arduino-1.0.3/hardware/arduino/cores/arduino/IPAddress.h:51:55: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/fred/Development/arduino-1.0.3/hardware/arduino/cores/arduino/IPAddress.h: In member function ‘bool IPAddress::operator==(const IPAddress&)’:
/home/fred/Development/arduino-1.0.3/hardware/arduino/cores/arduino/IPAddress.h:52:75: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
/home/fred/Development/arduino-1.0.3/hardware/arduino/cores/arduino/IPAddress.h:52:108: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Ignoring the warnings, it seems that the the IPAddress.h, and most likely IPAddress.c, are being compiled.
Compilers are often promoted rated on their speed of compilation, therefore it seems odd to me that a compiler would waste time compiling libraries which it is not going to use.
Only parts of object files are used, and only those parts that are needed.
In the past you have shown some knowledge of the networking with Arduino. Do you know which parts of the IPAddress.h or IPAddress.c would be used in the Blink example? (Or wiring, print, stream, tone for that matter).
Compilers are often promoted rated on their speed of compilation, therefore it seems odd to me that a compiler would waste time compiling libraries which it is not going to use.
It only does that if you delete files it needs.
Do you know which parts of the IPAddress.h or IPAddress.c would be used in the Blink example?
None of them.
(Or wiring, print, stream, tone for that matter).
HardwareSerial derives from Stream which derives from Print. An instance of HardwareSerial is created, whether you actually use it, or not. Wiring.c contains a lot of the Arduino-specific functions, like pinMode() and digitalWrite(), so those functions are needed for blinking an LED.