wget http://www.mpfr.org/mpfr-current/mpfr-3.0.0.tar.gz wget http://www.multiprecision.org/mpc/download/mpc-0.8.2.tar.gz wget http://ftp.gnu.org/gnu/binutils/binutils-2.20.1.tar.gz wget http://ftp.gnu.org/gnu/gcc/gcc-4.3.4/gcc-core-4.3.4.tar.gz wget http://ftp.gnu.org/gnu/gcc/gcc-4.3.4/gcc-g++-4.3.4.tar.gz wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.7.0.tar.bz2 http://download.savannah.gnu.org/releases/avr-libc/avr-libc-manpages-1.7.0.tar.bz2 http://download.savannah.gnu.org/releases/avr-libc/avr-libc-user-manual-1.7.0.pdf.bz2 tar xf mpfr-3.0.0.tar.gz tar xf binutils-2.20.1.tar.gz # file_stat fix no longer needed! # Get patches: wget -c --user-agent=MyBrowser http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/avr-binutils/files/files.tar.gz\?tarball=1 -Obinutilspatches.tgz wget -c --user-agent=MyBrowser http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/ports/devel/avr-gcc/files/files.tar.gz\?tarball=1 -Ogccpatches.tgz tar xf binutilspatches.tgz mv files binutilspatches tar xf gccpatches.tgz mv files gccpatches # Apply patches: cd binutils-2.20.1 for i in ../binutilspatches/*; do echo $i; patch -p0 < $i; done # Build: mkdir build; cd build ../configure --target=avr --prefix=${HOME}/avr/ --with-gnu-ld --with-gnu-as --enable-install-libbfd --with-dwarf2 --disable-werror CFLAGS="-Wno-format-security " or: ../configure --target=avr --prefix=${HOME}/avr/ --with-dwarf2 --disable-werror make make install export PATH=${HOME}/avr/bin:$PATH export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH export LD_RUN_PATH=$HOME/lib:$LD_RUN_PATH # GCC: (the current patches do not work with 4.5) tar xf gcc-core-4.3.4.tar.gz; tar xf gcc-g++-4.3.4.tar.gz # Apply patches in gccpatches: for i in ../gccpatches/*; do patch -p0 < $i; done On Snow Leopard, the linker won't ignore some duplicate symbols as it should. Edit line 76 of gcc/cp/Make-lang.in to remove "tree-inline.o". Change: c-gimplify.o c-omp.o tree-inline.o to: c-gimplify.o c-omp.o # Build: mkdir build; cd build ../configure --target=avr --prefix=${HOME}/avr/ --enable-languages=c,c++ --disable-nls --disable-libssp --with-gnu-ld --with-gnu-as --with-dwarf2 --with-gmp=${HOME}/avr/gmp/ --with-mpfr=${HOME}/avr/gmp/ ../configure --target=avr --prefix=${HOME}/avr/ --enable-languages=c,c++ --disable-nls --disable-libssp --with-dwarf2 --with-gmp=${HOME}/avr/gmp/ --with-mpfr=${HOME}/avr/gmp/ make make install avr-libc: mkdir build; cd build ../configure --prefix=${HOME}/avr/ --build=`../config.guess` --target=avr --host=avr make make install avrdude: ./configure --prefix=${HOME}/avr/ make make install