Building and AVR cross compiler on MinGW/MSYS. GCC version 3.4.2 (mingw-special) Configure with --enable-languages=c,c++ --with-dwarf2 Results in this output: --------------------------------------------------------------------------- make[2]: Entering directory `/c/avrdev/gcc/build/gcc' for d in libgcc avr3 libgcc/avr3 avr4 libgcc/avr4 avr5 libgcc/avr5; do \ if [ -d $d ]; then true; else /bin/sh ../../gcc-3.4.3/gcc/mkinstalldirs $d; fi; \ done mkdir -p -- libgcc mkdir -p -- avr3 mkdir -p -- libgcc/avr3 mkdir -p -- avr4 mkdir -p -- libgcc/avr4 mkdir -p -- avr5 mkdir -p -- libgcc/avr5 if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_mulqi3 -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_mulqi3.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_mulhi3 -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_mulhi3.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_mulsi3 -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_mulsi3.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_udivmodqi4 -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_udivmodqi4.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_divmodqi4 -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_divmodqi4.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_udivmodhi4 -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_udivmodhi4.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_divmodhi4 -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_divmodhi4.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_udivmodsi4 -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_udivmodsi4.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_divmodsi4 -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_divmodsi4.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_prologue -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_prologue.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_epilogue -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_epilogue.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_exit -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_exit.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_cleanup -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_cleanup.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_tablejump -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_tablejump.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_copy_data -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_copy_data.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_clear_bss -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_clear_bss.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_ctors -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_ctors.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_dtors -xassembler-with-cpp -c ../../gcc-3.4.3/gcc/config/avr/libgcc.S -o libgcc/./_dtors.o /c/avrdev/gcc/build/gcc/xgcc -B/c/avrdev/gcc/build/gcc/ -B/WinAVR/avr/bin/ -B/WinAVR/avr/lib/ -isystem /WinAVR/avr/include -isystem /WinAVR/avr/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/ -I../../gcc-3.4.3/gcc/../include -I../intl -DL_muldi3 -c ../../gcc-3.4.3/gcc/libgcc2.c -o libgcc/./_muldi3.o In file included from ../../gcc-3.4.3/gcc/libgcc2.c:43: ./tm.h:4:29: config/avr/avr.h: No such file or directory ./tm.h:5:28: config/dbxelf.h: No such file or directory ./tm.h:6:31: config/tm-dwarf2.h: No such file or directory ./tm.h:7:23: defaults.h: No such file or directory ../../gcc-3.4.3/gcc/libgcc2.c: In function `__mulhi3': ../../gcc-3.4.3/gcc/libgcc2.c:462: error: `BITS_PER_UNIT' undeclared (first use in this function) ../../gcc-3.4.3/gcc/libgcc2.c:462: error: (Each undeclared identifier is reported only once ../../gcc-3.4.3/gcc/libgcc2.c:462: error: for each function it appears in.) make[2]: *** [libgcc/./_muldi3.o] Error 1 make[2]: Leaving directory `/c/avrdev/gcc/build/gcc' make[1]: *** [stmp-multilib] Error 2 make[1]: Leaving directory `/c/avrdev/gcc/build/gcc' make: *** [all-gcc] Error 2 --------------------------------------------------------------------------- Building in Cygwin, but using --host=mingw32 --build=mingw32 configure switches , -mno-cygwin compiler flag, GCC 3.3.3 does build an AVR cross compiler correctly.
"-I. -I -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/" ^ ^ This looks a lot like PR12974 See comment #19 There may be a second problem here, though. On older versions of MS Windows (NT4 and win9x), trailing _forward_ slashes cause no problems for stat(). On newer versions, (eg XP) stat() does not recognise a directory that ends in a '\\' or '/', unless it is a drive root dir, such as "c:/", where it is obligatory. So on older versions the second -I../../gcc-3.4.3/gcc/ would find the headers, even if this "-I -I../../gcc-3.4.3/gcc" causes problems. Danny
According to this related thread: <http://gcc.gnu.org/ml/gcc/2005-03/msg01079.html> There is a patch on the MinGW project here: <http://sourceforge.net/tracker/?func=detail&atid=102435&aid=1053052&group_id=2435> This patch works on Win2K according to the related thread, and it works for me for WinXP.
Created attachment 8556 [details] Patch from MinGW project that fixes the problem on Win2k,XP This patch is from the MinGW project, at this bug report: <http://sourceforge.net/tracker/?func=detail&atid=102435&aid=1053052&group_id=2435>
This is a dup of bug 22133. Which has a better description of the bug. *** This bug has been marked as a duplicate of 22133 ***