[Top][All Lists]

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

Fwd: [avr-gcc-list] [Fwd: building gcc/g++]

From: Torsten Mohr
Subject: Fwd: [avr-gcc-list] [Fwd: building gcc/g++]
Date: Thu, 9 May 2002 10:00:01 +0200

Hi everybody,

i use the attached script to generate the AVR tools i need.
It needs two parameters (where all the source packages are
and what temporary directory to use).

avr "/packages" "/tmp"

But sadly it fails to generate an avr-g++ compiler.

Can anybody tell me what is wrong?

Has anybody got a similar script?


----------  Weitergeleitete Nachricht  ----------

Subject: [avr-gcc-list] [Fwd: building gcc/g++]
Date: Mon, 07 Jan 2002 10:13:45 +1100
From: Peter Jansen <address@hidden>
To: Avr Gcc List <address@hidden>

Hi All,

In answer to the questions about compiling gcc etc for the AVR.

Here is how I compiled avr-gcc etc for Linux this seems to work ok.

Sometimes this falls over with the g++ compile, if it does its missing
some of the include files that are required. Do a make install after it
fails compiling g++ and it should go on ok.

This installs newlib for the avr and the standard c++ libraries for the
AVR which most people wont need because of code bloat. The newlib
versions of libc are bigger that the avr-libc ones. You can replace
newlib-libc with the avr-libc once libc++ has been compiled.

in some source directory:

(for bin utils)

tar xvzf binutils-2.11.2.tar.gz
mkdir binobj
cd binobj
../binutils-2.11.2/configure --target=avr
make install (by default installs to /usr/local)

(now gcc)

tar xvzf gcc-3.0.2.tar.gz
mkdir gccobj
cd gccobj
../gcc-3.0.2/configure --target=avr --enable-languages=c
make install

(now newlib)

tar xvzf newlib-1.9.0.tar.gz
mkdir newlibobj
cd newlibobj
../newlib-1.9.0/configure --target=avr
make install

(now g++)

mkdir g++obj
cd g++obj
../gcc-3.0.2/configure --target=avr --enable-languages=c,c++

(in the file libstdc++/avr/src/makefile remove the references to
building misc-inst, their are two of these a .cc file and a .lo file)

make install

and their you have it.

If you use the --prefix option for the configure lines, then make sure
that you use it in every place and don't have any old
avr-as/avr-gcc/avr-libraries around.

When compiling use you don't need -nostdlib, it picks the correct one
when you specify -mmcu=avr3. Also if you include <io.h> this defines
-D__AVR_ATmega103__ and the correct defines registers are included from
<iom103.h>. Compiling with -mcu=avr3 includes a default linker script.

I have posted patches for the ATmega128 for the above sources if you
want ATmega128 support. Some of this support is already built into the
CVS trees for gcc, binutils already for those who like like on the edge.


Peter Jansen
Smart Container
Level 2, NIC Building
NSW       1430

avr-gcc-list at http://avr1.org


Attachment: avr
Description: application/shellscript

reply via email to

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