gm2
[Top][All Lists]
Advanced

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

[Gm2] AVR cross-compiler libraries


From: Will Rose
Subject: [Gm2] AVR cross-compiler libraries
Date: Sat, 16 May 2015 12:46:14 +0100

 Building an x86 => AVR cross-compiler from the current gm2/gcc-4.7.4 sources
is straightforward, but I'm a bit confused about the libraries.  I've dug a
posting by Gaius Mulley out of the archives, and it recommends compiling with:

$ avr-gm2 -mmcu=atmega328 -g -Os -fno-exceptions -O2 -c flashled328.mod \
  -flibs=min
$ avr-gm2 -mmcu=atmega328 -g -Os -fno-exceptions -O2 -fno-pth -fonlylink \
  flashled328.mod -flibs=min -o flashled328.elf

This works, and produces a valid ATmega hex file.  However, I don't understand
the use of both Os and O2; are they both necessary?  A one-step build:

avr-gm2 -mmcu=atmega328 -Os -fno-execeptions -fno-pth -flibs=min \
 flashled328.mod -o flashled328.elf

also seems to work.  Is this a reasonable way to build binaries?

Finally, what libraries are used for eg: standard I/O?  The avr-libc library
compiles correctly; is it expected that its functions will be used via M2's
C calling convention?

Thanks for any ideas - Will


reply via email to

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