avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: [avr-gcc-list] Linking Problems with undefined reference to '__mulh


From: Peter Hierholzer
Subject: AW: [avr-gcc-list] Linking Problems with undefined reference to '__mulhi3' when using fdevopen on atmega8
Date: Mon, 6 Oct 2003 16:12:13 +0200


> Joerg Wunsch wrote
> 
> "Peter Hierholzer" <address@hidden> wrote:
> 
> > As soon as I use fdevopen from the the avr-libc I get an unresolved
> > reference to __mulhi3 for MCU = atmega8.
> 
> I'd take this as an indication that you forgot to add the
> -mmcu=atmega8 option to the compiler command-line that is used when
> linking the entire job.  The fdevopen() function compiled for the
> ATmega8 is not supposed to call __mulhi3 (since the ATmega8 has a
> hardware multiplication unit).


No I am using -mmcu=atmega8 or -mmcu=atmega16 (standard WinAVR makefile) 

To bypass the problem I did
        copy the files of C:\WinAVR\avr\lib 
                to the directory C:\WinAVR\avr\lib\avr2
        copy the files from C:\WinAVR\avr\lib\avr4 to
                the directory C:\WinAVR\avr\lib for atmega8
        copy the files from C:\WinAVR\avr\lib\avr5 to
                the directory C:\WinAVR\avr\lib for atmega16

It looks like that the linker always goes to the directory C:\WinAVR\avr\lib
regardless what I specify for the -mmcu. 

I don't know how the compiler/linker handles the different avr2, avr3, avr4
and avr5 directories for linking. I appreciate if you can explain it or give
a pointer where it is explained.

Peter





reply via email to

[Prev in Thread] Current Thread [Next in Thread]