Error with new version of GCC

Hello all,

recently i updated gcc via the yum repository within fedora 15. I have been working on a project that has been compiling fine until now. After the update i started the IDE and attempted to compile and here is what was produced.

avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/libraries/TinyGPS -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Servo /tmp/build2884017362893698118.tmp/newgeo.cpp -o/tmp/build2884017362893698118.tmp/newgeo.cpp.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/libraries/TinyGPS -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Servo -I/usr/share/arduino/libraries/TinyGPS/utility /usr/share/arduino/libraries/TinyGPS/TinyGPS.cpp -o/tmp/build2884017362893698118.tmp/TinyGPS/TinyGPS.cpp.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/libraries/TinyGPS -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Servo -I/usr/share/arduino/libraries/Wire/utility /usr/share/arduino/libraries/Wire/Wire.cpp -o/tmp/build2884017362893698118.tmp/Wire/Wire.cpp.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/libraries/TinyGPS -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Servo -I/usr/share/arduino/libraries/Wire/utility /usr/share/arduino/libraries/Wire/utility/twi.c -o/tmp/build2884017362893698118.tmp/Wire/utility/twi.c.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/libraries/TinyGPS -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Servo -I/usr/share/arduino/libraries/Servo/utility /usr/share/arduino/libraries/Servo/Servo.cpp -o/tmp/build2884017362893698118.tmp/Servo/Servo.cpp.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino /usr/share/arduino/hardware/arduino/cores/arduino/wiring_digital.c -o/tmp/build2884017362893698118.tmp/wiring_digital.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts.c -o/tmp/build2884017362893698118.tmp/WInterrupts.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino /usr/share/arduino/hardware/arduino/cores/arduino/wiring_shift.c -o/tmp/build2884017362893698118.tmp/wiring_shift.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino /usr/share/arduino/hardware/arduino/cores/arduino/wiring_pulse.c -o/tmp/build2884017362893698118.tmp/wiring_pulse.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino /usr/share/arduino/hardware/arduino/cores/arduino/wiring_analog.c -o/tmp/build2884017362893698118.tmp/wiring_analog.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino /usr/share/arduino/hardware/arduino/cores/arduino/wiring.c -o/tmp/build2884017362893698118.tmp/wiring.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino /usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.c -o/tmp/build2884017362893698118.tmp/pins_arduino.c.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 -I/usr/share/arduino/hardware/arduino/cores/arduino /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp -o/tmp/build2884017362893698118.tmp/Tone.cpp.o 
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp:37:0:
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:66:48: error: variable 'port_to_mode_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:67:49: error: variable 'port_to_input_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:68:50: error: variable 'port_to_output_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:70:54: error: variable 'digital_pin_to_port_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:72:58: error: variable 'digital_pin_to_bit_mask_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.h:73:55: error: variable 'digital_pin_to_timer_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
/usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp:108:45: error: variable 'tone_pin_to_timer_PGM' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

These are some of my specs

avr-gcc (Fedora 4.6.1-2.fc15) 4.6.1
avr-g++ (Fedora 4.6.1-2.fc15) 4.6.1
gcc (GCC) 4.6.0 20110603 (Red Hat 4.6.0-10)
g++ (GCC) 4.6.0 20110603 (Red Hat 4.6.0-10)
Arduino0022 IDE

Arduino Duemilanove with atmega328 using optiboot bootloader

any help would be appreciated thanks.

Hi there,

I'm on Fedora 15 too, same error after yum update to avr-gcc 4.6.1-2.fc15 and avr-gcc-c++ 4.6.1-2.fc15.

Fixed (worked around) with
$ yum downgrade avr-gcc avr-gcc-c++
which took me back to avr-gcc 4.5.3-1.fc15 and avr-gcc-c++ 4.5.3-1.fc15.

From what I read, this should be fixed in avr-gcc(-c++) 4.7. So just a matter of time. See this flametastic thread on gcc bugzilla
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49764