[En-Nut-Discussion] patch on 3.9.5 and Gcc-avr on Debian

Jean Marc LACROIX jeanmarc.lacroix at free.fr
Sat Jun 4 21:58:31 CEST 2005


Hello,

On Linux platform, i am trying to generate ethernut v3.9.5 with
gcc-avr.
My config is :

-> dpkg -l |grep avr
ii  avr-libc       1.2.3-3        Standard C library for Atmel AVR 
development
ii  avra           0.7-1          Assembler for Atmel AV
microcontrollers
ii  avrp           1.0beta3-5     Programmer for Atmel AVR microcontrollers
ii  avrprog        0.2.1-10       Programmer for Atmel AVR microcontrollers
ii  binutils-avr   2.15-3         Binary utilities that support Atmel's 
AVR ta
ii  gcc-avr        3.4.3-2        The GNU C compiler (cross compiler for 
avr)
ii  gdb-avr        6.3-2          The GNU Debugger for avr
ii  simulavr       0.1.2.2-1      Atmel AVR simulator

First Error:
------------
It seems that on avr-libc, there is a little change in twi.h, so ...
avr-gcc -c -mmcu=atmega128 -O1 -Wall -Werror -Wstrict-prototypes 
-Wa,-ahlms=nutinit.lst -D__HARVARD_ARCH__  -I../include  nutinit.c -o 
nutinit.o
In file included from ../include/compiler.h:69,
                  from nutinit.c:92:
../include/arch/avr.h:240:21: avr/twi.h: Aucun fichier ou répertoire de 
ce type

The change is on #include <avr/twi.h> in nutinit.c, with the
new #include <compat/twi.h>, no problems

second error:
--------------
avr-gcc -c -mmcu=atmega128 -Os -Wall -Werror -Wstrict-prototypes 
-Wa,-ahlms=arpcache.lst -D__HARVARD_ARCH__  -I../include  arpcache.c -o 
arpcache.o
arpcache.c: In function `NutArpCacheQuery':
arpcache.c:490: error: unable to find a register to spill in class 
`POINTER_REGS'
arpcache.c:490: error: this is the insn:
(insn 90 207 206 5 (parallel [
             (set (mem:BLK (reg/v/f:HI 44 [ mac ]) [0 A8])
                 (mem:BLK (reg/v/f:HI 28 r28 [orig:46 entry ] [46]) [0 A8]))
             (use (reg:QI 24 r24 [60]))
             (use (const_int 1 [0x1]))
             (clobber (scratch:HI))
             (clobber (scratch:HI))
             (clobber (scratch:QI))
         ]) 16 {*movstrqi_insn} (insn_list 87 (insn_list 89 (nil)))
     (expr_list:REG_DEAD (reg:QI 24 r24 [60])
         (expr_list:REG_DEAD (reg/v/f:HI 44 [ mac ])
             (expr_list:REG_UNUSED (scratch:QI)
                 (expr_list:REG_UNUSED (scratch:HI)
                     (expr_list:REG_UNUSED (scratch:HI)
                         (nil)))))))
arpcache.c:490: confused by earlier errors, bailing out
make[2]: *** [arpcache.o] Erreur 1


The problem is due to optimizer, so i change -Os to -O1 in
CPFLAGS  = $(MCFLAGS) -O1 -Wall -Werror -Wstrict-prototypes 
-Wa,-ahlms=$(<F:.c=.lst) $(DEFS) in Makedefs.avr-gcc file



-- 
--------------------------------------
  -- Jean-Marc LACROIX                 --
   -- mailto : jeanmarc.lacroix at free.fr --
     ---------------------------------------



More information about the En-Nut-Discussion mailing list