Canadian cross build fails because the wrong compiler is used to compile gen-avr-mmcu-texi. This small tool must run on build and not on host, thus the right compiler is CC_FOR_BUILD.
Just changing the compiler is not enough because files like system.h were dragged in that were configured for host, not for build. Therefore the patch factors out the structures/enums that are shared between the programs that run on host (compiler proper, driver) and gen-avr-mmcu-texi that runs on build. With the patch the compiler build fine, both as native cross (build=host!=target) and as canadian cross (build!=host!=target!=build). Moreover, I changed the string comparator in gen-avr-mmcu-texi.c to that it prints the devices in a more appropriate order with the AVR device name nomenclature. Ok to apply? Johann * config.gcc (tm_file,avr): Add avr/avr-arch.h. * config/avr/t-avr (gen-avr-mmcu-texi): Use CC_FOR_BUILD to compile. Don't depend on TM_H. Use CFLAGS_FOR_BUILD. * config/avr/avr.h (avr_arch, base_arch_s, mcu_type_s): Source out to... * config/avr/avr-arch.h: ...this new file. * config/avr/gen-avr-mmcu-texi.c: Include avr-arch.h, stdio.h, stdlib.h. * comparator: Make letters smaller than digits. * config/avr/avr-devices.c: Don't include headers if used in gen-avr-mmcu-texi.c. * doc/avr-mmcu.texi: Regenerate.