summaryrefslogtreecommitdiff
path: root/cross/avr-gcc
diff options
context:
space:
mode:
authorwennmach <wennmach>2003-07-16 20:14:20 +0000
committerwennmach <wennmach>2003-07-16 20:14:20 +0000
commitc034d58615c59ba03dd9453cc17fc367e859aed6 (patch)
treee3663c0d0c7530b52c1204afc9ef900a829ac4a4 /cross/avr-gcc
parent5b6630e67928ac43211e47e57913a940176adf72 (diff)
downloadpkgsrc-c034d58615c59ba03dd9453cc17fc367e859aed6.tar.gz
gcc-3.0 configured as cross-compiler for Atmel AVR 8-bit RISC
microcontrollers. Submitted by Karl Janmar <karlj@mdstud.chalmers.se> in PR 22139; modified by myself. Original package from FreeBSD.
Diffstat (limited to 'cross/avr-gcc')
-rw-r--r--cross/avr-gcc/DESCR5
-rw-r--r--cross/avr-gcc/Makefile46
-rw-r--r--cross/avr-gcc/PLIST71
-rw-r--r--cross/avr-gcc/distinfo9
-rw-r--r--cross/avr-gcc/patches/patch-16bitassign302
-rw-r--r--cross/avr-gcc/patches/patch-aa18
-rw-r--r--cross/avr-gcc/patches/patch-ab112
7 files changed, 563 insertions, 0 deletions
diff --git a/cross/avr-gcc/DESCR b/cross/avr-gcc/DESCR
new file mode 100644
index 00000000000..e2fe11714ef
--- /dev/null
+++ b/cross/avr-gcc/DESCR
@@ -0,0 +1,5 @@
+gcc-3.0 configured as cross-compiler for Atmel AVR 8-bit RISC
+microcontrollers.
+
+This package includes a basic C++ compiler, although this currently
+is only of limited use (without a libstdc++), and is little tested.
diff --git a/cross/avr-gcc/Makefile b/cross/avr-gcc/Makefile
new file mode 100644
index 00000000000..f8af6ac83ba
--- /dev/null
+++ b/cross/avr-gcc/Makefile
@@ -0,0 +1,46 @@
+# $NetBSD: Makefile,v 1.1.1.1 2003/07/16 20:14:20 wennmach Exp $
+# FreeBSD Id: ports/devel/avr-gcc/Makefile,v 1.24 2003/05/11 19:32:20 joerg Exp
+
+DISTNAME= gcc-3.3.2003.05.11
+PKGNAME= avr-gcc-3.3.2003.05.11
+CATEGORIES= cross
+MASTER_SITES= http://people.freebsd.org/~joerg/
+EXTRACT_SUFX= .tar.bz2
+DISTFILES= gcc-core+g++-3.3.2003.05.11${EXTRACT_SUFX} \
+ ${MAN_AUX}
+
+MAINTAINER= karl@mdstud.chalmers.se
+COMMENT= FSF gcc-3.3 for Atmel AVR 8-bit RISC microcontrollers
+
+BUILD_DEPENDS+= avr-binutils:../../cross/avr-binutils
+BUILD_DEPENDS+= autoconf:../../devel/autoconf
+BUILD_DEPENDS+= bison:../../devel/bison
+
+EXTRACT_ONLY= gcc-core+g++-3.3.2003.05.11${EXTRACT_SUFX}
+
+# Unfortunately, only some mirrors have it as a .bz2 file, while
+# the original master site still uses .gz.
+GNU_CONFIGURE= yes
+USE_BUILDLINK2= yes
+USE_PERL5_BUILD= yes
+USE_BZIP2= yes
+USE_GMAKE= yes
+USE_BISON= yes
+USE_PKGLOCALEDIR= yes
+
+CONFIGURE_ARGS= --target=avr --prefix=${PREFIX}
+
+MAN_AUX= gcc-man.2003.05.11.gz
+
+MAKE_FLAGS= LANGUAGES="c c++"
+MAKE_ENV= MACHINE_ARCH=avr
+
+pre-build:
+ if perl -e 'use 1.10 Pod::Man' >/dev/null 2>/dev/null ; \
+ then : ; \
+ else \
+ cd ${WRKSRC} ; \
+ ${TAR} -xvzf ${DISTDIR}/${MAN_AUX} ; \
+ fi
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/cross/avr-gcc/PLIST b/cross/avr-gcc/PLIST
new file mode 100644
index 00000000000..e6468f0148c
--- /dev/null
+++ b/cross/avr-gcc/PLIST
@@ -0,0 +1,71 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2003/07/16 20:14:20 wennmach Exp $
+avr/bin/c++
+avr/bin/g++
+avr/bin/gcc
+bin/avr-c++
+bin/avr-cpp
+bin/avr-g++
+bin/avr-gcc
+bin/avr-gcc-3.3
+bin/avr-gccbug
+lib/gcc-lib/avr/3.3/avr3/libgcc.a
+lib/gcc-lib/avr/3.3/avr4/libgcc.a
+lib/gcc-lib/avr/3.3/avr5/libgcc.a
+lib/gcc-lib/avr/3.3/cc1
+lib/gcc-lib/avr/3.3/cc1plus
+lib/gcc-lib/avr/3.3/collect2
+lib/gcc-lib/avr/3.3/include/README
+lib/gcc-lib/avr/3.3/include/fixed
+lib/gcc-lib/avr/3.3/include/float.h
+lib/gcc-lib/avr/3.3/include/iso646.h
+lib/gcc-lib/avr/3.3/include/limits.h
+lib/gcc-lib/avr/3.3/include/stdarg.h
+lib/gcc-lib/avr/3.3/include/stdbool.h
+lib/gcc-lib/avr/3.3/include/stddef.h
+lib/gcc-lib/avr/3.3/include/syslimits.h
+lib/gcc-lib/avr/3.3/include/unwind.h
+lib/gcc-lib/avr/3.3/include/varargs.h
+lib/gcc-lib/avr/3.3/install-tools/fix-header
+lib/gcc-lib/avr/3.3/install-tools/fixinc.sh
+lib/gcc-lib/avr/3.3/install-tools/fixincl
+lib/gcc-lib/avr/3.3/install-tools/fixproto
+lib/gcc-lib/avr/3.3/install-tools/gsyslimits.h
+lib/gcc-lib/avr/3.3/install-tools/include/README
+lib/gcc-lib/avr/3.3/install-tools/include/float.h
+lib/gcc-lib/avr/3.3/install-tools/include/iso646.h
+lib/gcc-lib/avr/3.3/install-tools/include/limits.h
+lib/gcc-lib/avr/3.3/install-tools/include/stdarg.h
+lib/gcc-lib/avr/3.3/install-tools/include/stdbool.h
+lib/gcc-lib/avr/3.3/install-tools/include/stddef.h
+lib/gcc-lib/avr/3.3/install-tools/include/unwind.h
+lib/gcc-lib/avr/3.3/install-tools/include/varargs.h
+lib/gcc-lib/avr/3.3/install-tools/mkheaders
+lib/gcc-lib/avr/3.3/install-tools/mkheaders.conf
+lib/gcc-lib/avr/3.3/install-tools/mkinstalldirs
+lib/gcc-lib/avr/3.3/libgcc.a
+lib/gcc-lib/avr/3.3/specs
+man/man1/avr-g++.1
+man/man1/avr-gcc.1
+man/man1/cpp.1
+man/man1/gcov.1
+man/man7/fsf-funding.7
+man/man7/gfdl.7
+man/man7/gpl.7
+${PKGLOCALEDIR}/locale/be/LC_MESSAGES/gcc.mo
+${PKGLOCALEDIR}/locale/da/LC_MESSAGES/gcc.mo
+${PKGLOCALEDIR}/locale/de/LC_MESSAGES/gcc.mo
+${PKGLOCALEDIR}/locale/el/LC_MESSAGES/gcc.mo
+${PKGLOCALEDIR}/locale/es/LC_MESSAGES/gcc.mo
+${PKGLOCALEDIR}/locale/fr/LC_MESSAGES/gcc.mo
+${PKGLOCALEDIR}/locale/ja/LC_MESSAGES/gcc.mo
+${PKGLOCALEDIR}/locale/nl/LC_MESSAGES/gcc.mo
+${PKGLOCALEDIR}/locale/sv/LC_MESSAGES/gcc.mo
+${PKGLOCALEDIR}/locale/tr/LC_MESSAGES/gcc.mo
+@dirrm lib/gcc-lib/avr/3.3/avr3
+@dirrm lib/gcc-lib/avr/3.3/avr4
+@dirrm lib/gcc-lib/avr/3.3/avr5
+@dirrm lib/gcc-lib/avr/3.3/include
+@dirrm lib/gcc-lib/avr/3.3/install-tools/include
+@dirrm lib/gcc-lib/avr/3.3/install-tools
+@dirrm lib/gcc-lib/avr/3.3
+@dirrm lib/gcc-lib/avr
diff --git a/cross/avr-gcc/distinfo b/cross/avr-gcc/distinfo
new file mode 100644
index 00000000000..dc744bb2890
--- /dev/null
+++ b/cross/avr-gcc/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1.1.1 2003/07/16 20:14:20 wennmach Exp $
+
+SHA1 (gcc-core+g++-3.3.2003.05.11.tar.bz2) = d9224f5b5a76317563fa7d02c31c2ba9cdfae029
+Size (gcc-core+g++-3.3.2003.05.11.tar.bz2) = 12112530 bytes
+SHA1 (gcc-man.2003.05.11.gz) = b7e2cd1e79ba4705003762cab58e25c14899b1c9
+Size (gcc-man.2003.05.11.gz) = 153595 bytes
+SHA1 (patch-16bitassign) = 9b076aeb426cc932fd2cb9acb9c14f82996a7ae7
+SHA1 (patch-aa) = 3f8641a42a31a7f5d6839e95fc6bfbce5218f9f3
+SHA1 (patch-ab) = 8938a1987422f7d99bc51ebf906a46b66c0debac
diff --git a/cross/avr-gcc/patches/patch-16bitassign b/cross/avr-gcc/patches/patch-16bitassign
new file mode 100644
index 00000000000..26147a90a9d
--- /dev/null
+++ b/cross/avr-gcc/patches/patch-16bitassign
@@ -0,0 +1,302 @@
+$NetBSD: patch-16bitassign,v 1.1.1.1 2003/07/16 20:14:21 wennmach Exp $
+
+From marekm@amelek.gda.pl Sun Jan 19 02:37:50 2003
+Path: interface-business.de!not-for-mail
+Newsgroups: local.avr.gcc
+Followup-To: poster
+Reply-To: avr-gcc-list@avr1.org
+Subject: [avr-gcc-list] Patch for indirect 16-bit I/O
+To: avr-gcc-list@avr1.org
+X-Mailer: ELM [version 2.4ME+ PL95 (25)]
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain; charset=US-ASCII
+Message-ID: <E18a4PG-0004Cs-00@alf.amelek.gda.pl>
+From: Marek Michalkiewicz <marekm@amelek.gda.pl>
+Sender: owner-avr-gcc-list@avr1.org
+Precedence: bulk
+Date: Sun, 19 Jan 2003 02:37:50 +0100 (CET)
+Lines: 280
+Xref: interface-business.de local.avr.gcc:2452
+
+Hi,
+
+This should handle all these 16-bit I/O accesses addressed with
+pointers ("volatile" is required to force writing high byte first
+and reading low byte first in absolutely all cases, even if that
+makes the code less efficient). The patch is for CVS mainline, but
+should apply cleanly to the 3.3 branch too. I'm not committing it
+to GCC CVS just yet - please test, I haven't... well, it compiles :)
+
+BTW, mainline currently requires that SEEK_{SET,CUR,END} are
+defined in <stdio.h> - otherwise some new libgcc2.c stuff (unused
+on the AVR, but it has to compile) will cause the build to fail.
+Just edit /usr/local/avr/include/stdio.h to add them manually...
+
+Marek
+
+
+Index: gcc/config/avr/avr.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/config/avr/avr.c,v
+retrieving revision 1.87
+diff -c -3 -p -r1.87 avr.c
+*** gcc/config/avr/avr.c 16 Dec 2002 18:20:58 -0000 1.87
+--- gcc/config/avr/avr.c 19 Jan 2003 01:07:52 -0000
+*************** print_operand (file, x, code)
+*** 1138,1143 ****
+--- 1138,1153 ----
+
+ print_operand (file, XEXP (addr, 1), 0);
+ }
++ else if (code == 'p' || code == 'r')
++ {
++ if (GET_CODE (addr) != POST_INC && GET_CODE (addr) != PRE_DEC)
++ fatal_insn ("bad address, not post_inc or pre_dec:", addr);
++
++ if (code == 'p')
++ print_operand_address (file, XEXP (addr, 0)); /* X, Y, Z */
++ else
++ print_operand (file, XEXP (addr, 0), 0); /* r26, r28, r30 */
++ }
+ else if (GET_CODE (addr) == PLUS)
+ {
+ print_operand_address (file, XEXP (addr,0));
+*************** out_movhi_r_mr (insn, op, l)
+*** 1944,1949 ****
+--- 1954,1962 ----
+ rtx base = XEXP (src, 0);
+ int reg_dest = true_regnum (dest);
+ int reg_base = true_regnum (base);
++ /* "volatile" forces reading low byte first, even if less efficient,
++ for correct operation with 16-bit I/O registers. */
++ int mem_volatile_p = MEM_VOLATILE_P (src);
+ int tmp;
+
+ if (!l)
+*************** out_movhi_r_mr (insn, op, l)
+*** 2037,2042 ****
+--- 2050,2074 ----
+ if (reg_overlap_mentioned_p (dest, XEXP (base, 0)))
+ fatal_insn ("incorrect insn:", insn);
+
++ if (mem_volatile_p)
++ {
++ if (REGNO (XEXP (base, 0)) == REG_X)
++ {
++ *l = 4;
++ return (AS2 (sbiw,r26,2) CR_TAB
++ AS2 (ld,%A0,X+) CR_TAB
++ AS2 (ld,%B0,X) CR_TAB
++ AS2 (sbiw,r26,1));
++ }
++ else
++ {
++ *l = 3;
++ return (AS2 (sbiw,%r1,2) CR_TAB
++ AS2 (ld,%A0,%p1) CR_TAB
++ AS2 (ldd,%B0,%p1+1));
++ }
++ }
++
+ *l = 2;
+ return (AS2 (ld,%B0,%1) CR_TAB
+ AS2 (ld,%A0,%1));
+*************** out_movhi_mr_r (insn, op, l)
+*** 2668,2674 ****
+--- 2700,2710 ----
+ rtx base = XEXP (dest, 0);
+ int reg_base = true_regnum (base);
+ int reg_src = true_regnum (src);
++ /* "volatile" forces writing high byte first, even if less efficient,
++ for correct operation with 16-bit I/O registers. */
++ int mem_volatile_p = MEM_VOLATILE_P (dest);
+ int tmp;
++
+ if (!l)
+ l = &tmp;
+ if (CONSTANT_ADDRESS_P (base))
+*************** out_movhi_mr_r (insn, op, l)
+*** 2688,2720 ****
+ {
+ if (reg_src == REG_X)
+ {
+! /* "st X+,r26" is undefined */
+! if (reg_unused_after (insn, src))
+ return *l=4, (AS2 (mov,__tmp_reg__,r27) CR_TAB
+ AS2 (st,X,r26) CR_TAB
+ AS2 (adiw,r26,1) CR_TAB
+ AS2 (st,X,__tmp_reg__));
+ else
+ return *l=5, (AS2 (mov,__tmp_reg__,r27) CR_TAB
+- AS2 (st,X,r26) CR_TAB
+ AS2 (adiw,r26,1) CR_TAB
+ AS2 (st,X,__tmp_reg__) CR_TAB
+! AS2 (sbiw,r26,1));
+ }
+ else
+ {
+! if (reg_unused_after (insn, base))
+ return *l=2, (AS2 (st,X+,%A1) CR_TAB
+ AS2 (st,X,%B1));
+ else
+! return *l=3, (AS2 (st ,X+,%A1) CR_TAB
+! AS2 (st ,X,%B1) CR_TAB
+! AS2 (sbiw,r26,1));
+ }
+ }
+ else
+! return *l=2, (AS2 (st ,%0,%A1) CR_TAB
+! AS2 (std,%0+1,%B1));
+ }
+ else if (GET_CODE (base) == PLUS)
+ {
+--- 2724,2756 ----
+ {
+ if (reg_src == REG_X)
+ {
+! /* "st X+,r26" and "st -X,r26" are undefined. */
+! if (!mem_volatile_p && reg_unused_after (insn, src))
+ return *l=4, (AS2 (mov,__tmp_reg__,r27) CR_TAB
+ AS2 (st,X,r26) CR_TAB
+ AS2 (adiw,r26,1) CR_TAB
+ AS2 (st,X,__tmp_reg__));
+ else
+ return *l=5, (AS2 (mov,__tmp_reg__,r27) CR_TAB
+ AS2 (adiw,r26,1) CR_TAB
+ AS2 (st,X,__tmp_reg__) CR_TAB
+! AS2 (sbiw,r26,1) CR_TAB
+! AS2 (st,X,r26));
+ }
+ else
+ {
+! if (!mem_volatile_p && reg_unused_after (insn, base))
+ return *l=2, (AS2 (st,X+,%A1) CR_TAB
+ AS2 (st,X,%B1));
+ else
+! return *l=3, (AS2 (adiw,r26,1) CR_TAB
+! AS2 (st,X,%B1) CR_TAB
+! AS2 (st,-X,%A1));
+ }
+ }
+ else
+! return *l=2, (AS2 (std,%0+1,%B1) CR_TAB
+! AS2 (st,%0,%A1));
+ }
+ else if (GET_CODE (base) == PLUS)
+ {
+*************** out_movhi_mr_r (insn, op, l)
+*** 2727,2740 ****
+
+ if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest)))
+ return *l = 4, (AS2 (adiw,r28,%o0-62) CR_TAB
+- AS2 (std,Y+62,%A1) CR_TAB
+ AS2 (std,Y+63,%B1) CR_TAB
+ AS2 (sbiw,r28,%o0-62));
+
+ return *l = 6, (AS2 (subi,r28,lo8(-%o0)) CR_TAB
+ AS2 (sbci,r29,hi8(-%o0)) CR_TAB
+- AS2 (st,Y,%A1) CR_TAB
+ AS2 (std,Y+1,%B1) CR_TAB
+ AS2 (subi,r28,lo8(%o0)) CR_TAB
+ AS2 (sbci,r29,hi8(%o0)));
+ }
+--- 2763,2776 ----
+
+ if (disp <= 63 + MAX_LD_OFFSET (GET_MODE (dest)))
+ return *l = 4, (AS2 (adiw,r28,%o0-62) CR_TAB
+ AS2 (std,Y+63,%B1) CR_TAB
++ AS2 (std,Y+62,%A1) CR_TAB
+ AS2 (sbiw,r28,%o0-62));
+
+ return *l = 6, (AS2 (subi,r28,lo8(-%o0)) CR_TAB
+ AS2 (sbci,r29,hi8(-%o0)) CR_TAB
+ AS2 (std,Y+1,%B1) CR_TAB
++ AS2 (st,Y,%A1) CR_TAB
+ AS2 (subi,r28,lo8(%o0)) CR_TAB
+ AS2 (sbci,r29,hi8(%o0)));
+ }
+*************** out_movhi_mr_r (insn, op, l)
+*** 2746,2772 ****
+ *l = 7;
+ return (AS2 (mov,__tmp_reg__,r26) CR_TAB
+ AS2 (mov,__zero_reg__,r27) CR_TAB
+! AS2 (adiw,r26,%o0) CR_TAB
+! AS2 (st,X+,__tmp_reg__) CR_TAB
+ AS2 (st,X,__zero_reg__) CR_TAB
+ AS1 (clr,__zero_reg__) CR_TAB
+! AS2 (sbiw,r26,%o0+1));
+ }
+ *l = 4;
+! return (AS2 (adiw,r26,%o0) CR_TAB
+! AS2 (st,X+,%A1) CR_TAB
+! AS2 (st,X,%B1) CR_TAB
+! AS2 (sbiw,r26,%o0+1));
+ }
+! return *l=2, (AS2 (std,%A0,%A1) CR_TAB
+! AS2 (std,%B0,%B1));
+ }
+ else if (GET_CODE (base) == PRE_DEC) /* (--R) */
+ return *l=2, (AS2 (st,%0,%B1) CR_TAB
+ AS2 (st,%0,%A1));
+ else if (GET_CODE (base) == POST_INC) /* (R++) */
+! return *l=2, (AS2 (st,%0,%A1) CR_TAB
+! AS2 (st,%0,%B1));
+ fatal_insn ("unknown move insn:",insn);
+ return "";
+ }
+--- 2782,2830 ----
+ *l = 7;
+ return (AS2 (mov,__tmp_reg__,r26) CR_TAB
+ AS2 (mov,__zero_reg__,r27) CR_TAB
+! AS2 (adiw,r26,%o0+1) CR_TAB
+ AS2 (st,X,__zero_reg__) CR_TAB
++ AS2 (st,-X,__tmp_reg__) CR_TAB
+ AS1 (clr,__zero_reg__) CR_TAB
+! AS2 (sbiw,r26,%o0));
+ }
+ *l = 4;
+! return (AS2 (adiw,r26,%o0+1) CR_TAB
+! AS2 (st,X,%B1) CR_TAB
+! AS2 (st,-X,%A1) CR_TAB
+! AS2 (sbiw,r26,%o0));
+ }
+! return *l=2, (AS2 (std,%B0,%B1) CR_TAB
+! AS2 (std,%A0,%A1));
+ }
+ else if (GET_CODE (base) == PRE_DEC) /* (--R) */
+ return *l=2, (AS2 (st,%0,%B1) CR_TAB
+ AS2 (st,%0,%A1));
+ else if (GET_CODE (base) == POST_INC) /* (R++) */
+! {
+! if (mem_volatile_p)
+! {
+! if (REGNO (XEXP (base, 0)) == REG_X)
+! {
+! *l = 4;
+! return (AS2 (adiw,r26,1) CR_TAB
+! AS2 (st,X,%B1) CR_TAB
+! AS2 (st,-X,%A1) CR_TAB
+! AS2 (adiw,r26,2));
+! }
+! else
+! {
+! *l = 3;
+! return (AS2 (std,%p0+1,%B1) CR_TAB
+! AS2 (st,%p0,%A1) CR_TAB
+! AS2 (adiw,%r0,2));
+! }
+! }
+!
+! *l = 2;
+! return (AS2 (st,%0,%A1) CR_TAB
+! AS2 (st,%0,%B1));
+! }
+ fatal_insn ("unknown move insn:",insn);
+ return "";
+ }
+
+
+
+avr-gcc-list at http://avr1.org
+
diff --git a/cross/avr-gcc/patches/patch-aa b/cross/avr-gcc/patches/patch-aa
new file mode 100644
index 00000000000..9af0424df15
--- /dev/null
+++ b/cross/avr-gcc/patches/patch-aa
@@ -0,0 +1,18 @@
+$NetBSD: patch-aa,v 1.1.1.1 2003/07/16 20:14:21 wennmach Exp $
+
+--- libiberty/Makefile.in.org 2003-07-14 15:07:57.000000000 +0200
++++ libiberty/Makefile.in 2003-07-14 15:09:30.000000000 +0200
+@@ -258,11 +258,12 @@
+ @MAINT@stamp-functions : $(CFILES) $(TEXIFILES) $(srcdir)/gather-docs Makefile
+ @MAINT@@HAVE_PERL@ $(PERL) $(srcdir)/gather-docs $(srcdir) $(srcdir)/functions.texi $(CFILES) $(TEXIFILES)
+ @MAINT@ echo stamp > stamp-functions
+
+ INSTALL_DEST = @INSTALL_DEST@
+-install: install_to_$(INSTALL_DEST) install-subdir
++#install: install_to_$(INSTALL_DEST) install-subdir
++install:
+
+ install_to_libdir: all
+ ${mkinstalldirs} $(DESTDIR)$(libdir)$(MULTISUBDIR)
+ $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)$(MULTISUBDIR)/$(TARGETLIB)n
+ ( cd $(DESTDIR)$(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n )
diff --git a/cross/avr-gcc/patches/patch-ab b/cross/avr-gcc/patches/patch-ab
new file mode 100644
index 00000000000..0a42846f407
--- /dev/null
+++ b/cross/avr-gcc/patches/patch-ab
@@ -0,0 +1,112 @@
+$NetBSD: patch-ab,v 1.1.1.1 2003/07/16 20:14:21 wennmach Exp $
+
+--- Makefile.in.orig Wed Jan 8 21:17:05 2003
++++ Makefile.in Wed Jan 8 23:13:49 2003
+@@ -745,79 +745,19 @@
+
+ # This is a list of the targets for all of the modules which are compiled
+ # using $(TARGET_FLAGS_TO_PASS).
+-ALL_TARGET_MODULES = \
+- all-target-libstdc++-v3 \
+- all-target-newlib \
+- all-target-libf2c \
+- all-target-libobjc \
+- all-target-libtermcap \
+- all-target-winsup \
+- all-target-libgloss \
+- all-target-libiberty \
+- all-target-gperf \
+- all-target-examples \
+- all-target-libffi \
+- all-target-libjava \
+- all-target-zlib \
+- all-target-boehm-gc \
+- all-target-qthreads \
+- all-target-rda
++ALL_TARGET_MODULES =
+
+ # This is a list of the configure targets for all of the modules which
+ # are compiled using the target tools.
+-CONFIGURE_TARGET_MODULES = \
+- configure-target-libstdc++-v3 \
+- configure-target-newlib \
+- configure-target-libf2c \
+- configure-target-libobjc \
+- configure-target-libtermcap \
+- configure-target-winsup \
+- configure-target-libgloss \
+- configure-target-libiberty \
+- configure-target-gperf \
+- configure-target-examples \
+- configure-target-libffi \
+- configure-target-libjava \
+- configure-target-zlib \
+- configure-target-boehm-gc \
+- configure-target-qthreads \
+- configure-target-rda
++CONFIGURE_TARGET_MODULES =
+
+ # This is a list of the check targets for all of the modules which are
+ # compiled using $(TARGET_FLAGS_TO_PASS).
+-CHECK_TARGET_MODULES = \
+- check-target-libstdc++-v3 \
+- check-target-newlib \
+- check-target-libf2c \
+- check-target-libobjc \
+- check-target-winsup \
+- check-target-libiberty \
+- check-target-gperf \
+- check-target-libffi \
+- check-target-libjava \
+- check-target-zlib \
+- check-target-boehm-gc \
+- check-target-qthreads \
+- check-target-rda
++CHECK_TARGET_MODULES =
+
+ # This is a list of the install targets for all of the modules which are
+ # compiled using $(TARGET_FLAGS_TO_PASS).
+-INSTALL_TARGET_MODULES = \
+- install-target-libstdc++-v3 \
+- install-target-newlib \
+- install-target-libf2c \
+- install-target-libobjc \
+- install-target-libtermcap \
+- install-target-winsup \
+- install-target-libgloss \
+- install-target-libiberty \
+- install-target-gperf \
+- install-target-libffi \
+- install-target-libjava \
+- install-target-zlib \
+- install-target-boehm-gc \
+- install-target-qthreads \
+- install-target-rda
++INSTALL_TARGET_MODULES =
+
+ # This is a list of the targets for which we can do a clean-{target}.
+ CLEAN_MODULES = \
+@@ -883,22 +823,7 @@
+ clean-zlib
+
+ # All of the target modules that can be cleaned
+-CLEAN_TARGET_MODULES = \
+- clean-target-libstdc++-v3 \
+- clean-target-newlib \
+- clean-target-libf2c \
+- clean-target-libobjc \
+- clean-target-winsup \
+- clean-target-libgloss \
+- clean-target-libiberty \
+- clean-target-gperf \
+- clean-target-examples \
+- clean-target-libffi \
+- clean-target-libjava \
+- clean-target-zlib \
+- clean-target-boehm-gc \
+- clean-target-qthreads \
+- clean-target-rda
++CLEAN_TARGET_MODULES =
+
+ # All of the x11 modules that can be cleaned
+ CLEAN_X11_MODULES = \