Mon 30 Jan 2012 07:19:29 PM UTC, original submission:
avr-gcc-4.7 adds better support for targets with 8-bit stack pointer, see
http://gcc.gnu.org/PR51345
The outcome of the support is that there are new multilib variants needed for targets with 8-bit SP:
avr2 is split into:
avr2 /* 16-bit SP targets */
avr2/tiny-stack /* 8-bit SP targets */
avr25 is split into:
avr25 /* 16-bit SP targets */
avr25/tiny-stack /* 8-bit SP targets */
avr-gcc will pick the right multilib version depending on -mmcu=MCU and -mtiny-stack command line options as follows:
- If no 8-bit SP derivatives are available (e.g. for avr4) -mtiny-stack has no effect on multilib selection.
- If the MCU has 8-bit SP, avr-gcc picks libraries from avr2*/tiny-stack
- If the MCU has 16-bit SP and there are 8-bit SP devices available for the same architecture (i.e. avr2, avr25) then avr-gcc will pick libraries from avr2* per default and from avr2*/tiny-stack if command line option -mtiny-stack is on.
- If no library is found, the default from avr2 is used.
If avr-libc does not provide such libraries, the last point implies code size increase for 8-bit SP devices in avr25 as default from avr2 (no MOVW, etc.) is used as fallback.
For a proper implementation, avr-libc should provide multilib variants for
avr2/tiny-stack
avr25/tiny-stack
For a quick fix, avr2/tiny-stack can be a copy of avr2.
Notice that you can provide avr2/tiny-stack and avr25/tiny-stack with older compiler versions, too. These libraries will be unused and increase the installation size, but they won't hurt or disturb the compiler.
|