The new specs file generation introduces several problems. This patch - Fix build warnings - Clean up unused code and the old, now dead specs definitions. - Removes unused files and adjust build scripts / rules. - Issues with avr-libc awareness: -- Makes specs-generation aware of avr-libc (include tm.h in build script and depend on WITH_AVRLIBC). -- avr-libc implements functions in libm.a which usually live in libgcc, hence add -lm to libgcc_spec, cf. PR54461. -- The new libdev.a is a feature of avr-libc and not available with, e.g., newlib. Hence remove it from lib_spec if the compiler is not configured for avr-libc (--with-avrlibc=no). - Many minor issues with option propagation. - -march had been added to multilib generation some time ago, but driver_self_spec was not aware of that option. Ok for trunk? BTW, anyone knows what -march= is good for? It allows all kinds of silly option combinations like "-march=avrtiny -mmcu=atmega8" without any complaints. What's wrong with -mmcu=avr* ? All architecture names start with "avr", and /no/ device name starts /with/ "avr", hence -mmcu= should be fine and work as smooth as in the last 10 years. Why that -march= option? If there is not a good reason for -march=, I'd propose to clean it up and use -mmcu=avr* instead. Johann gcc/ Fix various problems with specs file generation. * config.gcc (extra_gcc_objs) [avr]: Remove. * config/avr/driver-avr.c: Remove file. * config/avr/t-avr (driver-avr.o): Remove rule. (gen-avr-mmcu-specs): Use CXX_FOR_BUILD, CXXFLAGS_FOR_BUILD and INCLUDES to build. Depend on TM_H. * config/avr/gen-avr-mmcu-specs.c: Tidy up code. Fix various build warnings. Fix non-matching types and non-existing %-codes. (tm.h): Include. (*lib) [!WITH_AVRLIBC]: Don't link libdev.a. (*libgcc) [WITH_AVRLIBC]: Add "-lm". * config/avr/avrlibc.h (LIBGCC_SPEC): Remove definition. * config/avr/avr.h (DRIVER_SELF_SPECS): Fix handling of -march=. (CPP_SPEC, CC1PLUS_SPEC, ASM_SPEC, LINK_SPEC, LIB_SPEC) (LIBGCC_SPEC): Remove definitions.