# # This patch is not necessary, if you configure gcc for C. It is # necessary only, if gcc is configured for C++. It inhibits the building of # libiberty and libstdc++ for the target and removes the need of libstdc++.a # when linking with avr-g++. # diff -Naur gcc-3.0.2.ori/configure.in gcc-3.0.2/configure.in --- gcc-3.0.2.ori/configure.in Mon Aug 13 18:14:49 2001 +++ gcc-3.0.2/configure.in Thu Dec 20 00:37:32 2001 @@ -713,6 +713,9 @@ arm-*-riscix*) noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" ;; + avr-*-*) + noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + ;; d10v-*-*) noconfigdirs="$noconfigdirs target-librx ${libstdcxx_version} target-libgloss ${libgcj}" ;; diff -Naur gcc-3.0.2.ori/gcc/config/avr/avr.h gcc-3.0.2/gcc/config/avr/avr.h --- gcc-3.0.2.ori/gcc/config/avr/avr.h Mon Apr 16 20:25:42 2001 +++ gcc-3.0.2/gcc/config/avr/avr.h Mon Jan 7 23:18:27 2002 @@ -3086,6 +3086,11 @@ If this macro is not defined, a default is provided that loads the standard C library from the usual place. See `gcc.c'. */ +#define LIBSTDCXX "" +/* There is no libstdc++.a available for the AVR until now. So it + must be defined as nothing, that it is not added to the linker + command. */ + #define LIBGCC_SPEC \ "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lgcc }}}" /* Another C string constant that tells the GNU CC driver program how diff -Naur gcc-3.0.2.ori/gcc/cp/g++spec.c gcc-3.0.2/gcc/cp/g++spec.c --- gcc-3.0.2.ori/gcc/cp/g++spec.c Fri Feb 2 18:41:57 2001 +++ gcc-3.0.2/gcc/cp/g++spec.c Mon Jan 7 23:12:51 2002 @@ -255,8 +255,9 @@ j++; } - /* Add `-lstdc++' if we haven't already done so. */ - if (library) + /* Add `-lstdc++' if we haven't already done so and if the library + * name is defined. */ + if (library) && (strlen (LIBSTDCXX) > 0) { arglist[j++] = LIBSTDCXX; added_libraries++;