Had anybody noticed that firmware sizes differ, when compiled on win and linux versions of arduino ide ?
In particular, with arduino 022 I get for my project
win xp: 6206 bytes
linux (ubuntu 11.04): 6068 bytes (6558 for arduino 021 on the same OS => with the same gcc-avr)
I guess that this may be due to the different versions of gcc-avr or different compiler options supplied in Win and Linux versions. Is there something to worry about ?
I think it is not an issue. Keep in mind Windows and Linux are totally different, so it is impossible to pretend the gcc-avr produce the exact same header code. It is a desiderable property, but it is not so easy, also because gcc is often not a "native" windows application, but runs on the top of cygwin.
Only the target architecture and the version of gcc should matter in determining the compiler output - the host operating system should not be affecting things at all - its probably different versions of gcc or gcc-avr or optimize flags.
If you want to get into it, find the .elf and do an avr-objdump -rD on both of them and compare with diff. Whatever the difference is should show up pretty quickly.
daitangio:
I think it is not an issue. Keep in mind Windows and Linux are totally different, so it is impossible to pretend the gcc-avr produce the exact same header code. It is a desiderable property, but it is not so easy, also because gcc is often not a "native" windows application, but runs on the top of cygwin.
My two cents, ciao ciao!
With respect to gcc, the OS is not a factor. If the identical version of avr-gcc were on both platforms
the identical code would be generated.
One significant difference is that the Windows version of "Arduino" package bundles everything, including a compiler,
as it comes with the WinAVR package which is burried down in the Arduino package.
The Linux arduino package does not include the compiler or binary tools but uses the tools that
are on the machine and installed by other mechanisms.
Is is something to worry about? Well it depends. It can be. In fact in some cases
the linux version will generate faulty code depending on which version of the compiler you have.
The real issue is that Atmel is not supporting anything but the windows version of the compiler
(They support WinAVR but are considering not doing that anymore in favor of only supporting their Studio IDE)
The net result of that is that WinAVR is often (usually) more up to date than the linux tools because
somebody has to root around in the WinAVR patches and drag them back into mainline gcc source.
Adding to the issue, is that the updates that Atmel has been putting into gcc are sometimes not
put back into the official gcc package for quite some time, if ever.
The linux tools also suffer from Ubuntu's handling of updates. Ubuntu considers it their
value to not update anything that they have not blessed. So Ubuntu will often be very far behind
on obscure little used packages like avr-gcc. On an Ubuntu LTS release, it could be literally years behind.
In some cases the avr-gcc package supplied by Ubuntu does not even work.
(Corrupts the stack when using interrupts)
Some members on AVRfreaks (bingo mainly) have put together a debian avr package that pulls in
the Atmel WinAVR patches to make a binary package that can easily be installed that will be very close
if not exactly the same as the WinAVR avr-gcc compiler.
The biggest advice when using linux is not to use the avr toolset in the Ubuntu
or other repositories but rather build it yourself or use bingo's binary package.