[En-Nut-Discussion] Patch for SuSE 10.0 and gcc402

Torben Mikael Hansen en-nut.ns at linhard.dk
Sat Nov 26 20:21:55 CET 2005


Hi 
On Friday 25 November 2005 12:05, Matthias Ringwald wrote:
> Torben, can you verifty, that your system compiles (without the avr/
> version include):

Yes it works fine!

However I found an minor error in the gcc4.patch. The Make*.avr-gcc4 files are 
not being copied to the app directory.

Further I found some more problems with the cvs (20051126). I have tried to 
compile the httpd-application.

-----------------------make output 1----------------------------------
avr-gcc -c -mmcu=atmega128 -O2 -fno-delete-null-pointer-checks -Wall -Werror 
-Wstrict-prototypes -Wno-pointer-sign -Wa,-ahlms=httpserv.lst -DETHERNUT2 
-D__HARVARD_ARCH__ -I/extra/ethernut-20051126/nutbld/include  
-I/extra/ethernut-20051126/nut/include  httpserv.c -o httpserv.o
cc1: warnings being treated as errors
httpserv.c: In function 'ShowSockets':
httpserv.c:341: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:344: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:347: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:350: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:353: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:356: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:359: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:362: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:365: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:368: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:371: warning: assignment discards qualifiers from pointer target 
type
httpserv.c:374: warning: assignment discards qualifiers from pointer target 
type
make: *** [httpserv.o] Error 1
-----------------------make output 1----------------------------------

Adding a "const" to line 329 in httpserv.c get me a bit further. Now I get

-----------------------make output 2----------------------------------
avr-gcc -c -mmcu=atmega128 -O2 -fno-delete-null-pointer-checks -Wall -Werror 
-Wstrict-prototypes -Wno-pointer-sign -Wa,-ahlms=urom.lst -DETHERNUT2 
-D__HARVARD_ARCH__ -I/extra/ethernut-20051126/nutbld/include  
-I/extra/ethernut-20051126/nut/include  urom.c -o urom.o
make: *** No rule to make target `httpserv.hex', needed by `all'.  Stop.
-----------------------make output 2----------------------------------
Now I add

%hex: %elf
	$(BIN) -R .eeprom -O ihex $< $

to app/Makerules.avr-gcc4. This brings me to

-----------------------make output 3----------------------------------
avr-gcc httpserv.o urom.o /extra/ethernut-20051126/nutbld/lib/nutinit.o  
-lnutpro -lnutos -lnutarch -lnutdev -lnutnet -lnutfs -lnutcrt -mmcu=atmega128 
-Wl,-Map=httpserv.map,--cref  -o httpserv.elf
/usr/bin/../lib/gcc/avr/4.0.2/../../../../avr/bin/ld: cannot find -lnutpro
make: *** [httpserv.elf] Error 1
-----------------------make output 3----------------------------------

Then I add "-L$(LIBDIR)" to the LDFLAGS in app/Makedefs.avr-gcc4 and I get

-----------------------make output 4----------------------------------
avr-gcc httpserv.o urom.o /extra/ethernut-20051126/nutbld/lib/nutinit.o  
-lnutpro -lnutos -lnutarch -lnutdev -lnutnet -lnutfs -lnutcrt -mmcu=atmega128 
-Wl,-Map=httpserv.map,--cref  -L/extra/ethernut-20051126/nutbld/lib -o 
httpserv.elf
/usr/bin/../lib/gcc/avr/4.0.2/../../../../avr/lib/avr5/crtm128.o: In function 
`__bad_interrupt':
../../../../crt1/gcrt1.S:123: undefined reference to `main'
make: *** [httpserv.elf] Error 1
-----------------------make output 4----------------------------------

Adding "--defsym=main=0" LDFLAGS
(what does it do?)

-----------------------make output 5----------------------------------
avr-gcc httpserv.o urom.o /extra/ethernut-20051126/nutbld/lib/nutinit.o  
-lnutpro -lnutos -lnutarch -lnutdev -lnutnet -lnutfs -lnutcrt -mmcu=atmega128 
-Wl,--defsym=main=0,-Map=httpserv.map,--cref  
-L/extra/ethernut-20051126/nutbld/lib -o httpserv.elf
R .eeprom -O ihex httpserv.elf
make: R: Command not found
make: [httpserv.hex] Error 127 (ignored)
rm httpserv.elf
-----------------------make output 5----------------------------------

Adding 
BIN = $(TRGT)objcopy

make succeeds!
but 
make burn

-----------------------make burn output 1----------------------------------
make: *** No rule to make target `burn'.  Stop.
-----------------------make burn output 1----------------------------------

Applying the patches discussed in this thread to ethernut-3.9.8, I can build 
the httpd-application without any problems. Of course I get the warnings but 
since warnings are not treated as errors here, it still compiles (and runs).
Are the applications under heavy revision or are these problems special for my 
setup?

Regards
Torben



More information about the En-Nut-Discussion mailing list