Strange errors in math.h when trying to compile a project

SurferTim:
This is the giveaway:

/usr/lib64/gcc/avr/4.5.3/../../../../avr/include/math.h:426:15: error: expected identifier or '(' before 'double'

Line 426 is the declaration for the round function. You need to upgrade to v1.0.1 or in wiring.h:
Errors with Arduino 0023 on Ubuntu 12.04 - #2 by SurferTim - IDE 1.x - Arduino Forum

Thanks for the advice. I need to use version 0023, otherwise the firmware build is known to fail for other reasons.

I tried to follow the instructions in the link posted. This seems to have the same behavior as doing #undef round in math.h. I get the same errors as posted at the end of my original post:

/opt/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp:92:15: error: attempt to use poisoned "SIG_USART0_RECV"
/opt/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp:145:15: error: attempt to use poisoned "SIG_USART1_RECV"
/opt/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp:155:15: error: attempt to use poisoned "SIG_USART2_RECV"
/opt/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp:165:15: error: attempt to use poisoned "SIG_USART3_RECV"