Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optiboot grows bigger with (Arduino IDE) avr-gcc 7.3.0 #301

Open
WestfW opened this issue Nov 10, 2020 · 4 comments
Open

Optiboot grows bigger with (Arduino IDE) avr-gcc 7.3.0 #301

WestfW opened this issue Nov 10, 2020 · 4 comments
Assignees
Labels
Maintainability Fixing this should improve the readablity/maintainabiity of Optiboot. Priority-Medium Regression Something that used to work has become broken.

Comments

@WestfW
Copy link
Member

WestfW commented Nov 10, 2020

Compiled with the version of avr-gcc (7.3.0) distributed with recent Arduino IDEs (1.8.13), optiboot grows 14 bytes.
The normal versions still fit in 512 bytes, but attempts to build a non-blinking, EEPROM-support version (documented as possible) fail...

The area of code growth is not obvious :-(

See #300

 make GCCROOT=/Applications/Arduino-1.8.13.app/Contents/Java/portable/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/ atmega328
avr-gcc (GCC) 7.3.0

/Applications/Arduino-1.8.13.app/Contents/Java/portable/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -mmcu=atmega328p -DF_CPU=16000000L  -DBAUD_RATE=115200 -DLED_START_FLASHES=3              -c -o optiboot.o optiboot.c

/Applications/Arduino-1.8.13.app/Contents/Java/portable/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -mmcu=atmega328p -DF_CPU=16000000L  -DBAUD_RATE=115200 -DLED_START_FLASHES=3            -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe -Wl,--relax -nostartfiles -o optiboot_atmega328.elf optiboot.o 
/Applications/Arduino-1.8.13.app/Contents/Java/portable/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-size optiboot_atmega328.elf
   text    data     bss     dec     hex filename
    496       0       0     496     1f0 optiboot_atmega328.elf
 make atmega328
avr-gcc (AVR_8_bit_GNU_Toolchain_3.6.1_495) 5.4.0

avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -mmcu=atmega328p -DF_CPU=16000000L  -DBAUD_RATE=115200 -DLED_START_FLASHES=3              -c -o optiboot.o optiboot.c

avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -mmcu=atmega328p -DF_CPU=16000000L  -DBAUD_RATE=115200 -DLED_START_FLASHES=3            -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe -Wl,--relax -nostartfiles -o optiboot_atmega328.elf optiboot.o 
avr-size optiboot_atmega328.elf
   text    data     bss     dec     hex filename
    482       0       0     482     1e2 optiboot_atmega328.elf
@WestfW WestfW added Priority-Medium Maintainability Fixing this should improve the readablity/maintainabiity of Optiboot. Regression Something that used to work has become broken. labels Nov 10, 2020
@WestfW WestfW self-assigned this Nov 10, 2020
@WestfW
Copy link
Member Author

WestfW commented Nov 10, 2020

Huh. optiboot_x SHRINKS by two bytes.
Which is especially odd since it looks like the part of code that grows is NOT the actual flash writing (which is substantially different.)

@WestfW
Copy link
Member Author

WestfW commented Nov 10, 2020

Not particularly useful, but...

avr-gcc 5.4:

00007fc0 00000020 t do_spm
00007fb2 0000000e t getNch
00007f7e 00000018 T getch
00007e04 0000016c T main
00007ffe 00000002 R optiboot_version
00007e00 00000004 T pre_main
00007f70 0000000e T putch
00007fa2 00000010 T verifySpace
00007f96 0000000c T watchdogConfig

avr-gcc 7.3.0:

00007fce 00000020 t do_spm
00007fc0 0000000e t getNch
00007f8c 00000018 T getch
00007e04 0000017a T main
00007ffe 00000002 R optiboot_version
00007e00 00000004 T pre_main
00007f7e 0000000e T putch
00007fb0 00000010 T verifySpace
00007fa4 0000000c T watchdogConfig

@motolav
Copy link

motolav commented Aug 23, 2021

I ran "make atmega328p" with GCC 11.1.0 and it shrunk 2 bytes compared to your 7.3.0
GCC 12 will have the mode_cc changes to the AVR target, which is already in master

@mcuee
Copy link

mcuee commented Dec 19, 2022

Please refer to here as well.

avr-gcc 7.3.0 is always worse than avr-gcc 5.4.0 when compiling optiboot.

Screenshot 2022-12-10 201350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintainability Fixing this should improve the readablity/maintainabiity of Optiboot. Priority-Medium Regression Something that used to work has become broken.
Projects
None yet
Development

No branches or pull requests

3 participants