Go Down

Topic: Code size with different versions and -flto optimization (Read 3594 times) previous topic - next topic

Apr 03, 2015, 06:58 pm Last Edit: Apr 04, 2015, 12:09 am by common_ground
An update to the -flto option : It fails !

My sketch on my Arduino Mega 2560 board was growing

Anyone knows how to fix this ?
In release notes for 1.6.3 They say, among other things :

* Upgraded toolchains: statically compiled, ship with Link Time Optimization plugin (disabled by default)
So it is statically compiled and when you enabled -flto then your sketch become much bigger , i declare bug in some previously release ( 1.6.1 on windows ) there was no Link Time Optimization included at all and Federico deside to include it next time, but statically compiled.

Now solution is simple - download avr toolchain from atmel directly ( LTO included and not statically compiled ) and copy over existing one , LTO works great, but sometime, it is incompatibile with linker and that is reason why we can not using -flto allways.

LTO may introduce new, optimization-related bugs

On Linux, only available pre-compiled avr-toolchain from atmel is statically compiled, so you must build non-static toolchain core from source or use core from previous IDE version ( core from 1.6.1 on Linux was non-static , i think ).

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131