osx-cross / homebrew-avr

Homebrew AVR Toolchain
BSD 2-Clause "Simplified" License
394 stars 79 forks source link

avr-gcc: error: unrecognized command line option '-mshort-calls' #188

Closed metropt closed 4 years ago

metropt commented 4 years ago

Hi,

Today after I got a linker error on the most recent version of avr-gcc I tried an older version, 5.5.0, and, since it is the same version some of my colleagues are using on other OS I would like to use this version, however I got this unrecognised command.

ze-mac:Downloads ze$ avr-gcc -mmcu=attiny202 -B ~/Downloads/Atmel.ATtiny_DFP.1.4.310/gcc/dev/attiny202 -I ~/Downloads/Atmel.ATtiny_DFP.1.4.310/include/ -x c -c  main.c
avr-gcc: error: unrecognized command line option '-mshort-calls'

After some research I found that -mshort-calls was deprecated on 4.7 version. I can't understand how is this flag is set.

ladislas commented 4 years ago

Have you tried a simple grep/ack/ag in the directories you include?

It's defined here:

Atmel.ATtiny_DFP.1.4.310/gcc/dev/attiny202/device-specs/specs-attiny202

Line 70:

*self_spec:
    %<mmcu=* -mmcu=avrxmega3 -mshort-calls %<msp8

This thread might help you find an alternative and the rationale behind removing the option in the first place:

https://www.avrfreaks.net/forum/where-has-mshort-calls-compiler-option-gone

metropt commented 4 years ago

Thank you