rgoel / optiboot

Automatically exported from code.google.com/p/optiboot
0 stars 0 forks source link

Too big when compiled with ubuntu current 4.2.4 gcc #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If I try to remake the hex, it will end up about 20 bytes over.

I tried this several times.

What version of the compiler is required?

Under linux, the compiler is installed separately from the arduino
environment so might not be the latest one or one too new.

Original issue reported on code.google.com by tz2026 on 2 May 2010 at 9:11

GoogleCodeExporter commented 8 years ago
Code was compiled on avr-gcc-4.3.3, using Objective Developments Crosspack 
distribution for Mac.

I'll update documentation to make this clear.

Original comment by cathed...@gmail.com on 6 May 2010 at 1:29

GoogleCodeExporter commented 8 years ago
I tried 4.3.4, same problem (from the arduino-0018 for windows from 
arduino.cc).  I
can try their Mac version but I suspect it will be the same.

Original comment by tz2026 on 6 May 2010 at 2:13

GoogleCodeExporter commented 8 years ago
The problem appears to be that the avr-gcc provided by Ubuntu and Arduino 
inserts the "zero data and bss" prologue code even though the "-nostartfiles" 
switch is passed in. I found that when the LDFLAGS in the Makefile includes the 
"-nostdlib" switch the resulting program is identical to what is provided in 
binary form (according to the .lst files).

To clarify, modifying line 61 of the Makefile to the following allows me to 
compile optiboot to less than 512 bytes:
    override LDFLAGS       = -Wl,$(LDSECTION) -Wl,--relax -nostartfiles -nostdlib

I am using avr-gcc 4.3.4 on Ubuntu 10.04. I hope this helps.

Original comment by corh...@gmail.com on 30 Aug 2010 at 12:36

GoogleCodeExporter commented 8 years ago
-nostdlib works like a charm.
Thx

Original comment by christom...@gmail.com on 28 Sep 2010 at 6:19

GoogleCodeExporter commented 8 years ago
-nostdlib works perfectly with avr-gcc 4.5.1 on linux 

Attached the diff + can be pulled from my clone 
https://code.google.com/r/lifeeth-optiboot/source/diff?spec=svn7139951c381588d85
562d64db21a8dc1ca6a7090&r=7139951c381588d85562d64db21a8dc1ca6a7090&format=side&p
ath=/optiboot/bootloaders/optiboot/Makefile

Original comment by life...@gmail.com on 31 Dec 2010 at 3:58

Attachments:

GoogleCodeExporter commented 8 years ago
still not in tree? is this project abandoned? last commit was 6 months ago!

Original comment by triffid....@gmail.com on 25 Apr 2011 at 1:28

GoogleCodeExporter commented 8 years ago
Fixed as part of the great optiboot/Arduino sync-up
http://code.google.com/p/optiboot/source/detail?r=8559b64fd093d3976cae58778a1540
256cde5c8e

Original comment by wes...@gmail.com on 30 Oct 2011 at 8:19